Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Aung Myo
2018-09-07 09:41:48 +06:30
21 changed files with 686 additions and 512 deletions

View File

@@ -76,6 +76,11 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
if (typeof customTableClick !== 'undefined' && $.isFunction(customTableClick)) { if (typeof customTableClick !== 'undefined' && $.isFunction(customTableClick)) {
customTableClick(); customTableClick();
} }
if(parseInt(getOnlineOrderCount()) > 0){
$('.order_no').addClass("order-badge");
$('.order_no').html(parseInt(getOnlineOrderCount()));
}
} }
} }
}); });

View File

@@ -64,7 +64,17 @@ $(document).ready(function() {
$('#modal-set-slimscroll').slimScroll({ $('#modal-set-slimscroll').slimScroll({
height: height-$('#modal-set-slimscroll').attr('data-height'), height: height-$('#modal-set-slimscroll').attr('data-height'),
size: '5px', size: '10px',
color: 'rgba(0,0,0,0.5)',
alwaysVisible: false,
borderRadius: '0',
railBorderRadius: '0',
touchScrollStep : 45
});
$('#set-menu-item-slimscroll').slimScroll({
height: height-$('#set-menu-item-slimscroll').attr('data-height'),
size: '10px',
color: 'rgba(0,0,0,0.5)', color: 'rgba(0,0,0,0.5)',
alwaysVisible: false, alwaysVisible: false,
borderRadius: '0', borderRadius: '0',
@@ -177,3 +187,24 @@ function audioPlayBackground(shop_code,audio){
// },10000); // },10000);
} }
/* end order reservation function */ /* end order reservation function */
/* online order count*/
function getOnlineOrderCount(){
var count = 0;
//Start Ajax
$.ajax({
async: false,
type: "GET",
url: "/origami/get_order_info",
dataType: "json",
success: function(data){
if(parseInt(data) > 0){
count = parseInt(data);
}
}
});
//end Ajax
// alert(count);
return count;
}
/* online order count*/

View File

@@ -20,6 +20,7 @@ $(function() {
$('#cancel').hide(); $('#cancel').hide();
$(".tbl_customer").hide(); $(".tbl_customer").hide();
$(".order_close_cashier").hide(); $(".order_close_cashier").hide();
$(".order_btns").show();
refreshDetailData(); refreshDetailData();
if (type == "pending") { if (type == "pending") {
$(".first-1").click(); $(".first-1").click();
@@ -41,6 +42,7 @@ $(function() {
}else if(type == "processed"){ }else if(type == "processed"){
$(".fifth-1").click(); $(".fifth-1").click();
$(".order_close_cashier").show(); $(".order_close_cashier").show();
$(".order_btns").hide();
// $('#accepted').hide(); // $('#accepted').hide();
// $('#cancel').hide(); // $('#cancel').hide();
} }
@@ -501,6 +503,10 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
// } // }
// } // }
// }); // });
if(parseInt(getOnlineOrderCount()) > 0){
$('.order_no').addClass("order-badge");
$('.order_no').html(parseInt(getOnlineOrderCount()));
}
} }
function showNewOrderAlert(order_reservation,shop_code){ function showNewOrderAlert(order_reservation,shop_code){
@@ -602,3 +608,24 @@ function timeFormat(date){
return time; return time;
} }
/* end order reservation function */ /* end order reservation function */
/* online order count*/
function getOnlineOrderCount(){
var count = 0;
//Start Ajax
$.ajax({
async: false,
type: "GET",
url: "/origami/get_order_info",
dataType: "json",
success: function(data){
if(parseInt(data) > 0){
count = parseInt(data);
}
}
});
//end Ajax
// alert(count);
return count;
}
/* online order count*/

View File

@@ -54,6 +54,7 @@
.custom-card-footer .table td:first-child, .custom-card-footer .table td:first-child,
.custom-card-footer .table td:nth-child(2){ .custom-card-footer .table td:nth-child(2){
border-top:0px solid !important; border-top:0px solid !important;
height: 20px;
} }
.custom-card-footer .footer-td , .custom-card-footer .footer-td ,
@@ -62,13 +63,16 @@
border-bottom:0px solid !important; border-bottom:0px solid !important;
font-weight: bold; font-weight: bold;
padding:6px 10px; padding:6px 10px;
height: 64px;
} }
.custom-card-header{ .custom-card-header{
border-bottom: 1px solid #F8BBD0 !important; border-bottom: 1px solid #F8BBD0 !important;
padding:13px 5px !important; padding:13px 5px !important;
height: 50px;
} }
.custom-card-footer{ .custom-card-footer{
border-top: 1px solid #F8BBD0 !important; border-top: 1px solid #F8BBD0 !important;
border-bottom: 1px solid #FAFAFA !important;
} }
.custom-card-block, .custom-card-block,
.grand-card-footer, .grand-card-footer,
@@ -87,8 +91,12 @@
background-color : #FFCDD2; background-color : #FFCDD2;
} }
.div_order_margin { .div_order_margin {
margin: 0px 0px 0px -5px !important margin: -4px 0px 0px -5px !important
} }
.div_card_order { .div_card_order {
margin: 0px -5px !important margin: 0px -5px !important
} }
td.grand-total-padding {
font-size: 17px;
padding-top: 20px !important;
}

View File

@@ -283,4 +283,41 @@ section.content {
padding: 0.5rem 0.44rem; padding: 0.5rem 0.44rem;
} }
/* End Reset Theme */ /* End Reset Theme */
/* shop name margin */
.shop-name-margin {
margin-left : 20%;
}
/* shop name margin */
/* online order margin */
.online-order-margin {
margin-left : 22%;
margin-bottom : 9.9999px;
}
/* online order margin */
/* default-header-color */
div.online-order-margin > div > span {
color : #FAFAFA;
}
/* default-header-color */
/* order-no color */
.order-badge {
position: absolute;
background: #ff6600;
height: 1.8rem;
bottom: -0.1rem;
right: -1.3rem;
width: 1.8rem;
text-align: center;
line-height: 1.7rem;
font-size: 0.9rem;
border-radius: 50%;
color: white;
border: 1px solid #ff6600;
font-family: sans-serif;
font-weight: bold;
}
/* order-no color */
/* *************************************************** */ /* *************************************************** */

View File

@@ -99,11 +99,11 @@ class Crm::DiningQueuesController < BaseCrmController
table_id = params[:table_id] table_id = params[:table_id]
dining_facility = DiningFacility.find(params[:table_id]) dining_facility = DiningFacility.find(params[:table_id])
if dining_facility.type == "Table" # if dining_facility.type == "Table"
type = "TableBooking" type = "TableBooking"
else # else
type = "RoomBooking" # type = "RoomBooking"
end # end
booking = Booking.create({:dining_facility_id => params[:table_id],:type => type, booking = Booking.create({:dining_facility_id => params[:table_id],:type => type,
:checkin_at => Time.now.utc,:customer_id => queue.customer_id,:booking_status => "assign" }) :checkin_at => Time.now.utc,:customer_id => queue.customer_id,:booking_status => "assign" })

View File

@@ -96,4 +96,9 @@ class Origami::OrderReservationController < BaseOrigamiController
render :json => response render :json => response
end end
def get_order_info
order_reservation = OrderReservation.where("status = 'new' OR status='accepted' OR status='send_to_kitchen' OR status = 'ready_to_delivery'").count()
render :json => order_reservation
end
end end

View File

@@ -91,7 +91,7 @@ class Origami::PaymentsController < BaseOrigamiController
printer = Printer::ReceiptPrinter.new(print_settings) printer = Printer::ReceiptPrinter.new(print_settings)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount) filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount,nil)
result = { result = {
:filepath => filename, :filepath => filename,
@@ -111,6 +111,7 @@ class Origami::PaymentsController < BaseOrigamiController
type = params[:type] type = params[:type]
tax_type = params[:tax_type] tax_type = params[:tax_type]
path = request.fullpath path = request.fullpath
latest_order_no = nil
if(Sale.exists?(sale_id)) if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id) saleObj = Sale.find(sale_id)
@@ -204,6 +205,11 @@ class Origami::PaymentsController < BaseOrigamiController
table_id = 0 table_id = 0
end end
latest_order = booking.booking_orders.order("order_id DESC").limit(1).first()
if !latest_order.nil?
latest_order_no = latest_order.order_id
end
booking.booking_orders.each do |order| booking.booking_orders.each do |order|
# Order.pay_process_order_queue(order.order_id, table_id) # Order.pay_process_order_queue(order.order_id, table_id)
oqs = OrderQueueStation.new oqs = OrderQueueStation.new
@@ -237,7 +243,7 @@ class Origami::PaymentsController < BaseOrigamiController
other_amount = SaleItem.calculate_other_charges(sale_items) other_amount = SaleItem.calculate_other_charges(sale_items)
printer = Printer::ReceiptPrinter.new(print_settings) printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Paid",current_balance,card_data,other_amount) filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Paid",current_balance,card_data,other_amount,latest_order_no)
render json: JSON.generate({:status => saleObj.rebate_status, :message => "Can't Rebate coz of Sever Error ", :filename => filename, :receipt_no => sale_receipt_no, :printer_name => printer_name}) render json: JSON.generate({:status => saleObj.rebate_status, :message => "Can't Rebate coz of Sever Error ", :filename => filename, :receipt_no => sale_receipt_no, :printer_name => printer_name})
@@ -442,11 +448,17 @@ class Origami::PaymentsController < BaseOrigamiController
def reprint def reprint
sale_id = params[:sale_id] sale_id = params[:sale_id]
member_info = nil member_info = nil
latest_order_no = nil
saleObj = Sale.find(sale_id) saleObj = Sale.find(sale_id)
# For Cashier by Zone # For Cashier by Zone
bookings = Booking.where("sale_id='#{sale_id}'") bookings = Booking.where("sale_id='#{sale_id}'")
booking = Booking.find_by_sale_id(sale_id)
latest_order = booking.booking_orders.joins(" JOIN orders ON orders.order_id = booking_orders.order_id").where("orders.source = 'quick_service'").order("order_id DESC").limit(1).first()
if !latest_order.nil?
latest_order_no = latest_order.order_id
end
# if bookings.count > 1 # if bookings.count > 1
# # for Multiple Booking # # for Multiple Booking
# table = DiningFacility.find(bookings[0].dining_facility_id) # table = DiningFacility.find(bookings[0].dining_facility_id)
@@ -514,7 +526,7 @@ class Origami::PaymentsController < BaseOrigamiController
other_amount = SaleItem.calculate_other_charges(saleObj.sale_items) other_amount = SaleItem.calculate_other_charges(saleObj.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings) printer = Printer::ReceiptPrinter.new(print_settings)
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Re-print",current_balance,card_data,other_amount) filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "Re-print",current_balance,card_data,other_amount,latest_order_no)
result = { result = {
:status => true, :status => true,
@@ -600,7 +612,7 @@ class Origami::PaymentsController < BaseOrigamiController
printer = Printer::ReceiptPrinter.new(print_settings) printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "FOC",nil,nil,other_amount) filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_detail, "FOC",nil,nil,other_amount,nil)
result = { result = {
:status => true, :status => true,
:filepath => filename, :filepath => filename,

View File

@@ -126,7 +126,7 @@ class Origami::VoidController < BaseOrigamiController
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items) discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
other_amount = SaleItem.calculate_other_charges(sale.sale_items) other_amount = SaleItem.calculate_other_charges(sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings) printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil,other_amount) filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil,other_amount,nil)
result = { result = {
:filepath => filename, :filepath => filename,
:printer_model => print_settings.brand_name, :printer_model => print_settings.brand_name,

View File

@@ -107,7 +107,7 @@ class Origami::WasteSpoileController < BaseOrigamiController
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items) discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
other_amount = SaleItem.calculate_other_charges(sale.sale_items) other_amount = SaleItem.calculate_other_charges(sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings) printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, remark,current_balance,nil,other_amount) filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, remark,current_balance,nil,other_amount,nil)
result = { result = {
:filepath => filename, :filepath => filename,
:printer_model => print_settings.brand_name, :printer_model => print_settings.brand_name,

View File

@@ -363,7 +363,7 @@ class Transactions::SalesController < ApplicationController
other_amount = SaleItem.calculate_other_charges(sale.sale_items) #other charges other_amount = SaleItem.calculate_other_charges(sale.sale_items) #other charges
printer = Printer::ReceiptPrinter.new(print_settings) printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil,other_amount) filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil,other_amount,nil)
result = { result = {
:filepath => filename, :filepath => filename,
:printer_model => print_settings.brand_name, :printer_model => print_settings.brand_name,

View File

@@ -188,19 +188,19 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
end end
#Bill Receipt Print #Bill Receipt Print
def print_receipt_bill(printer_settings,cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status,balance,card_data,other_amount) def print_receipt_bill(printer_settings,cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status,balance,card_data,other_amount,latest_order_no)
#Use CUPS service #Use CUPS service
#Generate PDF #Generate PDF
#Print #Print
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount) pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no)
receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
if !receipt_bill_a5_pdf.empty? if !receipt_bill_a5_pdf.empty?
receipt_bill_a5_pdf.each do |receipt_bilA5| receipt_bill_a5_pdf.each do |receipt_bilA5|
if receipt_bilA5[0] == 'ReceiptBillA5Pdf' if receipt_bilA5[0] == 'ReceiptBillA5Pdf'
if receipt_bilA5[1] == '1' if receipt_bilA5[1] == '1'
pdf = ReceiptBillA5Pdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount) pdf = ReceiptBillA5Pdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no)
else else
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount) pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no)
end end
end end
end end

