print bill by cashier zone
This commit is contained in:
@@ -9,8 +9,19 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
sale_items = SaleItem.where("sale_id=?",sale_id)
|
||||
member_info = nil
|
||||
|
||||
# Print for First Bill to Customer
|
||||
# For Cashier by Zone
|
||||
bookings = Booking.find_by_sale_id(sale_id)
|
||||
if bookings.count > 1
|
||||
# for Multiple Cashier by Zone
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
else
|
||||
table = DiningFacility.find(bookings.dining_facility_id)
|
||||
end
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
# Print for First Bill to Customer
|
||||
unique_code = "ReceiptBillPdf"
|
||||
#shop detail
|
||||
shop_details = Shop.find(1)
|
||||
@@ -33,7 +44,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
printer.print_receipt_bill(print_settings,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_details, "Frt")
|
||||
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")
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -49,6 +60,19 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
render json: JSON.generate({:status => saleObj.rebate_status, :message => "Can't Rebate coz of Sever Error "})
|
||||
rebate_amount = nil
|
||||
|
||||
# For Cashier by Zone
|
||||
bookings = Booking.find_by_sale_id(sale_id)
|
||||
if bookings.count > 1
|
||||
# for Multiple Cashier by Zone
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
else
|
||||
table = DiningFacility.find(bookings.dining_facility_id)
|
||||
end
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
# For Print
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
@@ -68,7 +92,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid")
|
||||
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")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user