fixed confilt
This commit is contained in:
@@ -6,10 +6,12 @@
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
<div id="oqs_loading"></div>
|
||||
</div>
|
||||
<% @order_id = params[:order_id].gsub('"', '') if params[:order_id] %>
|
||||
<input type="hidden" name="type" id="role" value="<%= current_user.role%>">
|
||||
<input type="hidden" name="cashier_type" id="cashier_type" value="<%= type%>">
|
||||
<input type="hidden" name="link_type" id="link_type" value="<%= @cashier_type %>">
|
||||
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
|
||||
<input type="hidden" name="order_id" id="order_id" value= "<%= @order_id %>">
|
||||
<div class="row m-t--10 h-100">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 hidden d-flex flex-column h-100" id="menu_data">
|
||||
<li class="list-menu">
|
||||
@@ -80,7 +82,7 @@
|
||||
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 hidden h-100 d-flex flex-column m-t-10" id="menu_cache">
|
||||
<div class="card h-100">
|
||||
<div class="card h-100" style="margin-bottom: 10px;">
|
||||
<div class="card-header">
|
||||
<li class="list-menu" style="background: none">
|
||||
<a href="javascript:void(0);" id="menu_dropdown" class="menu-toggle dropdown-toggle toggled my-toggle ">
|
||||
@@ -106,8 +108,9 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-7 col-lg-7 col-sm-7 m-t-10 d-flex flex-column h-100" >
|
||||
<div class="card h-100">
|
||||
<div class="col-md-7 col-lg-7 col-sm-7 m-t-10 d-flex flex-column h-100" style="margin-left: -10px;
|
||||
margin-right: -10px;">
|
||||
<div class="card h-100" style="margin-bottom: 10px;">
|
||||
<div class="card-block d-flex flex-column h-100" style="">
|
||||
<div class="card-text" id="foodcourt-slimscroll">
|
||||
<div class="row menu_items_list" style="margin:0px 1px 0px 1px ;">
|
||||
@@ -154,11 +157,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-lg-3 col-sm-3 m-t-10 d-flex flex-column h-100 ">
|
||||
<div class="card h-100">
|
||||
<div class="col-md-3 col-lg-3 col-sm-3 m-t-10 d-flex flex-column h-100">
|
||||
<div class="card h-100" style="margin-right: -20px; margin-bottom: 10px;">
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
<button type="button" class="btn btn-lg btn-primary waves-effect col-md-12" id='app_order'>
|
||||
Mobile Orders <span class="badge badge-danger" style="font-size: 0.75rem;border-radius: 5px;"><%= @app_order_new_count %></span>
|
||||
Orders
|
||||
</button>
|
||||
<div class="row ">
|
||||
<div class="col-md-9 col-lg-9 col-sm-9 ">
|
||||
@@ -174,8 +177,15 @@
|
||||
</div>
|
||||
|
||||
<div class="card-block d-flex flex-column h-100">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="append-table">
|
||||
<!-- <div class="table-responsive">
|
||||
<table class="table m-b-0" id="append-table">
|
||||
<thead>
|
||||
|
||||
</thead>
|
||||
</table>
|
||||
</div> -->
|
||||
<div class="card-text h-100" id="foodcourt-order-slimscroll">
|
||||
<table class="table table-striped summary-items" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
@@ -184,10 +194,6 @@
|
||||
<th class="text-nowrap text-right">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text h-100" id="foodcourt-order-slimscroll">
|
||||
<table class="table table-striped summary-items fixed-header" id="order-items-table" >
|
||||
<tbody class="font-13" >
|
||||
|
||||
</tbody>
|
||||
@@ -198,15 +204,20 @@
|
||||
<div class="card-footer flex-grow-1 custom-card-footer" id="orders-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<tr>
|
||||
<td colspan="2" style="padding:2px; text-align:" class="charges-name"><strong>Total:</strong></td>
|
||||
<td style="padding:2px; text-align: center;"><strong id="total_qty">0</strong></td>
|
||||
<td style="padding:2px; text-align:" class="item-attr float-right"><strong id="sub_total">0.00</strong></td>
|
||||
<td colspan="2" style="padding:2px;" class="charges-name"><strong>Total:</strong></td>
|
||||
<td style="padding:2px 20px 2px 2px;"><strong id="total_qty">0</strong></td>
|
||||
<td style="padding:2px;" class="item-attr <%= params[:modify] ? '' : 'text-right'%>"><strong id="sub_total">0.00</strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% if @sale_id.nil?%>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="create_pay_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
|
||||
<% if params[:update] %>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12 m-t-5" id="create_pay_order" disabled="disabled" style=" height: 50px; width: 100%;">Update Order & Pay</button>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="add_to_existing_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
|
||||
<% if @sale_id.nil?%>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-4 d-inline" id="create_pay_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-4 d-inline" id="add_to_existing_order" disabled="disabled" style="padding-top:4px !important;padding-bottom:4px !important;"><i class="material-icons" style="font-size:34px;width:34px">attach_money</i></button>
|
||||
<% end %>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-7 m-l-15 d-inline" id="create_order" disabled="disabled" style="padding-top:15px !important;padding-bottom:15px !important;">Add Order</button>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -325,7 +336,8 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="mr-auto">
|
||||
<h4 class=" pull-left">Total : <span id="total_price"></span></h4>
|
||||
<h4 class=" pull-left d-inline">Total : <span id="total_price"></span></h4>
|
||||
<div id="wanring_text" class="d-inline text-danger" style="margin-left: 50px"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@@ -342,14 +354,15 @@
|
||||
|
||||
|
||||
<!-- Large modal -->
|
||||
<div class="modal sx_item_set_detailModal" id="sx_item_set_detailModal" tabindex="-1" role="dialog" aria-labelledby="sx_item_set_detailLabel" aria-hidden="true" >
|
||||
<div class="modal-dialog custom-modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal sx_item_set_detailModal h-100" id="sx_item_set_detailModal" tabindex="-1" role="dialog" aria-labelledby="sx_item_set_detailLabel" aria-hidden="true" >
|
||||
<div class="modal-dialog custom-modal-dialog modal-lg h-100">
|
||||
<div class="modal-content h-100">
|
||||
<div class="modal-header" style="background-color: #54A5AF;padding-top:10px !important;">
|
||||
<h4 class="modal-title" style="color:#fff;" id="set_name"></h4>
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">×</button>
|
||||
</div>
|
||||
<div class="modal-body" data-height="50">
|
||||
<div class="modal-body h-100" id="set-menu-item-slimscroll" data-height="50">
|
||||
<!-- id="set-menu-item-slimscroll" -->
|
||||
<div class="row set-item">
|
||||
<div class="col-md-4">
|
||||
<p class="set_default_option" style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p>
|
||||
@@ -465,6 +478,9 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$(document).on('click', '.menu_click', function(event){
|
||||
|
||||
$('.category_list').find('li').find('.nav-link').removeClass('active');
|
||||
|
||||
var menu_id = $(this).attr("data-id");
|
||||
var name = $(this).attr("data-name");
|
||||
var menus = JSON.parse(localStorage.getItem("menus"));
|
||||
|
||||
@@ -8,95 +8,186 @@
|
||||
</style>
|
||||
<%= javascript_include_tag 'custom', 'data-turbolinks-track': 'reload' %>
|
||||
|
||||
<!-- <button type="button" class="btn btn-block btn-default waves-effect float-right" id='back' style="width: 112px; margin-right: -10px">
|
||||
<i class="material-icons">reply</i>
|
||||
Back
|
||||
</button> -->
|
||||
|
||||
<div class="container-fluid h-100" style="padding:0px 3px 0px 3px;margin-top:20px">
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
<div id="oqs_loading"></div>
|
||||
</div>
|
||||
|
||||
<div class="row m-t--20 h-100">
|
||||
<% if !@booking.nil?%>
|
||||
<div class="col-md-7 col-lg-7 col-sm-12 float-left h-100 d-flex flex-column m-l-5 m-r-10" style="padding-right: 10px;">
|
||||
<% if !@booking.nil? || @pending %>
|
||||
<div class="col-md-6 col-lg-6 col-sm-12 float-left h-100 d-flex flex-column m-l-5 m-r-10" style="padding-right: 15px;">
|
||||
<% else %>
|
||||
<div class="col-md-11 col-lg-11 col-sm-12 h-100 d-flex flex-column" style="padding: 0 !important;">
|
||||
<div class="col-md-10 col-lg-10 col-sm-12 h-100 d-flex flex-column" style="padding: 0 15px 0 20px !important;">
|
||||
<% end %>
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs tab-col-teal m-t--10" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <%= 'active' if params[:active].blank? %>" data-toggle="tab" href="#mobile_orders" role="tab">Mobile Orders</a>
|
||||
<a class="nav-link <%= params[:active] == 'completed' ? 'active' : '' %>" data-toggle="tab" href="#complete" role="tab"><%= t :competed %></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <%= params[:active] ? 'active' : '' %>" data-toggle="tab" href="#complete" role="tab"><%= t :competed %></a>
|
||||
<a class="nav-link <%= 'active' if params[:active].blank? %>" data-toggle="tab" href="#pending_order" role="tab">Pending Orders</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <%= params[:active] == 'mobile' ? 'active' : '' %>" data-toggle="tab" href="#mobile_orders" role="tab">Mobile Orders</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
<div class="tab-content h-100">
|
||||
<!-- Panel 0 - Mobile Orders -->
|
||||
<div class="tab-pane <%= 'active' if params[:active].blank? %>" id='mobile_orders' role='tabpanel'>
|
||||
<div id="foodcourt-slimscroll" class="flex-grow-1">
|
||||
<div class="card-columns">
|
||||
<% bk_color ='' %>
|
||||
<% @bookings.each do |bk|
|
||||
bk_status ='new'
|
||||
<div class="tab-content h-100 d-flex flex-column">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane h-100 <%= params[:active] == 'completed' ? 'active' : '' %>" id="complete" role="tabpanel">
|
||||
<div class="d-flex flex-column h-100">
|
||||
<div id="foodcourt-menu-slimscroll" class="flex-grow-1">
|
||||
<div class="card-columns p-l-10">
|
||||
<% bk_color ='' %>
|
||||
<% @completed.each do |c| %>
|
||||
<%
|
||||
if !@booking.nil?
|
||||
if c.booking_id == @booking.booking_id
|
||||
bg_color ='bg-secondary'
|
||||
else
|
||||
if c.sale.sale_status == 'void'
|
||||
bg_color = 'bg-danger'
|
||||
elsif c.sale.sale_status == 'completed'
|
||||
bg_color = 'bg-success'
|
||||
end
|
||||
end
|
||||
else
|
||||
if c.sale.sale_status == 'void'
|
||||
bg_color = 'bg-danger'
|
||||
elsif c.sale.sale_status == 'completed'
|
||||
bg_color = 'bg-success'
|
||||
end
|
||||
end
|
||||
%>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(booking_id: c.booking_id, active: 'completed'), class: 'item-card' do %>
|
||||
<div class="card <%= bg_color %> text-white" data-id ="<%= c.booking_id %>">
|
||||
<div class="card-block">
|
||||
<%= c.contact_no %><span style="font-size:12px;float:right;line-height:inherit;"> <%= c.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span><br>
|
||||
<%= c.orders.first.try(:order_id) %><span style="font-size:12px;float:right;line-height:inherit;"><%= c.booking_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
if !@booking.nil?
|
||||
if bk.booking_id == @booking.booking_id
|
||||
bk_color ='bg-secondary'
|
||||
<% @pending_completed.each do |pc| %>
|
||||
<% if @pending.present? %>
|
||||
<% if @pending.sale_id == pc.sale_id %>
|
||||
<% bg_color = 'bg-secondary' %>
|
||||
<% else %>
|
||||
<% if pc.sale_status == 'void' %>
|
||||
<% bg_color = 'bg-danger' %>
|
||||
<% elsif pc.sale_status == 'completed' %>
|
||||
<% bg_color = 'bg-success' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if pc.sale_status == 'void' %>
|
||||
<% bg_color = 'bg-danger' %>
|
||||
<% elsif pc.sale_status == 'completed' %>
|
||||
<% bg_color = 'bg-success' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(pending_id: pc.sale_id, active: 'completed'), class: 'item-card' do %>
|
||||
<div class="card <%= bg_color %> text-white">
|
||||
<div class="card-block">
|
||||
<%= pc.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"> <%= pc.created_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<br>
|
||||
<span style="font-size:12px;float:right;line-height: 30px;"><%= pc.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Panel 1 - Pending Orders -->
|
||||
<div class="tab-pane <%= 'active' if params[:active].blank? %> h-100" id="pending_order" role="tabpanel">
|
||||
<div class="h-100 d-flex flex-column">
|
||||
<div id="foodcourt-order-slimscroll" class="h-100">
|
||||
<div class="card-columns p-l-10">
|
||||
<% @pending_sales.each do |sale| %>
|
||||
<% if @pending.present? %>
|
||||
<% if @pending.sale_id == sale.sale_id %>
|
||||
<% bg_color = 'bg-secondary' %>
|
||||
<% else %>
|
||||
<% bg_color = 'bg-danger' %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% bg_color = 'bg-danger' %>
|
||||
<% end %>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(pending_id: sale.sale_id), class: 'item-card' do %>
|
||||
<div class="card sales <%= bg_color %> text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<span class="float-right"><%= sale.created_at.strftime('%I:%M %p') %></span>
|
||||
<br>
|
||||
<span class = 'float-right m-t-5'>Billed</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% @pending_orders.each do |order| %>
|
||||
<% if @pending.present? && @status == 'order' %>
|
||||
<% if @pending.booking_id == order.booking_id %>
|
||||
<% bg_color = 'bg-secondary' %>
|
||||
<% else %>
|
||||
<% bg_color = 'blue' %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% bg_color = 'blue' %>
|
||||
<% end %>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(pending_id: order.booking_id), class: 'item-card' do %>
|
||||
<div class="card sales <%= bg_color %> text-white" data-id = "<%= order.booking_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.booking_id %>
|
||||
<span class="float-right"><%= order.created_at.strftime('%I:%M-%p') %></span>
|
||||
<br>
|
||||
<span class="float-right m-t-5">new</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Panel 2 - Mobile Orders -->
|
||||
<div class="tab-pane h-100 <%= params[:active] == 'mobile' ? 'active' : '' %>" id='mobile_orders' role='tabpanel'>
|
||||
<div class="h-100 d-flex flex-column">
|
||||
<div id="foodcourt-slimscroll" class="flex-grow-1">
|
||||
<div class="card-columns p-l-10">
|
||||
<% bk_color ='' %>
|
||||
<% @bookings.each do |bk|
|
||||
bk_status ='new'
|
||||
|
||||
if !@booking.nil?
|
||||
if bk.booking_id == @booking.booking_id
|
||||
bk_color ='bg-secondary'
|
||||
else
|
||||
bk_color =bk.booking_status
|
||||
end
|
||||
else
|
||||
bk_color =bk.booking_status
|
||||
end
|
||||
else
|
||||
bk_color =bk.booking_status
|
||||
end %>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(booking_id:bk.booking_id), class: 'item-card' do %>
|
||||
<div class="card <%= bk_color %> text-white" data-id ="<%= bk.booking_id %>">
|
||||
<div class="card-block">
|
||||
<%= bk.contact_no %><span style="font-size:12px;float:right;line-height:inherit;"> <%= bk.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span><br>
|
||||
<%= bk.orders.first.try(:order_id) %><span style="font-size:12px;float:right;line-height:inherit;"><%= bk_status %></span>
|
||||
end %>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(booking_id:bk.booking_id, active: 'mobile'), class: 'item-card' do %>
|
||||
<div class="card <%= bk_color %> text-white" data-id ="<%= bk.booking_id %>">
|
||||
<div class="card-block">
|
||||
<%= bk.contact_no %><span style="font-size:12px;float:right;line-height:inherit;"> <%= bk.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span><br>
|
||||
<%= bk.orders.first.try(:order_id) %><span style="font-size:12px;float:right;line-height:inherit;"><%= bk_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Completed Orders -->
|
||||
<div class="tab-pane <%= params[:active] ? 'active' : '' %>" id="complete" role="tabpanel">
|
||||
<div class="card-columns">
|
||||
<% bk_color ='' %>
|
||||
<% @completed.each do |c| %>
|
||||
<%
|
||||
if !@booking.nil?
|
||||
if c.booking_id == @booking.booking_id
|
||||
bk_color ='bg-secondary'
|
||||
else
|
||||
bk_color = c.booking_status
|
||||
end
|
||||
else
|
||||
bk_color = c.booking_status
|
||||
end
|
||||
%>
|
||||
<%= link_to foodcourt_app_order_by_booking_path(booking_id: c.booking_id, active: 'completed'), class: 'item-card' do %>
|
||||
<div class="card <%= bk_color %> text-white" data-id ="<%= c.booking_id %>">
|
||||
<div class="card-block">
|
||||
<%= c.contact_no %><span style="font-size:12px;float:right;line-height:inherit;"> <%= c.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span><br>
|
||||
<%= c.orders.first.try(:order_id) %><span style="font-size:12px;float:right;line-height:inherit;">competed</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if !@booking.nil?%>
|
||||
<div class="col-md-4 col-lg-4 col-sm-12 h-100 d-flex flex-column m-l--15">
|
||||
<div class="col-md-5 col-lg-5 col-sm-12 h-100 d-flex flex-column m-l--15" style="padding-right: 15px">
|
||||
<span id="sale_id" style="display:none"><%= @booking.sale_id %></span>
|
||||
<div class="card h-100" style="margin-bottom: 10px !important">
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
@@ -111,7 +202,7 @@
|
||||
<span class="font-14 float-left d-inline"><b>Booking</b> - <%=@booking.booking_id%></span>
|
||||
<span class="font-14 float-right d-inline"><b>Order No</b> - <%=@booking.order_id%></span>
|
||||
</div>
|
||||
<div class="card-text h-100" id="foodcourt-order-slimscroll" style="overflow-y: auto">
|
||||
<div class="card-text h-100" id="foodcourt-table-slimscroll" style="overflow-y: auto">
|
||||
<table class="table table-striped summary-items fixed-header">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -164,20 +255,185 @@
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="done_order" style="margin: 10px 0 -2px 12px; width: 95%; font-size: 1.3rem">
|
||||
DONE
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-md-1 col-lg-1 col-sm-12 h-100 d-flex flex-column" style="padding-right: 10px;">
|
||||
|
||||
<% if @pending %>
|
||||
<div class="col-md-5 col-lg-5 col-sm-12 h-100 d-flex flex-column m-l--15" style="padding-right: 15px">
|
||||
<% if @status == 'sale' %>
|
||||
<span id="sale_id" style="display:none"><%= @pending.try(:sale_id) %></span>
|
||||
<% elsif @status == 'order' %>
|
||||
<span id="sale_id" style="display:none"><%= @pending.try(:booking_id) %></span>
|
||||
<% end %>
|
||||
<div class="card" style="height: 100%; margin-bottom: 10px;">
|
||||
<div class="card-header">
|
||||
<div>
|
||||
<strong id="order-title">INVOICE DETAILS </strong>| Table - <%= @pending.dining_facility.name rescue "" %>
|
||||
</div>
|
||||
<div class="row p-l-5 p-r-5">
|
||||
<% if @status == 'sale' || @pending.try(:sale_status) == 'completed' || @pending.try(:sale_status) == 'void' %>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
Receipt No:
|
||||
<span id="receipt_no">
|
||||
<%= @pending.receipt_no rescue '' %>
|
||||
</span>
|
||||
</div>
|
||||
<% else%>
|
||||
<!-- <input type="hidden" id="save_order_id" value="<%#=@bookings.booking_orders[0].order_id%>"> -->
|
||||
<div class="col-lg-8 col-md-8 col-sm-8">
|
||||
Order No: <span id="receipt_no">
|
||||
<%= @pending.booking_orders.first.order_id rescue '' %></span>
|
||||
</div>
|
||||
<% end%>
|
||||
|
||||
<% if @status == 'sale' || @pending.try(:sale_status) == 'completed' || @pending.try(:sale_status) == 'void' %>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
Date: <span id="receipt_date"><%= @pending.created_at.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%> </span>
|
||||
</div>
|
||||
<% else%>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 text-right">
|
||||
Date: <span id="receipt_date"><%= @pending.orders.first.created_at.strftime("%I:%M %p") rescue '-'%> </span>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="row customer_detail p-l-5 p-r-5">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<% if @status == 'sale' %>
|
||||
Customer: <%= @pending.customer.name rescue "-" %>
|
||||
<% else%>
|
||||
Customer: <%= @pending.orders.first.customer.name rescue "-" %>
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-block d-flex flex-column h-100">
|
||||
<div class="card-text h-100" id="foodcourt-table-slimscroll" style="overflow-y: auto">
|
||||
<table class="table table-striped fixed-header" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</th>
|
||||
<th class="item-attr">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @status == 'sale' %>
|
||||
<% sub_total = 0
|
||||
@pending.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
<% else %>
|
||||
<% sub_total = 0
|
||||
total = 0
|
||||
@pending.order_items.each do |order_item|
|
||||
total = order_item.qty * order_item.price
|
||||
sub_total = sub_total + total %>
|
||||
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= total %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<% if @status == 'sale' %>
|
||||
<tr>
|
||||
<%if @pending.discount_type == 'member_discount'%>
|
||||
<td class="charges-name"><strong>Member Discount:</strong></td>
|
||||
<%else%>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<%end%>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @sale.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr"><strong id="order-round-adj"><%= @sale.rounding_adjustment rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @sale.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr class="rebate_amount"></tr>
|
||||
<% else%>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if @pending || @booking %>
|
||||
<div class="col-md-1 col-lg-1 col-sm-12 h-100 d-flex flex-column" style="padding-right: 5px; margin-left: -5px;">
|
||||
<% else %>
|
||||
<div class="col-md-2 col-lg-2 col-sm-12 h-100 d-flex flex-column" style="padding: 0 15px 0 5px;">
|
||||
<% end %>
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
<%= t("views.btn.back") %>
|
||||
</button>
|
||||
<% if !@booking.nil?%>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||
<% if @booking && @booking.booking_status == 'assign' %>
|
||||
<button type="button" class="btn btn-primary btn-block waves-effect create" id="done_order">
|
||||
DONE
|
||||
</button>
|
||||
<% end %>
|
||||
<% if @booking && @booking.booking_status != 'void' %>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void </a>
|
||||
<% end %>
|
||||
|
||||
<!-- pending order button list -->
|
||||
<% if @pending && params[:active].nil? %>
|
||||
|
||||
<% if current_user.role != "waiter" || @status != "sale"%>
|
||||
<button type="button" id="addorder" class="btn bg-blue btn-block">Update Order</button>
|
||||
<%end%>
|
||||
|
||||
<% if current_user.role != "waiter" && @status != "order"%>
|
||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||
<%end%>
|
||||
|
||||
<% if @status != "sale"%>
|
||||
<!-- <button type="button" id="request_bills" class="btn btn-block bg-blue waves-effect">Req.Bill</button> -->
|
||||
<% order_id = @pending.try(:orders).try(:first).try(:order_id) if @status == 'order' %>
|
||||
<%= link_to 'Req.Bill', "/foodcourt/food_court/#{order_id}/request_bill", class: 'btn btn-block bg-blue waves-effect' %>
|
||||
<%end%>
|
||||
|
||||
<% elsif @pending && params[:active] == 'completed' %>
|
||||
<% if current_user.role != "waiter" %>
|
||||
<% if @pending.sale_status != 'void' && @pending.sale_status != 'waste' && @pending.sale_status != 'spoile' %>
|
||||
<% if current_user.role == "cashier" %>
|
||||
<% if @pending.payment_status != 'foc' %>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||
<% end %>
|
||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="reprint"> Re.Print</a>
|
||||
<% else %>
|
||||
<% if @pending.payment_status != 'foc' %>
|
||||
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" readonly= "<%= (can? :overall_void, :void)? 'true': 'false' %>" > Void </button>
|
||||
<% end %>
|
||||
<button type="button" id="reprint" class="btn bg-blue btn-block">Re.Print</button>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -239,6 +495,33 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#pay').on('click', function () {
|
||||
var cashier_type = 'food_court';
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/foodcourt/sale/' + sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
|
||||
$('#addorder').on('click', function () {
|
||||
var status = "<%= @status %>"
|
||||
if (status == 'sale'){
|
||||
var table_id = "<%= @pending.try(:bookings).try(:first).try(:dining_facility).try(:id) %>"
|
||||
var booking_id = "<%= @pending.try(:bookings).try(:first).try(:id) %>"
|
||||
}
|
||||
else {
|
||||
var table_id = "<%= @pending.try(:dining_facility).try(:id) %>";
|
||||
var booking_id = "<%= @pending.try(:booking_id) %>";
|
||||
var order_id = "<%= @pending.try(:orders).try(:first).try(:order_id) %>";
|
||||
}
|
||||
|
||||
var sale_id = $("#sale_id").text();
|
||||
if (table_id) {
|
||||
window.location.href = '/foodcourt/food_court/modify_order/' + table_id + "/"+sale_id +'?update=true';
|
||||
}else{
|
||||
window.location.href = '/foodcourt/food_court/modify_order/'+ booking_id+"/" +sale_id +'?update=true&order_id="'+order_id+'"'
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#back').on('click', function () {
|
||||
window.location.href ="<%=foodcourt_food_court_path %>";
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<div class="row clearfix h-100">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 d-flex flex-column h-100">
|
||||
<div class="card h-100">
|
||||
<div class="card h-100" style="margin-bottom: 15px">
|
||||
<div class="card-header m-l-5 m-r-5">
|
||||
<div id="order-title">
|
||||
<div class="row p-l-5 p-r-5">
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<div class="card-block m-l-5 m-r-5 m-t--10 d-flex flex-column h-100">
|
||||
<div class="card-title">
|
||||
<div id="table-details" class="card-text">
|
||||
<div class="card-text">
|
||||
<table class="table" id="append-table">
|
||||
<tr>
|
||||
<!-- <tr> -->
|
||||
@@ -66,7 +66,7 @@
|
||||
<div id="foodcourt-slimscroll" class="h-100">
|
||||
<!-- <div id="table-details" class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll"> -->
|
||||
<div id="table-details" class="card-text m-t--10" >
|
||||
<table class="table" id="append-table">
|
||||
<table class="table summary-items" id="append-table">
|
||||
<tbody>
|
||||
<% sub_total = 0
|
||||
count = 0
|
||||
@@ -159,12 +159,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 d-flex flex-column h-100">
|
||||
<div class="card h-100">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 d-flex flex-column h-100" style="padding-right: 10px;">
|
||||
<div class="card h-100" style="margin-bottom: 15px">
|
||||
<div class="card-header" style="margin-bottom: 20%;">
|
||||
<div class="row m-l-5 m-r-5 m-t-20" style="padding-bottom: 14px;">
|
||||
<div class="col-md-8"><strong class='amount_balance' style="font-size: 30px">Amount Due: <% if !@sale_payment.nil? %>( Credit )<% end %></strong></div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4 text-right">
|
||||
<strong>
|
||||
<span id="grand_total" class="hidden">
|
||||
<% if @sale_payment.nil? %>
|
||||
@@ -196,6 +196,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
<%= link_to '/foodcourt/app_orders', class: 'btn btn-block btn-default waves-effect', style: "padding-top: 0;" do%>
|
||||
<i class="material-icons">reply</i>
|
||||
BACK
|
||||
<% end %>
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='refresh'>
|
||||
Refresh
|
||||
</button>
|
||||
@@ -444,7 +448,7 @@
|
||||
<div id="sxModal-Content">
|
||||
<h3>Card Tap</h3>
|
||||
</div>
|
||||
<div class="m-r-20" align="right">
|
||||
<div style="position: absolute; bottom: 0; margin-left: 45%; margin-bottom: 60px;">
|
||||
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user