View File

@@ -2,7 +2,7 @@ class ReceiptBillA5Pdf < Prawn::Document
include ActionView::Helpers::NumberHelper include ActionView::Helpers::NumberHelper
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount) def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount,latest_order_no)
self.page_width = printer_settings.page_width self.page_width = printer_settings.page_width
self.page_height = printer_settings.page_height self.page_height = printer_settings.page_height
self.header_font_size = printer_settings.header_font_size.to_i self.header_font_size = printer_settings.header_font_size.to_i
@@ -56,7 +56,7 @@ class ReceiptBillA5Pdf < Prawn::Document
stroke_horizontal_rule stroke_horizontal_rule
cashier_info(sale_data, customer_name) cashier_info(sale_data, customer_name, latest_order_no)
line_items(sale_items,printer_settings.precision,delimiter) line_items(sale_items,printer_settings.precision,delimiter)
all_total(sale_data,printer_settings.precision,delimiter) all_total(sale_data,printer_settings.precision,delimiter)
@@ -112,7 +112,7 @@ class ReceiptBillA5Pdf < Prawn::Document
stroke_horizontal_rule stroke_horizontal_rule
end end
def cashier_info(sale_data, customer_name) def cashier_info(sale_data, customer_name, latest_order_no)
move_down line_move move_down line_move
# move_down 2 # move_down 2
y_position = cursor y_position = cursor
@@ -160,6 +160,14 @@ class ReceiptBillA5Pdf < Prawn::Document
# :size => self.item_font_size,:align => :right # :size => self.item_font_size,:align => :right
# end # end
if !latest_order_no.nil?
y_position = cursor
move_down line_move
bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do
text "OrderNo : #{ latest_order_no }",:size => self.item_font_size,:align => :left
end
end
move_down line_move move_down line_move
stroke_horizontal_rule stroke_horizontal_rule
end end
@@ -659,7 +667,7 @@ class ReceiptBillA5Pdf < Prawn::Document
move_down line_move move_down line_move
y_position = cursor y_position = cursor
text "#{shop.note}", :size => self.item_font_size,:align => :center text "#{shop.note}", :size => self.item_font_size,:align => :left
move_down line_move move_down line_move
end end

