Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -834,7 +834,6 @@ $(function() {
|
|||||||
option_name = ' ';
|
option_name = ' ';
|
||||||
data_option = '[]';
|
data_option = '[]';
|
||||||
}
|
}
|
||||||
console.log(d_option)
|
|
||||||
var rowCount = $('.summary-items tbody tr').length+1;
|
var rowCount = $('.summary-items tbody tr').length+1;
|
||||||
var item_row = $('.summary-items tbody tr');
|
var item_row = $('.summary-items tbody tr');
|
||||||
|
|
||||||
@@ -842,7 +841,7 @@ console.log(d_option)
|
|||||||
item_code = $(item_row[i]).attr('data-code');
|
item_code = $(item_row[i]).attr('data-code');
|
||||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||||
r_option = $(item_row[i]).attr('data-opt');
|
r_option = $(item_row[i]).attr('data-opt');
|
||||||
console.log(r_option)
|
|
||||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
||||||
if (qty > 1) {
|
if (qty > 1) {
|
||||||
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ class Origami::PendingOrderController < BaseOrigamiController
|
|||||||
# @order = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status = 'billed' and source = 'quick_service'",DateTime.now.strftime('%Y-%m-%d'))
|
# @order = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status = 'billed' and source = 'quick_service'",DateTime.now.strftime('%Y-%m-%d'))
|
||||||
@sale = Sale.pending_sale
|
@sale = Sale.pending_sale
|
||||||
@order = Sale.pending_order
|
@order = Sale.pending_order
|
||||||
|
@completed = Sale.completed_sale
|
||||||
end
|
end
|
||||||
def show
|
def show
|
||||||
@sales = Sale.pending_sale
|
@sales = Sale.pending_sale
|
||||||
@orders = Sale.pending_order
|
@orders = Sale.pending_order
|
||||||
|
@completed = Sale.completed_sale
|
||||||
@id = params[:sale_id]
|
@id = params[:sale_id]
|
||||||
if(@id[0,3] == "SAL")
|
if(@id[0,3] == "SAL")
|
||||||
@sale = Sale.find(@id)
|
@sale = Sale.find(@id)
|
||||||
@@ -41,4 +42,27 @@ class Origami::PendingOrderController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def completed_sale
|
||||||
|
@sales = Sale.pending_sale
|
||||||
|
@orders = Sale.pending_order
|
||||||
|
@completed = Sale.completed_sale
|
||||||
|
@id = params[:sale_id]
|
||||||
|
|
||||||
|
@sale = Sale.find(@id)
|
||||||
|
@order = SaleOrder.find_by_sale_id(@sale.sale_id).order_id
|
||||||
|
@booking = BookingOrder.find_by_order_id(@order).booking_id
|
||||||
|
@bookings = Booking.find(@booking)
|
||||||
|
@status = "sale"
|
||||||
|
|
||||||
|
if @bookings.dining_facility_id.to_i > 0
|
||||||
|
@table_id = Booking.find(@bookings.booking_id).dining_facility_id
|
||||||
|
@dining = DiningFacility.find(@table_id)
|
||||||
|
else
|
||||||
|
@table_id = nil
|
||||||
|
@dining = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -49,12 +49,17 @@ class MenuCategory < ApplicationRecord
|
|||||||
from = from_t.hour * 3600 + from_t.min*60 + from_t.sec
|
from = from_t.hour * 3600 + from_t.min*60 + from_t.sec
|
||||||
to = to_t.hour * 3600 + to_t.min* 60 + to_t.sec
|
to = to_t.hour * 3600 + to_t.min* 60 + to_t.sec
|
||||||
current = current_t.hour * 3600 + current_t.min*60+current_t.sec
|
current = current_t.hour * 3600 + current_t.min*60+current_t.sec
|
||||||
|
|
||||||
if from > to
|
if from > to
|
||||||
h = to_t.hour
|
h = to_t.hour
|
||||||
if h < 12 # before noon
|
if h < 12 # before noon
|
||||||
if h == 0
|
if h == 0
|
||||||
to = 24
|
to = 24
|
||||||
to = to * 3600 + to_t.min* 60 + to_t.sec
|
to = to * 3600 + to_t.min* 60 + to_t.sec
|
||||||
|
else
|
||||||
|
|
||||||
|
h += 24
|
||||||
|
to = h*3600 + to_t.min* 60 + to_t.sec
|
||||||
end
|
end
|
||||||
else # (after) noon
|
else # (after) noon
|
||||||
if h > 12
|
if h > 12
|
||||||
@@ -64,10 +69,6 @@ class MenuCategory < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# from = from.split(':').map { |a| a.to_i }.inject(0) { |a, b| a * 60 + b}
|
|
||||||
# to = to.split(':').map { |a| a.to_i }.inject(0) { |a, b| a * 60 + b}
|
|
||||||
# current = current.split(':').map { |a| a.to_i }.inject(0) { |a, b| a * 60 + b}
|
|
||||||
|
|
||||||
day = Date.today.wday
|
day = Date.today.wday
|
||||||
dayresult = menu.valid_days.include?(day.to_s)
|
dayresult = menu.valid_days.include?(day.to_s)
|
||||||
|
|
||||||
|
|||||||
@@ -2604,6 +2604,13 @@ end
|
|||||||
query = query.where("bookings.booking_status = 'assign' AND orders.status = 'new' AND orders.source =? ","quick_service")
|
query = query.where("bookings.booking_status = 'assign' AND orders.status = 'new' AND orders.source =? ","quick_service")
|
||||||
.group("bookings.booking_id")
|
.group("bookings.booking_id")
|
||||||
end
|
end
|
||||||
|
def self.completed_sale
|
||||||
|
query = Sale.all
|
||||||
|
query = query.joins("join sale_orders as sale_orders on sale_orders.sale_id = sales.sale_id")
|
||||||
|
.joins("join orders as orders on orders.order_id = sale_orders.order_id")
|
||||||
|
query = query.where("sales.sale_status != 'new' AND orders.status = 'billed' AND orders.source =? ","quick_service")
|
||||||
|
.group("sales.sale_id")
|
||||||
|
end
|
||||||
|
|
||||||
def self.all_receipts
|
def self.all_receipts
|
||||||
query = Sale.select("sale_payments.created_at as receipt_close_time,
|
query = Sale.select("sale_payments.created_at as receipt_close_time,
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
move_down line_move
|
move_down line_move
|
||||||
sub_total = 0.0
|
sub_total = 0.0
|
||||||
total_qty = 0.0
|
total_qty = 0.0
|
||||||
|
|
||||||
sale_items.each do |item|
|
sale_items.each do |item|
|
||||||
# check for item not to show
|
# check for item not to show
|
||||||
if item.price != 0
|
if item.price != 0
|
||||||
@@ -206,7 +207,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
total_price = item.price #item.qty*item.unit_price - comment for room charges
|
total_price = item.price #item.qty*item.unit_price - comment for room charges
|
||||||
price = item.unit_price
|
price = item.unit_price
|
||||||
product_name = item.product_name
|
product_name = item.product_name
|
||||||
|
total_qty += item.qty
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
@@ -246,6 +247,7 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do
|
bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do
|
||||||
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def all_total(sale_data,precision,delimiter)
|
def all_total(sale_data,precision,delimiter)
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
||||||
<div id="oqs_loading_wrapper" style="display:none;">
|
|
||||||
<div id="oqs_loading"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% type = request.path_info.include?('quick_service')%>
|
<% type = request.path_info.include?('quick_service')%>
|
||||||
<% modify_order = request.path_info.include?('modify_order')%>
|
<% modify_order = request.path_info.include?('modify_order')%>
|
||||||
<input type="hidden" name="type" id="role" value="<%= current_user.role%>">
|
|
||||||
|
|
||||||
|
<div class="container-fluid " style="padding:">
|
||||||
|
<div id="oqs_loading_wrapper" style="display:none;">
|
||||||
|
<div id="oqs_loading"></div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="type" id="role" value="<%= current_user.role%>">
|
||||||
<div class="row m-t--20">
|
<div class="row m-t--20">
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<!-- <a href="javascript:void(0);" class="dropdown-toggle waves-block p-t-15 p-l-15 p-b-15" data-toggle="dropdown" aria-haspopup="" aria-expanded="true" style="background-color: #eeeeee;border-bottom: .214rem solid #fff;border-left: 1px solid #54A5AF;
|
<!-- <a href="javascript:void(0);" class="dropdown-toggle waves-block p-t-15 p-l-15 p-b-15" data-toggle="dropdown" aria-haspopup="" aria-expanded="true" style="background-color: #eeeeee;border-bottom: .214rem solid #fff;border-left: 1px solid #54A5AF;
|
||||||
@@ -164,7 +166,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<%end%>
|
<%end%>
|
||||||
<br>
|
<br>
|
||||||
<div class="card-header" style="padding: 0.5rem 0.25rem">
|
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||||
<% if type %>
|
<% if type %>
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<div class="col-md-6 col-lg-6 col-sm-12">
|
<div class="col-md-6 col-lg-6 col-sm-12">
|
||||||
@@ -173,11 +175,11 @@
|
|||||||
|
|
||||||
<% if modify_order %>
|
<% if modify_order %>
|
||||||
<% if @table.nil? %>
|
<% if @table.nil? %>
|
||||||
<div class="col-md-6 col-lg-6 col-sm-6">Table : </div>
|
<div class="col-md-5 col-lg-5 col-sm-5">Table : </div>
|
||||||
<p class="hidden" id="table_id"><%=@table_id%></p>
|
<p class="hidden" id="table_id"><%=@table_id%></p>
|
||||||
<p class="hidden" id="table_type"></p>
|
<p class="hidden" id="table_type"></p>
|
||||||
<% else%>
|
<% else%>
|
||||||
<div class="col-md-6 col-lg-6 col-sm-6">Table : <%=@table.name%></div>
|
<div class="col-md-5 col-lg-5 col-sm-5">Table : <%=@table.name%></div>
|
||||||
<p class="hidden" id="table_id"><%=@table_id%></p>
|
<p class="hidden" id="table_id"><%=@table_id%></p>
|
||||||
<p class="hidden" id="table_type"><%=@table.type%></p>
|
<p class="hidden" id="table_type"><%=@table.type%></p>
|
||||||
<% end%>
|
<% end%>
|
||||||
@@ -185,18 +187,39 @@
|
|||||||
<p class="hidden" id="booking_id"><%=@booking_id%></p>
|
<p class="hidden" id="booking_id"><%=@booking_id%></p>
|
||||||
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : '---'%></p>
|
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : '---'%></p>
|
||||||
<p class="hidden" id="sale_id"><%=@sale_id%></p>
|
<p class="hidden" id="sale_id"><%=@sale_id%></p>
|
||||||
<% else%>
|
|
||||||
<p class="hidden" id="table_type"></p>
|
<div class="col-md-1 col-lg-1 col-sm-1">
|
||||||
<% end%>
|
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<% else%>
|
<% else%>
|
||||||
<div>
|
<p class="hidden" id="table_type"></p>
|
||||||
<strong id="order-title" class="font-14">ORDER DETAILS </strong>| <span class="font-14">Table-<%=@table.name%></span>
|
<div class="col-md-2 col-lg-2 col-sm-2">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-lg-3 col-sm-3">
|
||||||
|
<button type="button" class="btn btn-xs btn-danger waves-effect float-left" id='clear_all'> Clear
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<div class="row ">
|
||||||
|
<div class="col-md-9 col-lg-9 col-sm-9 ">
|
||||||
|
<strong id="order-title" class="font-14 p-l-10">ORDER DETAILS </strong>| <span class="font-14">Table-<%=@table.name%></span>
|
||||||
|
|
||||||
|
|
||||||
<p class="hidden" id="table_id"><%=@table_id%></p>
|
<p class="hidden" id="table_id"><%=@table_id%></p>
|
||||||
<p class="hidden" id="table_type"><%=@table.type%></p>
|
<p class="hidden" id="table_type"><%=@table.type%></p>
|
||||||
<p class="hidden" id="booking_id"><%=@booking_id%></p>
|
<p class="hidden" id="booking_id"><%=@booking_id%></p>
|
||||||
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
|
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-3 col-lg-3 col-sm-3">
|
||||||
|
<button type="button" class="btn btn-xs btn-danger waves-effect" id='clear_all'>Clear
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -252,10 +275,7 @@
|
|||||||
<div class=" modal" id="sx_itemModal" tabindex="-1" role="dialog" aria-labelledby="sx_itemModalLabel" aria-hidden="true" style="">
|
<div class=" modal" id="sx_itemModal" tabindex="-1" role="dialog" aria-labelledby="sx_itemModalLabel" aria-hidden="true" style="">
|
||||||
<div class="modal-dialog custom-modal-dialog" role="document">
|
<div class="modal-dialog custom-modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
||||||
<h4 class="modal-title"></h4>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<table width="100%" class="table table-striped">
|
<table width="100%" class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -269,7 +289,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="item_name" id="modal-item-name"></td>
|
<td class="item_name" id="modal-item-name"></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="number" name="qty" class="form-control col-md-12 input-number" id="modal-qty" value="" min="1" max="100">
|
<input type="number" name="qty" class="form-control col-md-12 input-number" data-value="0" id="modal-qty" value="" min="1" max="10000">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" id="remove" class="btn btn-danger" data-dismiss="modal">Remove</button>
|
<button type="button" id="remove" class="btn btn-danger" data-dismiss="modal">Remove</button>
|
||||||
@@ -277,6 +297,24 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="row bottom p-l-15 p-r-15 m-t-10">
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="1" data-type="num">1</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="2" data-type="num">2</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="3" data-type="num">3</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="4" data-type="num">4</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom p-l-15 p-r-15">
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="5" data-type="num">5</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="6" data-type="num">6</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="7" data-type="num">7</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="8" data-type="num">8</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bottom p-l-15 p-r-15">
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="9" data-type="num">9</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="0" data-type="num">0</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left" data-value="00" data-type="num">00</div>
|
||||||
|
<div class="col-md-3 cashier_number border-top border-left orange" data-type="clr">Clr</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -308,26 +346,21 @@
|
|||||||
<div class="row no-set-item">
|
<div class="row no-set-item">
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<p style="text-align: center;" id="modal_box_img"></p>
|
<p style="text-align: center;" id="modal_box_img"></p>
|
||||||
|
|
||||||
|
|
||||||
<!-- <label class="col-md-6" style="margin-top:5px">Quantity</label>
|
|
||||||
<input type="number" name="qty" class="form-control col-md-5 input-number change_qty" id="change_qty" value="" min="1" max="100"> -->
|
|
||||||
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-btn">
|
<input type="text" value="1" id="count" class="change_qty keypress_qty form-control col-md-6 ">
|
||||||
<button type="button" class="btn btn-danger btn-number" value="-" id="minus">
|
<span class="input-group-btn col-md-3">
|
||||||
|
<button type="button" class="btn btn-danger btn-block btn-number" value="-" id="minus">
|
||||||
<i class="material-icons">remove</i>
|
<i class="material-icons">remove</i>
|
||||||
|
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<input type="text" value="1" id="count" class="change_qty keypress_qty form-control col-md-12 ">
|
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn col-md-3">
|
||||||
<button type="button" class="btn btn-success btn-number" value="+" id="plus">
|
<button type="button" class="btn btn-success btn-block btn-number" value="+" id="plus">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="hidden" id="unit_price"></p>
|
<p class="hidden" id="unit_price"></p>
|
||||||
<p class="hidden" id="instance_code"></p>
|
<p class="hidden" id="instance_code"></p>
|
||||||
<p class="hidden" id="instance_name"></p>
|
<p class="hidden" id="instance_name"></p>
|
||||||
@@ -491,7 +524,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||||
|
</div>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.fadeInRight{
|
.fadeInRight{
|
||||||
-webkit-animation-duration: 350ms !important;
|
-webkit-animation-duration: 350ms !important;
|
||||||
@@ -514,7 +547,6 @@
|
|||||||
$('.confirm_table').attr("data-id",dining_id)
|
$('.confirm_table').attr("data-id",dining_id)
|
||||||
$('.confirm_table').attr("data-name",name)
|
$('.confirm_table').attr("data-name",name)
|
||||||
$('.confirm_table').attr("data-type",type)
|
$('.confirm_table').attr("data-type",type)
|
||||||
|
|
||||||
});
|
});
|
||||||
$(".confirm_table").on('click', function () {
|
$(".confirm_table").on('click', function () {
|
||||||
var dining_id = $(this).attr("data-id");
|
var dining_id = $(this).attr("data-id");
|
||||||
@@ -523,9 +555,7 @@
|
|||||||
$('#table_id').val(dining_id)
|
$('#table_id').val(dining_id)
|
||||||
$('#table_type').text(type)
|
$('#table_type').text(type)
|
||||||
$('.select_table').text(name)
|
$('.select_table').text(name)
|
||||||
|
|
||||||
console.log(type)
|
console.log(type)
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#pending_order').on('click', function () {
|
$('#pending_order').on('click', function () {
|
||||||
@@ -594,6 +624,49 @@
|
|||||||
}
|
}
|
||||||
//end show list function
|
//end show list function
|
||||||
|
|
||||||
|
$(document).on('click', '#clear_all', function(event){
|
||||||
|
$(".summary-items tbody").empty();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
|
if(event.handled !== true) {
|
||||||
|
var original_value;
|
||||||
|
original_value = $('#modal-qty').attr('data-value');
|
||||||
|
original_qty = $('#modal-qty').val();
|
||||||
|
var input_type = $(this).attr("data-type");
|
||||||
|
|
||||||
|
switch (input_type) {
|
||||||
|
case 'num':
|
||||||
|
var input_value = $(this).attr("data-value");
|
||||||
|
if (original_value == "0"){
|
||||||
|
console.log("hi")
|
||||||
|
$('#modal-qty').val(input_value);
|
||||||
|
$('#modal-qty').attr('data-value',input_value);
|
||||||
|
// update_total_amount();
|
||||||
|
}else{
|
||||||
|
console.log("aaaaaaaaaa")
|
||||||
|
$('#modal-qty').val(original_qty + input_value);
|
||||||
|
$('#modal-qty').attr('data-value',original_qty + input_value);
|
||||||
|
// update_total_amount();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
|
||||||
|
case 'del' :
|
||||||
|
|
||||||
|
case 'clr':
|
||||||
|
$('#modal-qty').val(1);
|
||||||
|
$('#modal-qty').attr('data-value',0);
|
||||||
|
// update_total_amount();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
event.handled = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/* check webview loaded*/
|
/* check webview loaded*/
|
||||||
var webview = '';
|
var webview = '';
|
||||||
<%if @webview %>
|
<%if @webview %>
|
||||||
|
|||||||
207
app/views/origami/pending_order/completed_sale.html.erb
Normal file
207
app/views/origami/pending_order/completed_sale.html.erb
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<!-- Column One -->
|
||||||
|
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||||
|
<ul class="nav nav-tabs tab-col-teal" role="tablist">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" data-toggle="tab" href="#completed" role="tab"><%= t :competed %></a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link " data-toggle="tab" href="#pending_order" role="tab">Pending</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div id="custom-slimscroll">
|
||||||
|
<div class="tab-content m-t-15">
|
||||||
|
<div class="tab-pane active" id="completed" role="tabpanel">
|
||||||
|
<div class="card-columns">
|
||||||
|
<% @completed.each do |sale| %>
|
||||||
|
<div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>">
|
||||||
|
<div class="card-block">
|
||||||
|
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;">Billed</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane " id="pending_order" role="tabpanel">
|
||||||
|
<div class="card-columns">
|
||||||
|
<% @sales.each do |sale| %>
|
||||||
|
<div class="card sales bg-red text-white" data-id = "<%= sale.sale_id %>">
|
||||||
|
<div class="card-block">
|
||||||
|
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;">Billed</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% @orders.each do |order| %>
|
||||||
|
<div class="card sales blue text-white" data-id = "<%= order.booking_id %>">
|
||||||
|
<div class="card-block">
|
||||||
|
<%= order.booking_id %><span style="font-size:12px;float:right;line-height:inherit;">new</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Column One -->
|
||||||
|
|
||||||
|
<!-- Column Two -->
|
||||||
|
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||||
|
<div class="card" >
|
||||||
|
<div class="card-header">
|
||||||
|
<div><strong id="order-title">INVOICE DETAILS </strong>| Table <%= @dining.name rescue "" %></div>
|
||||||
|
</div>
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="card-title row p-l-5 p-r-5">
|
||||||
|
|
||||||
|
<% if @status == 'sale' %>
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
Receipt No: <span id="receipt_no">
|
||||||
|
<%= @sale.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">
|
||||||
|
<%= @bookings.booking_orders[0].order_id rescue '' %></span>
|
||||||
|
</div>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
|
|
||||||
|
<% if @status == 'sale' %>
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||||
|
Date: <span id="receipt_date"><%= @sale.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"><%= @order.created_at.strftime("%I:%M %p") rescue '-'%> </span>
|
||||||
|
</div>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
<div class="card-title row customer_detail p-l-5 p-r-5">
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
<% if @status == 'sale' %>
|
||||||
|
Customer : <%= @sale.customer.name rescue "-" %>
|
||||||
|
<% else%>
|
||||||
|
Customer : <%= @order.customer.name rescue "-" %>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="order-detail-slimscroll" data-height="160">
|
||||||
|
<div class="card-text" style="">
|
||||||
|
<table class="table table-striped" 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
|
||||||
|
@sale.sale_items.each do |sale_item|
|
||||||
|
sub_total = sub_total + sale_item.price %>
|
||||||
|
<input type="hidden" id="sale_id" value="<%= @sale.sale_id %>">
|
||||||
|
<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
|
||||||
|
@order_items.each do |order_item|
|
||||||
|
total = order_item.qty * order_item.price
|
||||||
|
sub_total = sub_total + total %>
|
||||||
|
<input type="hidden" id="sale_id" value="<%= @bookings.booking_id %>">
|
||||||
|
<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 @sale.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>
|
||||||
|
</div>
|
||||||
|
<!-- Column Three -->
|
||||||
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
|
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
|
||||||
|
<button type="button" id="reprint" class="btn bg-blue btn-block">Reprint</button>
|
||||||
|
<% if current_user.role != "waiter" %>
|
||||||
|
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
var cashier_type = "quick_service";
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".sales").on('click',function(){
|
||||||
|
var sale_id = $(this).attr("data-id");
|
||||||
|
window.location.href = '/origami/quick_service/pending_order/' + sale_id;
|
||||||
|
})
|
||||||
|
$(".completed").on('click',function(){
|
||||||
|
var sale_id = $(this).attr("data-id");
|
||||||
|
window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
|
||||||
|
})
|
||||||
|
$('#reprint').on('click', function () {
|
||||||
|
var sale_id = $('#sale_id').val();
|
||||||
|
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||||
|
|
||||||
|
});
|
||||||
|
$('#back').on('click', function () {
|
||||||
|
window.location.href = '/origami/quick_service/pending_order';
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#close_cashier').on('click',function(e){
|
||||||
|
e.preventDefault(); // Prevent the href from redirecting directly
|
||||||
|
var linkURL = '/origami/shift/quick_service/close';
|
||||||
|
warnBeforeRedirect(linkURL);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -2,12 +2,31 @@
|
|||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<!-- Column One -->
|
<!-- Column One -->
|
||||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||||
<div class="card">
|
<!-- Nav tabs -->
|
||||||
<div class="card-header">
|
<ul class="nav nav-tabs tab-col-teal" role="tablist">
|
||||||
<strong id="order-title"> PENDING ORDER </strong>
|
<li class="nav-item">
|
||||||
</div>
|
<a class="nav-link" data-toggle="tab" href="#completed" role="tab"><%= t :competed %></a>
|
||||||
<div class="card-block">
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" data-toggle="tab" href="#pending_order" role="tab">Pending</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- Nav tabs - End -->
|
||||||
<div id="custom-slimscroll">
|
<div id="custom-slimscroll">
|
||||||
|
<div class="tab-content m-t-15">
|
||||||
|
<div class="tab-pane" id="completed" role="tabpanel">
|
||||||
|
<div class="card-columns">
|
||||||
|
<% @completed.each do |sale| %>
|
||||||
|
<div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>">
|
||||||
|
<div class="card-block">
|
||||||
|
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;">Billed</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane active" id="pending_order" role="tabpanel">
|
||||||
<div class="card-columns">
|
<div class="card-columns">
|
||||||
<% @sale.each do |sale| %>
|
<% @sale.each do |sale| %>
|
||||||
<div class="card sales bg-red text-white" data-id = "<%= sale.sale_id %>">
|
<div class="card sales bg-red text-white" data-id = "<%= sale.sale_id %>">
|
||||||
@@ -46,6 +65,10 @@
|
|||||||
var sale_id = $(this).attr("data-id");
|
var sale_id = $(this).attr("data-id");
|
||||||
window.location.href = '/origami/quick_service/pending_order/' + sale_id;
|
window.location.href = '/origami/quick_service/pending_order/' + sale_id;
|
||||||
})
|
})
|
||||||
|
$(".completed").on('click',function(){
|
||||||
|
var sale_id = $(this).attr("data-id");
|
||||||
|
window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
|
||||||
|
})
|
||||||
$('#pay').on('click', function () {
|
$('#pay').on('click', function () {
|
||||||
var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
window.location.href = '/origami/sale/' + sale_id + "/quick_service/payment";
|
window.location.href = '/origami/sale/' + sale_id + "/quick_service/payment";
|
||||||
|
|||||||
@@ -2,12 +2,29 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- Column One -->
|
<!-- Column One -->
|
||||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||||
<div class="card">
|
<ul class="nav nav-tabs tab-col-teal" role="tablist">
|
||||||
<div class="card-header">
|
<li class="nav-item">
|
||||||
<strong id="order-title"> PENDING ORDER </strong>
|
<a class="nav-link" data-toggle="tab" href="#completed" role="tab"><%= t :competed %></a>
|
||||||
</div>
|
</li>
|
||||||
<div class="card-block">
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" data-toggle="tab" href="#pending_order" role="tab">Pending</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<div id="custom-slimscroll">
|
<div id="custom-slimscroll">
|
||||||
|
<div class="tab-content m-t-15">
|
||||||
|
<div class="tab-pane" id="completed" role="tabpanel">
|
||||||
|
<div class="card-columns">
|
||||||
|
<% @completed.each do |sale| %>
|
||||||
|
<div class="card completed bg-red text-white" data-id = "<%= sale.sale_id %>">
|
||||||
|
<div class="card-block">
|
||||||
|
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;">Billed</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane active" id="pending_order" role="tabpanel">
|
||||||
<div class="card-columns">
|
<div class="card-columns">
|
||||||
<% @sales.each do |sale| %>
|
<% @sales.each do |sale| %>
|
||||||
<div class="card sales bg-red text-white" data-id = "<%= sale.sale_id %>">
|
<div class="card sales bg-red text-white" data-id = "<%= sale.sale_id %>">
|
||||||
@@ -182,6 +199,10 @@ $(document).ready(function(){
|
|||||||
var sale_id = $(this).attr("data-id");
|
var sale_id = $(this).attr("data-id");
|
||||||
window.location.href = '/origami/quick_service/pending_order/' + sale_id;
|
window.location.href = '/origami/quick_service/pending_order/' + sale_id;
|
||||||
})
|
})
|
||||||
|
$(".completed").on('click',function(){
|
||||||
|
var sale_id = $(this).attr("data-id");
|
||||||
|
window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
|
||||||
|
})
|
||||||
$('#pay').on('click', function () {
|
$('#pay').on('click', function () {
|
||||||
var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
window.location.href = '/origami/sale/' + sale_id + "/quick_service/payment";
|
window.location.href = '/origami/sale/' + sale_id + "/quick_service/payment";
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
|
|
||||||
get "quick_service/pending_order" => "pending_order#index"
|
get "quick_service/pending_order" => "pending_order#index"
|
||||||
get "quick_service/pending_order/:sale_id" => "pending_order#show"
|
get "quick_service/pending_order/:sale_id" => "pending_order#show"
|
||||||
|
get "quick_service/completed_sale/:sale_id" => "pending_order#completed_sale"
|
||||||
|
|
||||||
get "quick_service/modify_order/:id/:sale_id" => "quick_service#modify_order"
|
get "quick_service/modify_order/:id/:sale_id" => "quick_service#modify_order"
|
||||||
get "quick_service/modify_order/:sale_id" => "quick_service#modify_order"
|
get "quick_service/modify_order/:sale_id" => "quick_service#modify_order"
|
||||||
|
|||||||
Reference in New Issue
Block a user