update payment controller for print current user with terminal
This commit is contained in:
@@ -145,6 +145,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
# For Cashier by Zone
|
# For Cashier by Zone
|
||||||
# bookings = Booking.where("sale_id='#{sale_id}'")
|
# bookings = Booking.where("sale_id='#{sale_id}'")
|
||||||
bookings = Booking.find_by_sale_id(sale_id)
|
bookings = Booking.find_by_sale_id(sale_id)
|
||||||
|
|
||||||
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
|
if !shift.nil?
|
||||||
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
|
else
|
||||||
if bookings.dining_facility_id.to_i > 0
|
if bookings.dining_facility_id.to_i > 0
|
||||||
table = DiningFacility.find(bookings.dining_facility_id)
|
table = DiningFacility.find(bookings.dining_facility_id)
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
@@ -157,6 +162,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
shift = ShiftSale.find(saleObj.shift_sale_id)
|
shift = ShiftSale.find(saleObj.shift_sale_id)
|
||||||
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# For Print
|
# For Print
|
||||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
@@ -447,7 +453,10 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
# else
|
# else
|
||||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
# end
|
# end
|
||||||
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
|
if !shift.nil?
|
||||||
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
|
else
|
||||||
if bookings[0].dining_facility_id.to_i > 0
|
if bookings[0].dining_facility_id.to_i > 0
|
||||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
@@ -456,6 +465,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
shift = ShiftSale.find(saleObj.shift_sale_id)
|
shift = ShiftSale.find(saleObj.shift_sale_id)
|
||||||
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
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
|
||||||
@@ -555,12 +565,11 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
# For Cashier by Zone
|
# For Cashier by Zone
|
||||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||||
# if bookings.count > 1
|
|
||||||
# # for Multiple Booking
|
shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
if !shift.nil?
|
||||||
# else
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
else
|
||||||
# end
|
|
||||||
if bookings[0].dining_facility_id.to_i > 0
|
if bookings[0].dining_facility_id.to_i > 0
|
||||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
@@ -569,7 +578,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
shift = ShiftSale.find(saleObj.shift_sale_id)
|
shift = ShiftSale.find(saleObj.shift_sale_id)
|
||||||
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Re-call Sale Data
|
# Re-call Sale Data
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user