View File

@@ -3,7 +3,7 @@ class ReceiptBillPdf < Prawn::Document
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount) def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount,latest_order_no)
self.page_width = printer_settings.page_width self.page_width = printer_settings.page_width
self.page_height = printer_settings.page_height self.page_height = printer_settings.page_height
self.header_font_size = printer_settings.header_font_size.to_i self.header_font_size = printer_settings.header_font_size.to_i
@@ -57,7 +57,7 @@ class ReceiptBillPdf < Prawn::Document
stroke_horizontal_rule stroke_horizontal_rule
cashier_info(sale_data, customer_name) cashier_info(sale_data, customer_name, latest_order_no)
line_items(sale_items,printer_settings.precision,delimiter) line_items(sale_items,printer_settings.precision,delimiter)
all_total(sale_data,printer_settings.precision,delimiter) all_total(sale_data,printer_settings.precision,delimiter)
@@ -112,7 +112,7 @@ class ReceiptBillPdf < Prawn::Document
stroke_horizontal_rule stroke_horizontal_rule
end end
def cashier_info(sale_data, customer_name) def cashier_info(sale_data, customer_name, latest_order_no)
move_down line_move move_down line_move
# move_down 2 # move_down 2
@@ -153,7 +153,13 @@ class ReceiptBillPdf < Prawn::Document
# - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" , # - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" ,
# :size => self.item_font_size,:align => :right # :size => self.item_font_size,:align => :right
# end # end
if !latest_order_no.nil?
y_position = cursor
move_down line_move
bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do
text "OrderNo : #{ latest_order_no }",:size => self.item_font_size,:align => :left
end
end
move_down line_move move_down line_move
stroke_horizontal_rule stroke_horizontal_rule
end end
@@ -659,7 +665,7 @@ class ReceiptBillPdf < Prawn::Document
move_down line_move move_down line_move
y_position = cursor y_position = cursor
text "#{shop.note}", :size => self.item_font_size,:align => :center text "#{shop.note}", :size => self.item_font_size, :align => :left
move_down line_move move_down line_move
end end

