Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -37,7 +37,7 @@ pickle-email-*.html
|
|||||||
.rbenv-version
|
.rbenv-version
|
||||||
config/deploy/config/*
|
config/deploy/config/*
|
||||||
config/puma.rb
|
config/puma.rb
|
||||||
config/shops.json
|
#config/shops.json
|
||||||
!/log/.keep
|
!/log/.keep
|
||||||
!/tmp/.keep
|
!/tmp/.keep
|
||||||
.ruby-version
|
.ruby-version
|
||||||
|
|||||||
@@ -217,31 +217,29 @@ $(document).on('turbolinks:load', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Print Order Item
|
// Print Order Item
|
||||||
$(document).on('click', '#print_order_item', function(event){
|
// $(document).on('click', '#print_order_item', function(event){
|
||||||
var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
// var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||||
var options = $('.selected-item').children('.card-block').find('.item-options').text();
|
// var options = $('.selected-item').children('.card-block').find('.item-options').text();
|
||||||
var params = { 'options':options };
|
// var params = { 'options':options };
|
||||||
|
|
||||||
$.ajax({
|
// $.ajax({
|
||||||
type: 'POST',
|
// type: 'GET',
|
||||||
url: '/oqs/print/print/'+assigned_item_id,
|
// url: '/oqs/print/print/'+assigned_item_id,
|
||||||
data: params,
|
// success: function(data){ }
|
||||||
success: function(data){ }
|
// });
|
||||||
});
|
// });
|
||||||
});
|
|
||||||
|
|
||||||
// Print Order Summary
|
// Print Order Summary
|
||||||
// $('#print_order_summary').on('click',function(){
|
// $(document).on('click', '#print_order_summary', function(event){
|
||||||
$(document).on('click', '#print_order_summary', function(event){
|
// var orderNo = $('.selected-item').attr('data-order-no');
|
||||||
var orderNo = $('.selected-item').attr('data-order-no');
|
// var table_name=$('.selected-item').children().children().children('.order-zone').text().trim();
|
||||||
var table_name=$('.selected-item').children().children().children('.order-zone').text().trim();
|
// var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||||
var assigned_item_id=$('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
// var params = { 'table_name':table_name };
|
||||||
var params = { 'table_name':table_name };
|
// $.ajax({
|
||||||
$.ajax({
|
// type: 'GET',
|
||||||
type: 'GET',
|
// url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
||||||
url: '/oqs/print/print_order_summary/'+assigned_item_id,
|
// data: params,
|
||||||
data: params,
|
// success: function(data){ }
|
||||||
success: function(data){ }
|
// });
|
||||||
});
|
// });
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -54,12 +54,18 @@ class Api::OrdersController < Api::ApiController
|
|||||||
extra_time = ''
|
extra_time = ''
|
||||||
|
|
||||||
params[:order_items].each { |i|
|
params[:order_items].each { |i|
|
||||||
if i["item_instance_code"] == 'Extim60' || i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extie60' || i["item_instance_code"] == 'Extie30'
|
if i["item_instance_code"] == 'Extim60' || i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extim45' || i["item_instance_code"] == 'Extim15' || i["item_instance_code"] == 'Extie60' || i["item_instance_code"] == 'Extie30' || i["item_instance_code"] == 'Extie45' || i["item_instance_code"] == 'Extie15'
|
||||||
is_extra_time = true
|
is_extra_time = true
|
||||||
if i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extie30'
|
if i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extie30'
|
||||||
t = Time.now
|
t = Time.now
|
||||||
time = 30*60*i["quantity"].to_i
|
time = 30*60*i["quantity"].to_i
|
||||||
extra_time = Time.at(time)
|
extra_time = Time.at(time)
|
||||||
|
elsif i["item_instance_code"] == 'Extim15' || i["item_instance_code"] == 'Extie15'
|
||||||
|
time = 15*60*i["quantity"].to_i
|
||||||
|
extra_time = Time.at(time)
|
||||||
|
elsif i["item_instance_code"] == 'Extim45' || i["item_instance_code"] == 'Extie45'
|
||||||
|
time = 45*60*i["quantity"].to_i
|
||||||
|
extra_time = Time.at(time)
|
||||||
else
|
else
|
||||||
t = Time.now
|
t = Time.now
|
||||||
time = 60*60*i["quantity"].to_i
|
time = 60*60*i["quantity"].to_i
|
||||||
|
|||||||
@@ -45,13 +45,13 @@ class Crm::DiningQueuesController < BaseCrmController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @dining_queue.save
|
if @dining_queue.save
|
||||||
|
|
||||||
unique_code = "QueueNoPdf"
|
# unique_code = "QueueNoPdf"
|
||||||
|
|
||||||
# get printer info
|
# # get printer info
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
# print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_queue_no(print_settings,@dining_queue)
|
# printer.print_queue_no(print_settings,@dining_queue)
|
||||||
|
|
||||||
format.html { redirect_to crm_dining_queues_path, notice: 'Queue was successfully created.' }
|
format.html { redirect_to crm_dining_queues_path, notice: 'Queue was successfully created.' }
|
||||||
format.json { render :show, status: :created, location: @dining_queue }
|
format.json { render :show, status: :created, location: @dining_queue }
|
||||||
|
|||||||
@@ -33,13 +33,13 @@ class Crm::HomeController < BaseCrmController
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
unique_code="CrmOrderPdf"
|
# unique_code="CrmOrderPdf"
|
||||||
|
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
# print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
|
||||||
printer.print_crm_order(@booking,order_items,print_settings)
|
# printer.print_crm_order(@booking,order_items,print_settings)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ class Oqs::EditController < BaseOqsController
|
|||||||
order_item.save
|
order_item.save
|
||||||
|
|
||||||
# print
|
# print
|
||||||
assigned_item = AssignedOrderItem.find_by_instance_code(order_item.item_instance_code)
|
# assigned_item = AssignedOrderItem.find_by_instance_code(order_item.item_instance_code)
|
||||||
# order queue stations
|
# # order queue stations
|
||||||
oqs = assigned_item.order_queue_station
|
# oqs = assigned_item.order_queue_station
|
||||||
|
|
||||||
unique_code="OrderItemPdf"
|
# unique_code="OrderItemPdf"
|
||||||
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
# order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings, oqs, order_item.order_id, order_items_id, print_status=" (Updated)" )
|
# order_queue_printer.print_order_item(print_settings, oqs, order_item.order_id, order_items_id, print_status=" (Updated)" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,61 +1,61 @@
|
|||||||
class Oqs::PrintController < ApplicationController
|
class Oqs::PrintController < ApplicationController
|
||||||
# Print Order Item
|
# Print Order Item
|
||||||
def print
|
def print
|
||||||
unique_code="OrderItemPdf"
|
# unique_code="OrderItemPdf"
|
||||||
assigned_item_id = params[:id]
|
# assigned_item_id = params[:id]
|
||||||
options = params[:options]
|
# options = params[:options]
|
||||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
# assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||||
assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
# assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||||
|
|
||||||
# order queue stations
|
# # order queue stations
|
||||||
oqs = assigned_item.order_queue_station
|
# oqs = assigned_item.order_queue_station
|
||||||
order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
# order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
||||||
|
|
||||||
# Check Printed
|
# # Check Printed
|
||||||
print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
# print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
||||||
|
|
||||||
# print when complete click
|
# # print when complete click
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
# print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
# order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings,oqs, assigned_item.order_id, order_item.order_items_id, print_status, options )
|
# order_queue_printer.print_order_item(print_settings,oqs, assigned_item.order_id, order_item.order_items_id, print_status, options )
|
||||||
|
|
||||||
# update print status for completed same order items
|
# # update print status for completed same order items
|
||||||
assigned_items.each do |ai|
|
# assigned_items.each do |ai|
|
||||||
ai.print_status=true
|
# ai.print_status=true
|
||||||
ai.save
|
# ai.save
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Print Order Details with booking id
|
# Print Order Details with booking id
|
||||||
def print_order_summary
|
def print_order_summary
|
||||||
unique_code="OrderSummaryPdf"
|
# unique_code="OrderSummaryPdf"
|
||||||
assigned_item_id = params[:id]
|
# assigned_item_id = params[:id]
|
||||||
table_name = params[:table_name]
|
# table_name = params[:table_name]
|
||||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
# assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||||
assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
# assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||||
|
|
||||||
# order queue stations
|
# # order queue stations
|
||||||
oqs = assigned_item.order_queue_station
|
# oqs = assigned_item.order_queue_station
|
||||||
|
|
||||||
# Check Printed
|
# # Check Printed
|
||||||
print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
# print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
||||||
|
|
||||||
# get dining
|
# # get dining
|
||||||
# dining = DiningFacility.find_by_name(table_name);
|
# # dining = DiningFacility.find_by_name(table_name);
|
||||||
# booking = Booking.find_by_dining_facility_id(dining.id)
|
# # booking = Booking.find_by_dining_facility_id(dining.id)
|
||||||
|
|
||||||
# Get Booking ID
|
# # Get Booking ID
|
||||||
booking_id = BookingOrder.where("order_id='#{assigned_item.order_id}'").pluck(:booking_id)[0]
|
# booking_id = BookingOrder.where("order_id='#{assigned_item.order_id}'").pluck(:booking_id)[0]
|
||||||
|
|
||||||
# print when complete click
|
# # print when complete click
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
# print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
# order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_booking_summary(print_settings,oqs, booking_id, print_status)
|
# order_queue_printer.print_booking_summary(print_settings,oqs, booking_id, print_status)
|
||||||
|
|
||||||
# update print status for completed same order items
|
# # update print status for completed same order items
|
||||||
assigned_items.each do |ai|
|
# assigned_items.each do |ai|
|
||||||
ai.print_status = true
|
# ai.print_status = true
|
||||||
ai.save
|
# ai.save
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -67,11 +67,17 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
|
|||||||
|
|
||||||
items_arr = []
|
items_arr = []
|
||||||
JSON.parse(params[:order_items]).each { |i|
|
JSON.parse(params[:order_items]).each { |i|
|
||||||
if i["item_instance_code"] == 'Extim60' || i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extie60' || i["item_instance_code"] == 'Extie30'
|
if i["item_instance_code"] == 'Extim60' || i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extim45' || i["item_instance_code"] == 'Extim15' || i["item_instance_code"] == 'Extie60' || i["item_instance_code"] == 'Extie30' || i["item_instance_code"] == 'Extie45' || i["item_instance_code"] == 'Extie15'
|
||||||
is_extra_time = true
|
is_extra_time = true
|
||||||
if i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extie30'
|
if i["item_instance_code"] == 'Extim30' || i["item_instance_code"] == 'Extie30'
|
||||||
time = 30*60*i["quantity"].to_i
|
time = 30*60*i["quantity"].to_i
|
||||||
extra_time = Time.at(time)
|
extra_time = Time.at(time)
|
||||||
|
elsif i["item_instance_code"] == 'Extim15' || i["item_instance_code"] == 'Extie15'
|
||||||
|
time = 15*60*i["quantity"].to_i
|
||||||
|
extra_time = Time.at(time)
|
||||||
|
elsif i["item_instance_code"] == 'Extim45' || i["item_instance_code"] == 'Extie45'
|
||||||
|
time = 45*60*i["quantity"].to_i
|
||||||
|
extra_time = Time.at(time)
|
||||||
else
|
else
|
||||||
time = 60*60*i["quantity"].to_i
|
time = 60*60*i["quantity"].to_i
|
||||||
extra_time = Time.at(time)
|
extra_time = Time.at(time)
|
||||||
|
|||||||
@@ -19,10 +19,18 @@ class Origami::MovetableController < BaseOrigamiController
|
|||||||
|
|
||||||
order = Order.find(booking_order.order_id)
|
order = Order.find(booking_order.order_id)
|
||||||
@obj_order = order
|
@obj_order = order
|
||||||
|
@customer = order.customer
|
||||||
@date = order.created_at
|
@date = order.created_at
|
||||||
|
@booking= booking
|
||||||
order.order_items.each do |item|
|
order.order_items.each do |item|
|
||||||
@order_items.push(item)
|
@order_items.push(item)
|
||||||
end
|
end
|
||||||
|
accounts = @customer.tax_profiles
|
||||||
|
@account_arr =[]
|
||||||
|
accounts.each do |acc|
|
||||||
|
account = TaxProfile.find(acc)
|
||||||
|
@account_arr.push(account)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@status_order = 'order'
|
@status_order = 'order'
|
||||||
else
|
else
|
||||||
@@ -32,9 +40,17 @@ class Origami::MovetableController < BaseOrigamiController
|
|||||||
if @status_order == 'order'
|
if @status_order == 'order'
|
||||||
@status_order = 'sale'
|
@status_order = 'sale'
|
||||||
end
|
end
|
||||||
|
@booking= booking
|
||||||
@date = sale.created_at
|
@date = sale.created_at
|
||||||
@status_sale = 'sale'
|
@status_sale = 'sale'
|
||||||
@obj_sale = sale
|
@obj_sale = sale
|
||||||
|
@customer = sale.customer
|
||||||
|
accounts = @customer.tax_profiles
|
||||||
|
@account_arr =[]
|
||||||
|
accounts.each do |acc|
|
||||||
|
account = TaxProfile.find(acc)
|
||||||
|
@account_arr.push(account)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
|
Rails.logger.debug ENV["SERVER_MODE"]
|
||||||
|
|
||||||
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
# Print for First Bill to Customer
|
# Print for First Bill to Customer
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
#shop detail
|
#shop detail
|
||||||
@@ -63,6 +66,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
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_details, "Frt",current_balance,nil)
|
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_details, "Frt",current_balance,nil)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
cash = params[:cash]
|
cash = params[:cash]
|
||||||
@@ -106,6 +110,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
# For Print
|
# For Print
|
||||||
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
@@ -142,6 +147,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
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_details, "Paid",current_balance,card_data)
|
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_details, "Paid",current_balance,card_data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
@@ -244,6 +250,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
@@ -279,6 +286,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
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_details, "Re-print",current_balance,card_data)
|
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_details, "Re-print",current_balance,card_data)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def foc
|
def foc
|
||||||
cash = params[:cash]
|
cash = params[:cash]
|
||||||
@@ -314,6 +322,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
# Re-call Sale Data
|
# Re-call Sale Data
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
|
|
||||||
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(saleObj.customer_id)
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
@@ -330,6 +339,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
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_details, "FOC",nil,nil)
|
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_details, "FOC",nil,nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def rounding_adj
|
def rounding_adj
|
||||||
|
|
||||||
|
|||||||
@@ -55,24 +55,24 @@ class Origami::ShiftsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
unique_code = "CloseCashierPdf"
|
# unique_code = "CloseCashierPdf"
|
||||||
shop_details = Shop.find(1)
|
# shop_details = Shop.find(1)
|
||||||
#get tax
|
# #get tax
|
||||||
shift_obj = ShiftSale.where('id =?',@shift.id)
|
# shift_obj = ShiftSale.where('id =?',@shift.id)
|
||||||
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
# @sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
||||||
#other payment details for mpu or visa like card
|
# #other payment details for mpu or visa like card
|
||||||
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
# @other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
||||||
|
|
||||||
# Calculate price_by_accounts
|
# # Calculate price_by_accounts
|
||||||
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
# @total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
||||||
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
# @total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||||
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
|
# @total_member_discount = ShiftSale.get_total_member_discount(@shift)
|
||||||
# get printer info
|
# # get printer info
|
||||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
# print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
printer = Printer::CashierStationPrinter.new(print_settings)
|
# printer = Printer::CashierStationPrinter.new(print_settings)
|
||||||
|
|
||||||
printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
|
# printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
customer= Customer.find(sale.customer_id)
|
customer= Customer.find(sale.customer_id)
|
||||||
|
|
||||||
@@ -86,7 +87,6 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
if customer.membership_id != nil && rebate
|
if customer.membership_id != nil && rebate
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
|
||||||
end
|
end
|
||||||
# get printer info
|
# get printer info
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
@@ -96,6 +96,7 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
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)
|
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)
|
||||||
|
end
|
||||||
|
|
||||||
#end print
|
#end print
|
||||||
|
|
||||||
|
|||||||
@@ -78,22 +78,13 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if oqs.auto_print
|
|
||||||
if oqs_order_items.length > 0
|
|
||||||
print_slip(oqs, order, oqs_order_items)
|
|
||||||
is_auto_printed = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# if oqs.id == oqpbz.order_queue_station_id
|
|
||||||
# # Auto Printing
|
|
||||||
# if oqs.auto_print
|
# if oqs.auto_print
|
||||||
# if oqs_order_items.length > 0
|
# if oqs_order_items.length > 0
|
||||||
# print_slip(oqs, order, oqs_order_items)
|
# print_slip(oqs, order, oqs_order_items)
|
||||||
# is_auto_printed = true
|
# is_auto_printed = true
|
||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
@@ -101,33 +92,32 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
private
|
private
|
||||||
#Print order_items in 1 slip
|
#Print order_items in 1 slip
|
||||||
def print_slip(oqs, order, order_items)
|
def print_slip(oqs, order, order_items)
|
||||||
unique_code="OrderSummaryPdf"
|
# unique_code="OrderSummaryPdf"
|
||||||
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
# order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_summary(print_settings, oqs,order.order_id, order_items, print_status="")
|
# order_queue_printer.print_order_summary(print_settings, oqs,order.order_id, order_items, print_status="")
|
||||||
|
|
||||||
AssignedOrderItem.where("order_id = '#{ order.order_id }'").find_each do |ai|
|
|
||||||
# update print status for order items
|
|
||||||
ai.print_status=true
|
|
||||||
ai.save
|
|
||||||
end
|
|
||||||
|
|
||||||
|
# AssignedOrderItem.where("order_id = '#{ order.order_id }'").find_each do |ai|
|
||||||
|
# # update print status for order items
|
||||||
|
# ai.print_status=true
|
||||||
|
# ai.save
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
#Print order_item in 1 slip per item
|
#Print order_item in 1 slip per item
|
||||||
def print_slip_item(oqs, assigned_item)
|
def print_slip_item(oqs, assigned_item)
|
||||||
unique_code="OrderItemPdf"
|
# unique_code="OrderItemPdf"
|
||||||
order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
# order_item = OrderItem.where("order_id='#{assigned_item.order_id}' AND item_instance_code='#{assigned_item.instance_code}'").first()
|
||||||
# print when complete click
|
# # print when complete click
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
# order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_item(print_settings, oqs,item.order_id, order_item.order_items_id, print_status="" )
|
# order_queue_printer.print_order_item(print_settings, oqs,item.order_id, order_item.order_items_id, print_status="" )
|
||||||
|
|
||||||
# update print status for completed same order items
|
# # update print status for completed same order items
|
||||||
assigned_order_item.each do |ai|
|
# assigned_order_item.each do |ai|
|
||||||
ai.print_status=true
|
# ai.print_status=true
|
||||||
ai.save
|
# ai.save
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -168,9 +168,8 @@
|
|||||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||||
<!-- OQS Buttons -->
|
<!-- OQS Buttons -->
|
||||||
<a href="<%= dashboard_path %>" class="btn btn-sm btn-block btn-default waves-effect" role="button" aria-haspopup="true"><i class="material-icons">reply</i> Back </a>
|
<a href="<%= dashboard_path %>" class="btn btn-sm btn-block btn-default waves-effect" role="button" aria-haspopup="true"><i class="material-icons">reply</i> Back </a>
|
||||||
<button type="button" title="Print Order Item" id="print_order_item" class="btn bg-blue btn-block btn-lg waves-effect">Print</a>
|
<!-- <button type="button" title="Print Order Item" id="print_order_item" class="btn bg-blue btn-block btn-lg waves-effect">Print</a>
|
||||||
<button type="button" class="btn bg-blue btn-block btn-lg waves-effect" id="print_order_summary">Print <br/>Order<br/>Summary</button>
|
<button type="button" class="btn bg-blue btn-block btn-lg waves-effect" id="print_order_summary">Print <br/>Order<br/>Summary</button> -->
|
||||||
<!-- <button type="button" class="" id="print_order_summary">Print <br/>Order<br/>Summary</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
<div id="save_order_id" data-order="">
|
<div id="save_order_id" data-order="">
|
||||||
<% end %>
|
<% end %>
|
||||||
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? && %>
|
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? %>
|
||||||
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
@@ -395,12 +395,16 @@
|
|||||||
|
|
||||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||||
|
<!-- first bill not used in cloud -->
|
||||||
|
<% if ENV["SERVER_MODE"] == "cloud" %>
|
||||||
|
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||||
|
<% else %>
|
||||||
<%if @membership.discount && @obj_sale.customer.membership_id %>
|
<%if @membership.discount && @obj_sale.customer.membership_id %>
|
||||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal">First Bill</button>
|
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal">First Bill</button>
|
||||||
<%else%>
|
<%else%>
|
||||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
<% end %>
|
||||||
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
||||||
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" active="<%= can? :overall_void, :void %>"> Void</button>
|
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" active="<%= can? :overall_void, :void %>"> Void</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -410,6 +414,7 @@
|
|||||||
<% else %>
|
<% else %>
|
||||||
<button type="button" id="check_in" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.check_in") %></button>
|
<button type="button" id="check_in" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.check_in") %></button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
||||||
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
||||||
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
||||||
@@ -449,12 +454,15 @@
|
|||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
||||||
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
||||||
$("#pay").show();
|
$("#pay").show();
|
||||||
}else{
|
}else{
|
||||||
$("#pay").hide();
|
$("#pay").hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
$('.invoicedetails').on('click', function () {
|
$('.invoicedetails').on('click', function () {
|
||||||
@@ -524,12 +532,12 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#re-print').click(function () {
|
// $('#re-print').click(function () {
|
||||||
var sale_id = $('#sale_id').val();
|
// var sale_id = $('#sale_id').val();
|
||||||
window.location.href = '/origami/' + sale_id + "/reprint"
|
// window.location.href = '/origami/' + sale_id + "/reprint"
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
});
|
// });
|
||||||
|
|
||||||
// Add Other Charges
|
// Add Other Charges
|
||||||
$('#other-charges').click(function () {
|
$('#other-charges').click(function () {
|
||||||
@@ -590,13 +598,19 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".choose_payment").on('click', function () {
|
$(".choose_payment").on('click', function () {
|
||||||
$( "#loading_wrapper").show();
|
$( "#loading_wrapper").show();
|
||||||
|
|
||||||
var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
type = $('.payment_method').val();
|
type = $('.payment_method').val();
|
||||||
if (type != "Credit") {
|
if(parseInt(jQuery.inArray("Credit", type)) == -1){
|
||||||
calculate_member_discount(sale_id,type);
|
if (parseInt(jQuery.inArray("MPU", type)) > 0 || parseInt(jQuery.inArray("VISA", type)) > 0 || parseInt(jQuery.inArray("JCB", type)) > 0 || parseInt(jQuery.inArray("Master", type)) > 0 || parseInt(jQuery.inArray("UNIONPAY", type)) > 0 || parseInt(jQuery.inArray("Redeem", type)) > 0) {
|
||||||
|
calculate_member_discount(sale_id,"Card");
|
||||||
|
|
||||||
|
}else{
|
||||||
|
calculate_member_discount(sale_id,"Cash");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -607,11 +621,11 @@
|
|||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||||
createReceiptNoInFirstBillData(receipt_no,type);
|
createReceiptNoInFirstBillData(receipt_no,type);
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function calculate_member_discount(sale_id,type) {
|
function calculate_member_discount(sale_id,type) {
|
||||||
var sub_total = $('#sub-total').text();
|
var sub_total = $('#sub-total').text();
|
||||||
if (type == "Cash") {
|
if (type == "Cash") {
|
||||||
@@ -630,17 +644,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// $('#pay').on('click', function () {
|
|
||||||
// var sale_id = $('#sale_id').val();
|
|
||||||
// var url = '/origami/sale/' + sale_id + "/rounding_adj";
|
|
||||||
// $.ajax({
|
|
||||||
// type: "POST",
|
|
||||||
// url: '/origami/sale/' + sale_id + "/rounding_adj",
|
|
||||||
// success: function (result) {
|
|
||||||
// window.location.href = '/origami/sale/' + sale_id + "/payment";
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
$('#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 + "/payment";
|
window.location.href = '/origami/sale/' + sale_id + "/payment";
|
||||||
|
|||||||
@@ -22,12 +22,28 @@
|
|||||||
<div class="card-columns" style="padding-top:10px;" >
|
<div class="card-columns" style="padding-top:10px;" >
|
||||||
<% @tables.each do |table| %>
|
<% @tables.each do |table| %>
|
||||||
<% if table.status == 'occupied' %>
|
<% if table.status == 'occupied' %>
|
||||||
|
<% if table.get_booking.nil? %>
|
||||||
|
<% if table.get_checkout_booking.nil? %>
|
||||||
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||||
|
<% else %>
|
||||||
|
<div class="card tables orange text-white" data-id="<%= table.id %>">
|
||||||
|
<% end %>
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= table.name %>
|
<%= table.name %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<% if table.get_checkout_booking.nil? %>
|
||||||
|
<div class="card tables blue text-white" data-id="<%= table.id %>">
|
||||||
|
<% else %>
|
||||||
|
<div class="card tables orange text-white" data-id="<%= table.id %>">
|
||||||
|
<% end %>
|
||||||
|
<div class="card-block">
|
||||||
|
<%= table.name %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
<div class="card tables green text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
<div class="card tables green text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<%= table.name %>
|
<%= table.name %>
|
||||||
@@ -59,10 +75,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--- Panel 3 - s -->
|
<!--- Panel 3 - s -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- tabs - End -->
|
<!-- tabs - End -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Column One -->
|
<!-- Column One -->
|
||||||
|
|
||||||
@@ -72,25 +88,77 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div><strong id="order-title"> MOVE --> <span style='color:red'> ' <%= @dining.name %> ' </span> to <span style='color:blue' id="moved"> </span></strong></div>
|
<div><strong id="order-title"> MOVE --> <span style='color:red'> ' <%= @dining.name %> ' </span> to <span style='color:blue' id="moved"> </span></strong></div>
|
||||||
<input type='hidden' id="change_table_value" value="" />
|
<input type='hidden' id="change_table_value" value="" />
|
||||||
|
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||||
|
<% if !@obj_order.nil? %>
|
||||||
|
<div id="save_order_id" data-order="<%= @obj_order.order_id %>">
|
||||||
|
<% else %>
|
||||||
|
<div id="save_order_id" data-order="">
|
||||||
|
<% end %>
|
||||||
|
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
|
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? %>
|
||||||
|
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% else %>
|
||||||
|
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% elsif @status_sale == 'sale' %>
|
||||||
|
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
|
<% if !@booking.reserved_by.nil? && %>
|
||||||
|
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% else %>
|
||||||
|
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<div class="card-title row">
|
<div class="card-title">
|
||||||
|
<div class="row p-l-5 p-r-5">
|
||||||
|
<% if (!@sale_array.empty?) && (!@date.nil?) %>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
<p class="m-l-10"> Receipt No: <span id="receipt_no">
|
Receipt No: <span id="receipt_no">
|
||||||
<% if @status_sale == 'sale' %>
|
<% if @status_sale == 'sale' %>
|
||||||
<%= @sale_array[0].receipt_no rescue '' %>
|
<%= @sale_array[0].receipt_no rescue '' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span></p>
|
</span>
|
||||||
|
<br>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||||
<p class="m-r-10">Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y-%I:%M %p") rescue '-' %></span>
|
||||||
</div>
|
<br>
|
||||||
</div>
|
|
||||||
<div class="card-title row customer_detail hide">
|
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
|
||||||
<p>Customer : <span id="customer_name"></span></p>
|
|
||||||
</div>
|
</div>
|
||||||
|
<% elsif !@date.nil? %>
|
||||||
|
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||||
|
Order No: <span id="order_no">
|
||||||
|
<% if @status_order == 'order' %>
|
||||||
|
<%= @obj_order.order_id rescue '' %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-5 col-md-5 col-sm-5 text-right">
|
||||||
|
Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y") rescue '-' %></span>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row p-l-5 p-r-5">
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||||
|
|
||||||
|
<% if @status_sale == 'sale' %>
|
||||||
|
<p class="hidden customer-id"><%= @sale_array[0].customer_id rescue '' %></p>
|
||||||
|
Customer : <%= @sale_array[0].customer.name rescue '' %>
|
||||||
|
<% elsif @status_order == 'order'
|
||||||
|
%>
|
||||||
|
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
|
||||||
|
Customer : <%= @customer.name rescue "" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="order-detail-slimscroll" data-height="130">
|
<div id="order-detail-slimscroll" data-height="130">
|
||||||
<div class="card-text" style="" >
|
<div class="card-text" style="" >
|
||||||
@@ -108,7 +176,6 @@
|
|||||||
count = 0
|
count = 0
|
||||||
sub_total = 0
|
sub_total = 0
|
||||||
if @status_sale == "sale"
|
if @status_sale == "sale"
|
||||||
puts @sale_array[0]
|
|
||||||
@sale_array[0].sale_items.each do |sale_item|
|
@sale_array[0].sale_items.each do |sale_item|
|
||||||
count += 1
|
count += 1
|
||||||
sub_total = sub_total + sale_item.price
|
sub_total = sub_total + sale_item.price
|
||||||
@@ -127,15 +194,13 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
if @status_order == 'order' && @status_sale != 'sale'
|
if @status_order == 'order' && @status_sale != 'sale'
|
||||||
unless @order_items.nil?
|
unless @order_items.nil? || @order_items.empty?
|
||||||
count = 0
|
count = 0
|
||||||
@order_items.each do |order_item |
|
@order_items.each do |order_item |
|
||||||
puts @order_items.size
|
|
||||||
puts "view"
|
|
||||||
count += 1
|
count += 1
|
||||||
sub_total = sub_total + order_item.price
|
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||||
|
|
||||||
unless order_item.price <= 0 %>
|
#unless order_item.price <= 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= count %></td>
|
<td><%= count %></td>
|
||||||
<td class='item-name'><%= order_item.item_name %></td>
|
<td class='item-name'><%= order_item.item_name %></td>
|
||||||
@@ -143,13 +208,13 @@
|
|||||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
end
|
#end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%
|
<%
|
||||||
@@ -212,7 +277,7 @@ end
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(".tables").on('click', function(){
|
$(".tables").on('click', function(){
|
||||||
$('.tables').removeClass('selected-item');
|
$('.tables').removeClass('selected-item');
|
||||||
$(this).addClass('selected-item');
|
$(this).addClass('selected-item');
|
||||||
@@ -288,8 +353,8 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
window.location.href = '/origami/table/'+ "<%= @dining.id %>";
|
window.location.href = '/origami/table/'+ "<%= @dining.id %>";
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -26,13 +26,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* start check first bill or not*/
|
/* start check first bill or not*/
|
||||||
var receipt_no = "";
|
var receipt_no = "";
|
||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
||||||
if(payment_type) {
|
if(payment_type) {
|
||||||
$(".others-payment").hide();
|
$(".others-payment").hide();
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
$("."+payment_type[i]).show();
|
$("."+payment_type[i]).show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
$('.others-payment').on('click',function(){
|
$('.others-payment').on('click',function(){
|
||||||
|
|||||||
@@ -298,21 +298,24 @@
|
|||||||
<button type="button" class="btn bg-red btn-block" id="void" active="<%= can? :overall_void, :void %>"> Void </button>
|
<button type="button" class="btn bg-red btn-block" id="void" active="<%= can? :overall_void, :void %>"> Void </button>
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
/* start check first bill or not*/
|
/* start check first bill or not*/
|
||||||
|
var member_id = $('#membership_id').text();
|
||||||
|
var member_discount = $('#member_discount').text();
|
||||||
var receipt_no = "";
|
var receipt_no = "";
|
||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
|
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
|
||||||
// console.log(jQuery.inArray("Credit", payment_type))
|
console.log(payment_type)
|
||||||
// console.log(payment_type)
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
|
if (member_id && member_discount) {
|
||||||
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
|
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
|
||||||
$("#credit_payment").hide();
|
$("#credit_payment").hide();
|
||||||
} else{
|
} else{
|
||||||
@@ -324,6 +327,8 @@
|
|||||||
} else{
|
} else{
|
||||||
$("#card_payment").hide();
|
$("#card_payment").hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
var dining_id = "<%= @sale_data.bookings[0].dining_facility_id %>";
|
var dining_id = "<%= @sale_data.bookings[0].dining_facility_id %>";
|
||||||
|
|||||||
@@ -374,16 +374,14 @@
|
|||||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||||
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
|
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
|
||||||
<!-- <button type="button" id="request_bills" class="btn bg-blue btn-block" disabled> Req.Bill</button> -->
|
<!-- <button type="button" id="request_bills" class="btn bg-blue btn-block" disabled> Req.Bill</button> -->
|
||||||
<%if @membership.discount && @obj_sale.customer.membership_id %>
|
<!-- first bill not used in cloud -->
|
||||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal">First Bill</button>
|
<% if ENV["SERVER_MODE"] != "cloud" %>
|
||||||
<%else%>
|
|
||||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||||
<%end%>
|
<% end %>
|
||||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||||
<button type="button" id="void" class="btn bg-blue btn-block" > Void </button>
|
<button type="button" id="void" class="btn bg-blue btn-block" > Void </button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
|
|
||||||
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
||||||
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
||||||
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
||||||
@@ -455,11 +453,13 @@ $(document).ready(function(){
|
|||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
||||||
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
||||||
$("#pay").show();
|
$("#pay").show();
|
||||||
}else{
|
}else{
|
||||||
$("#pay").hide();
|
$("#pay").hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
$('.invoicedetails').on('click',function(){
|
$('.invoicedetails').on('click',function(){
|
||||||
|
|||||||
@@ -201,7 +201,7 @@
|
|||||||
<% if @sale.sale_status != 'void' %>
|
<% if @sale.sale_status != 'void' %>
|
||||||
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
|
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button>
|
<!-- <button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -271,10 +271,10 @@ $('#back').on('click',function(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#re-print').click(function() {
|
// $('#re-print').click(function() {
|
||||||
var sale_id = $('#sale_id').val();
|
// var sale_id = $('#sale_id').val();
|
||||||
window.location.href = '/origami/'+ sale_id + "/reprint"
|
// window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||||
|
|
||||||
return false;
|
// return false;
|
||||||
});
|
// });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ test:
|
|||||||
# instead read values from the environment.
|
# instead read values from the environment.
|
||||||
production:
|
production:
|
||||||
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
|
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
|
||||||
sx_provision_url: provision.zsai.ws/api #192.168.1.94:3002
|
sx_provision_url: connect.smartsales.asia/api #192.168.1.147:3002/api
|
||||||
server_mode: cloud
|
server_mode: cloud
|
||||||
cipher_type: AES-256-CBC
|
cipher_type: AES-256-CBC
|
||||||
sx_key: Wh@t1$C2L
|
sx_key: Wh@t1$C2L
|
||||||
|
|||||||
11
config/shops.json
Normal file
11
config/shops.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"lookup": "osaka1-7.zsai.ws",
|
||||||
|
"value": {
|
||||||
|
"key": "wwF9Zx9q/LfxSDqSNHYXvfu1eGsBqFEFXoXqGWrEirA=\n",
|
||||||
|
"iv": "l1rUEZFcPNHrTHWgaODkYQ==\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user