shop code

This commit is contained in:
Myat Zin Wai Maw
2019-11-22 18:24:02 +06:30
parent 5a3f328789
commit d1ab2c194d
106 changed files with 834 additions and 895 deletions

View File

@@ -8,7 +8,7 @@ class Origami::RequestBillsController < ApplicationController
end
# Print Request Bill and add to sale tables
def print
if !ShiftSale.current_shift.nil?
if !ShiftSale.current_shift(@shop.shop_code).nil?
order_id = params[:id] # order_id
order = Order.find(order_id)
booking = order.booking
@@ -45,7 +45,7 @@ class Origami::RequestBillsController < ApplicationController
sale_audit = SaleAudit.record_audit_sale(sale_data.sale_id,remark,action_by,type )
# Promotion Activation
Promotion.promo_activate(sale_data)
Promotion.promo_activate(sale_data,@shop.shop_code)
#bill channel
if ENV["SERVER_MODE"] == 'cloud'
@@ -62,14 +62,14 @@ class Origami::RequestBillsController < ApplicationController
render :json => result.to_json
else
#check checkInOut pdf print
checkout_time = Lookup.collection_of('checkout_time')
checkout_time = Lookup.where("shop_code='#{@shop.shop_code}'").collection_of('checkout_time')
if !booking.dining_facility_id.nil?
terminal = DiningFacility.find_by_id(booking.dining_facility_id)
cashier_terminal = CashierTerminal.find_by_id(terminal.zone_id)
if (!checkout_time.empty?) && (ENV["SERVER_MODE"] != "cloud") #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)
printer = PrintSetting.find_by_unique_code_and_shop_code(unique_code,@shop.shop_code)
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)