View File

@@ -36,12 +36,22 @@
</span> </span>
</div> </div>
<!-- Start Shop Info --> <!-- Start Shop Info -->
<div class="navbar-right"> <div class="navbar-right shop-name-margin">
<div class="col-lg-12 col-md-12 col-sm-12 navbar-brand"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 navbar-brand">
<span class="navbar-brand-txt"><%= shop_detail.name %></span> <span class="navbar-brand-txt"><%= shop_detail.name %></span>
</div> </div>
</div> </div>
<!-- End Shop Info --> <!-- End Shop Info -->
<div class="navbar-right online-order-margin">
<% if order_reservation %>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 online_order">
<span class="navbar-brand-txt header-default-color"><%= t :order_reservation %></span>
<span class="order_no"></span>
</div>
<% end %>
</div>
<!-- Start Delete confirrm text !--> <!-- Start Delete confirrm text !-->
<div class="navbar-right"> <div class="navbar-right">
<a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
@@ -111,5 +121,15 @@
} }
}); });
}); });
$('.online_order').on('click',function(){
window.location.href = '/origami/order_reservation';
});
if(parseInt(getOnlineOrderCount()) > 0){
$('.order_no').addClass("order-badge");
$('.order_no').html(parseInt(getOnlineOrderCount()));
}
}); });
</script> </script>

View File

@@ -413,22 +413,14 @@
<!-- Large modal --> <!-- Large modal -->
<div class=" modal sx_item_set_detailModal" id="sx_item_set_detailModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" > <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-dialog custom-modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="background-color: #54A5AF;padding-top:10px !important;"> <div class="modal-header" style="background-color: #54A5AF;padding-top:10px !important;">
<h4 class="modal-title" style="color:#fff;" id="set_name"></h4> <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;">&times;</button> --> <button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">&times;</button>
<div class="row">
<div class="col-md-4">
<button type="button" class="btn btn-default" data-dismiss="modal" id="close">Close</button>
</div> </div>
<div class="col-md-6"> <div class="modal-body" id="set-menu-item-slimscroll" data-height="50">
<button type="button" class="btn btn-primary set_order" data-dismiss="modal" id="set_order">Add to Order</button>
</div>
</div>
</div>
<div class="modal-body">
<div class="row set-item"> <div class="row set-item">
<div class="col-md-4"> <div class="col-md-4">
<p class="set_default_option" style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p> <p class="set_default_option" style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p>
@@ -459,7 +451,7 @@
<p class="hidden" id="set_item_code"></p> <p class="hidden" id="set_item_code"></p>
<p></p> <p></p>
<div class="" id="modal-slimscroll" data-height="100"> <div class="" id="modal-set-slimscroll" data-height="100">
<div class="options-list" style="margin-top:-5px"> <div class="options-list" style="margin-top:-5px">
</div> </div>
@@ -469,6 +461,7 @@
</div> </div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<div class="instance-list row"></div> <div class="instance-list row"></div>
</div> </div>
@@ -478,11 +471,18 @@
<div class="mr-auto"> <div class="mr-auto">
<h4 class=" pull-left">Total : <span id="set_total_price"></span></h4> <h4 class=" pull-left">Total : <span id="set_total_price"></span></h4>
</div> </div>
<div class="row">
<div class="col-md-4">
<button type="button" class="btn btn-default" data-dismiss="modal" id="close">Close</button>
</div>
<div class="col-md-6">
<button type="button" class="btn btn-primary set_order" data-dismiss="modal" id="set_order">Add to Order</button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<% if type && !modify_order%> <% if type && !modify_order%>
<div class="modal fade" id="TableModal" tabindex="-1" role="dialog"> <div class="modal fade" id="TableModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">

View File

@@ -22,7 +22,7 @@
<!-- Widgets --> <!-- Widgets -->
<div class="row clearfix"> <div class="row clearfix">
<% if @quick_service == '1' %> <% if @quick_service == '1' %>
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 qs_view"> <div class="col-lg-3 col-md-3 col-sm-4 col-xs-10 qs_view">
<div class="info-box bg-purple"> <div class="info-box bg-purple">
<div class="icon" > <div class="icon" >
<i class="material-icons">arrow_forward</i> <i class="material-icons">arrow_forward</i>
@@ -32,7 +32,7 @@
</div> </div>
<% end %> <% end %>
<% if @dinein_cashier == '1' %> <% if @dinein_cashier == '1' %>
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 cashier_view"> <div class="col-lg-3 col-md-3 col-sm-4 col-xs-10 cashier_view">
<div class="info-box bg-green"> <div class="info-box bg-green">
<div class="icon" > <div class="icon" >
<i class="material-icons">arrow_forward</i> <i class="material-icons">arrow_forward</i>
@@ -42,7 +42,7 @@
</div> </div>
<% end %> <% end %>
<% if @order_reservation == '1' %> <% if @order_reservation == '1' %>
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 order_reservation"> <div class="col-lg-3 col-md-3 col-sm-4 col-xs-10 order_reservation">
<div class="info-box bg-blue"> <div class="info-box bg-blue">
<div class="icon" > <div class="icon" >
<i class="material-icons">arrow_forward</i> <i class="material-icons">arrow_forward</i>

View File

@@ -325,7 +325,7 @@
<div class="col-lg-4 col-md-4 col-sm-4 div_card_order"> <div class="col-lg-4 col-md-4 col-sm-4 div_card_order">
<div class="card m-b-5 p-t-5"> <div class="card m-b-5 p-t-5">
<div class="card-header custom-card-header" style="color:"> <div class="card-header custom-card-header">
<table class="table"> <table class="table">
<tr> <tr>
<td width ="10%" class="header-td align-left"> <td width ="10%" class="header-td align-left">
@@ -343,7 +343,7 @@
</table> </table>
</div> </div>
<div class="card-block custom-card-block"> <div class="card-block custom-card-block">
<div id="order-detail-slimscroll" data-height="220"> <div id="order-detail-slimscroll" data-height="110">
<table class="table summary-items"> <table class="table summary-items">
<tbody> <tbody>
<!-- <tr> <!-- <tr>
@@ -393,39 +393,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="card-footer grand-card-footer">
<table class="table">
<tbody>
<tr>
<td width ="70%" class="footer-td align-left col-blue">
GRAND TOTAL
</td>
<td width ="30%" class="footer-td align-right col-blue" id="grand_total">0.00</td>
</tr>
<tr>
<td width ="50%" class="footer-td align-left col-blue">
<button type="button" class="btn btn-lg bg-red waves-effect" id="cancel" data-value="rejected">
<strong>REJECT</strong>
</button>
</td>
<td width ="50%" class="footer-td align-right col-blue">
<button type="button" class="btn btn-lg bg-blue waves-effect " id="accepted" data-value="accepted">
ACCEPT
</button>
<!-- <button type="button" class="btn btn-lg bg-blue waves-effect hidden" id="accepted" data-value="delivery">
<strong>SEND TO KITCHEN</strong>
</button>
<button type="button" class="btn btn-lg bg-blue waves-effect hidden" id="accepted" data-value="completed">
<strong>READY TO DELIVERY</strong>
</button>
<button type="button" class="btn btn-lg bg-blue waves-effect hidden" id="accepted" data-value="pick-up">
<strong>PICK UP</strong>
</button> -->
</td>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
@@ -454,7 +421,7 @@
</tr> </tr>
<tr> <tr>
<td class="body-td align-left"> <td class="body-td align-left">
<span class="font-13">REQUESTED TIME</span><br> <span class="font-13">DELIVERY REQUESTED TIME</span><br>
<b id="requested_time"></b> <b id="requested_time"></b>
</td> </td>
<td class="body-td align-right expected_time"> <td class="body-td align-right expected_time">
@@ -463,26 +430,22 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="body-td align-left"> <td class="body-td align-left">
<span class="font-13">NAME</span><br> <span class="font-13">NAME</span><br>
<b id="customer_name"></b> <b id="customer_name"></b>
</td> </td>
</tr> <td class="body-td align-left">
<tr>
<td colspan="2" class="body-td align-left">
<span class="font-13">PHONE</span><br> <span class="font-13">PHONE</span><br>
<b id="phone"></b> <b id="phone"></b>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="body-td align-left"> <td class="body-td align-left">
<span class="font-13">ADDRESS</span><br> <span class="font-13">ADDRESS</span><br>
<b id="address"></b> <b id="address"></b>
</td> </td>
</tr> <td class="body-td align-left">
<tr> <span class="font-13">DELIVERY</span><br>
<td colspan="2" class="body-td align-left">
<span class="font-13">DELEVERY</span><br>
<b id="delivery_to"></b> <b id="delivery_to"></b>
</td> </td>
</tr> </tr>
@@ -499,16 +462,59 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<!-- <table class="table">
<tr>
<td colspan="2" class="body-td align-left">
<span class="font-13">ACCEPTED</span><br>
<b id="accepted_time">Sept 06, 2018(Weds) 10:00 AM</b>
</td>
</tr>
<tr>
<td colspan="2" class="body-td align-left">
<span class="font-13">SEND TO KITCHEN</span><br>
<b id="send_kitchen_time">Sept 06, 2018(Weds) 11:00 AM</b>
</td>
</tr>
<tr>
<td colspan="2" class="body-td align-left">
<span class="font-13">READY TO DELIVERY</span><br>
<b id="ready_delivery_time">Sept 06, 2018(Weds) 12:00 PM</b>
</td>
</tr>
</table> -->
</div> </div>
<div class="card-footer order_close_cashier">
<div class="card-footer grand-card-footer">
<table class="table">
<tbody>
<tr>
<td width ="70%" class="footer-td align-left col-blue grand-total-padding">
GRAND TOTAL
</td>
<td width ="30%" class="footer-td align-right col-blue grand-total-padding" id="grand_total">0.00</td>
</tr>
<tr class="order_btns">
<td width ="50%" class="footer-td align-left col-blue">
<button type="button" class="btn btn-md bg-red waves-effect" id="cancel" data-value="rejected">
<strong>REJECT</strong>
</button>
</td>
<td width ="50%" class="footer-td align-right col-blue">
<button type="button" class="btn btn-md bg-blue waves-effect " id="accepted" data-value="accepted">
ACCEPT
</button>
</td>
</tr>
<% if current_user.role != "waiter" %> <% if current_user.role != "waiter" %>
<div class="row"> <tr class="order_close_cashier" style="display:none">
<div class="col-sm-7 col-xs-7 col-md-7 col-lg-7"></div> <td colspan="2" width="100%" class="footer-td align-right col-blue">
<div class="col-sm-4 col-xs-4 col-md-4 col-lg-4"> <button id="order_close_cashier" class="btn btn-md bg-blue waves-effect"><%= t("views.btn.close_cashier") %></button>
<button id="order_close_cashier" class="align-right text-center btn btn-md btn-link btn-primary waves-effect"><%= t("views.btn.close_cashier") %></button> </td>
</div> </tr>
</div>
<% end %> <% end %>
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@@ -530,12 +536,12 @@
<h4 class="modal-title" id="waiting_timeModalLabel">Expected Waiting Time for <span id="requested_order_time"></span></h4> <h4 class="modal-title" id="waiting_timeModalLabel">Expected Waiting Time for <span id="requested_order_time"></span></h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row text-center m-t-20"> <!-- <div class="row text-center m-t-20">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3"></div> <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3"></div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<button type="button" class="btn btn-lg btn-link bg-info timer_type" data-value="after">After</button> <button type="button" class="btn btn-lg btn-link bg-info timer_type" data-value="after">After</button>
</div> </div>
</div> </div> -->
<div class="row text-center m-t-20"> <div class="row text-center m-t-20">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6"> <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
@@ -561,11 +567,19 @@
<button type="button" class="btn btn-lg btn-link bg-info time_interval" data-value="90">90 Mins.</button> <button type="button" class="btn btn-lg btn-link bg-info time_interval" data-value="90">90 Mins.</button>
</div> </div>
</div> </div>
<div class="row text-center m-t-20">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<button type="button" class="btn btn-lg btn-link bg-info time_interval" data-value="105">105 Mins.</button>
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<button type="button" class="btn btn-lg btn-link bg-info time_interval" data-value="120">120 Mins.</button>
</div>
</div>
</div> </div>
<div class="modal-footer "> <div class="modal-footer ">
<div class="row p-r-20"> <div class="row p-r-20">
<div class="col-md-5"> <div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-red waves-effect" data-dismiss="modal">CLOSE</button> <button type="button" style="margin-bottom: 10px;" class="btn btn-lg btn-link bg-red waves-effect" data-dismiss="modal">CLOSE</button>
</div> </div>
</div> </div>
</div> </div>
@@ -587,11 +601,11 @@
</div> </div>
<div class="modal-footer "> <div class="modal-footer ">
<div class="row p-r-20"> <div class="row p-r-20">
<div class="col-md-5"> <div class="col-md-5 mr-1">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect send_status">SEND</button> <button type="button" class="btn btn-lg btn-link p-t-5 p-b-5 bg-blue waves-effect send_status">SEND</button>
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-red waves-effect" data-dismiss="modal">CLOSE</button> <button type="button" class="btn btn-lg btn-link p-t-5 p-b-5 bg-red waves-effect" data-dismiss="modal">CLOSE</button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -76,7 +76,7 @@ en:
date_time: "DateTime" date_time: "DateTime"
dine_in_cashier: "Dine-in Cashier" dine_in_cashier: "Dine-in Cashier"
quick_service: "Quick Service" quick_service: "Quick Service"
order_reservation: "Order & Reservation" order_reservation: "Online Order"
pending: "Pending" pending: "Pending"
processing: "Processing" processing: "Processing"
delivering: "Delivering" delivering: "Delivering"
@@ -479,7 +479,7 @@ en:
adult: "Adult" adult: "Adult"
foreigner: "Foreigner" foreigner: "Foreigner"
local: "Local" local: "Local"
order_reservation_report: "Order Reservation" order_reservation_report: "Online Order"
requested_time: "Requested Time" requested_time: "Requested Time"
provider: "Provider" provider: "Provider"
delivery_fee: "Delivery Fee" delivery_fee: "Delivery Fee"
@@ -489,7 +489,7 @@ en:
convenience_tax: "Convenience Tax" convenience_tax: "Convenience Tax"
commercial_tax: "Commercial Tax" commercial_tax: "Commercial Tax"
select_providers: "Select Providers" select_providers: "Select Providers"
order_reservation: "Order Reservation" order_reservation: "Online Order"
cooking_time: "Cooking Time" cooking_time: "Cooking Time"
township: "Township" township: "Township"
induty_report: "Induty Report" induty_report: "Induty Report"

View File

@@ -71,7 +71,7 @@ mm:
date_time: "ရက်စွဲအချိန်" date_time: "ရက်စွဲအချိန်"
dine_in_cashier: "Dine-in Cashier" dine_in_cashier: "Dine-in Cashier"
quick_service: "Quick Service" quick_service: "Quick Service"
order_reservation: "Order & Reservation" order_reservation: "Online Order မွာယူျခင္း"
pending: "Pending" pending: "Pending"
processing: "Processing" processing: "Processing"
delivering: "Delivering" delivering: "Delivering"
@@ -473,7 +473,7 @@ mm:
adult: "လူကြီး" adult: "လူကြီး"
foreigner: "နိုင်ငံခြားသား" foreigner: "နိုင်ငံခြားသား"
local: "နိုင်ငံသား" local: "နိုင်ငံသား"
order_reservation_report: "ၾကိဳတင္ order မွာယူျခင္း" order_reservation_report: "online order မွာယူျခင္း"
requested_time: "Requested Time" requested_time: "Requested Time"
provider: "Provider" provider: "Provider"
delivery_fee: "Delivery Fee" delivery_fee: "Delivery Fee"
@@ -483,7 +483,7 @@ mm:
convenience_tax: "Convenience Tax" convenience_tax: "Convenience Tax"
commercial_tax: "Commercial Tax" commercial_tax: "Commercial Tax"
select_providers: "Select Providers" select_providers: "Select Providers"
order_reservation: "Order Reservation" order_reservation: "online order မွာယူျခင္း"
cooking_time: "Cooking Time" cooking_time: "Cooking Time"
township: "Township" township: "Township"
induty_report: "Induty Report" induty_report: "Induty Report"

View File

@@ -288,6 +288,7 @@ scope "(:locale)", locale: /en|mm/ do
get 'order_reservation/get_order/:id' => "order_reservation#get_order",:as => "get_order", :defaults => { :format => 'json' } get 'order_reservation/get_order/:id' => "order_reservation#get_order",:as => "get_order", :defaults => { :format => 'json' }
post 'order_reservation/update', to: "order_reservation#update" , :defaults => { :format => 'json' } post 'order_reservation/update', to: "order_reservation#update" , :defaults => { :format => 'json' }
post 'order_reservation/send_status', to: "order_reservation#send_status", :defaults => { :format => 'json' } post 'order_reservation/send_status', to: "order_reservation#send_status", :defaults => { :format => 'json' }
get 'get_order_info', to: "order_reservation#get_order_info", :as => "get_order_info", :defaults => { :format => 'json' }
#credit payment routes #credit payment routes
post '/:type/credit_sales' => "dashboard#get_credit_sales", :as => "get_credit_sales", :defaults => { :format => 'json' } post '/:type/credit_sales' => "dashboard#get_credit_sales", :as => "get_credit_sales", :defaults => { :format => 'json' }