print cancel qrpay
This commit is contained in:
@@ -38,10 +38,13 @@ class PrintReceiptJob < ApplicationJob
|
||||
other_amount = SaleItem.calculate_other_charges(sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
byebug
|
||||
if saleObj.sale_status == 'completed'
|
||||
printer.print_receipt_bill(print_settings, false, nil, cashier_terminal, sale_items, saleObj, customer.paypar_account_no, item_price_by_accounts, discount_price_by_accounts, member_info, rebate_amount, current_shop, 'paid', current_balance, card_data, other_amount, latest_order_no, card_balance_amount, nil, transaction_ref)
|
||||
elsif saleObj.sale_status == 'void'
|
||||
elsif saleObj.generic_void?
|
||||
printer.print_receipt_bill(print_settings, false, nil,cashier_terminal, sale_items, saleObj, customer.paypar_account_no, item_price_by_accounts, discount_price_by_accounts, member_info, rebate_amount, current_shop, "VOID", current_balance, card_data, other_amount,nil,nil,nil)
|
||||
elsif saleObj.mmqr_cancel_void?
|
||||
printer.print_receipt_bill(print_settings, false, nil,cashier_terminal, sale_items, saleObj, customer.paypar_account_no, item_price_by_accounts, discount_price_by_accounts, member_info, rebate_amount, current_shop, "MMQR CANCEL", current_balance, card_data, other_amount,nil,nil,nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -222,6 +222,14 @@ class Sale < ApplicationRecord
|
||||
|
||||
end
|
||||
|
||||
def generic_void?
|
||||
self.sale_status == 'void' && self.sale_audits.where(action: 'SALEVOID').exists?
|
||||
end
|
||||
|
||||
def mmqr_cancel_void?
|
||||
self.sale_status == 'void' && self.sale_audits.where(action: 'CANCEL_MMQR_PAYMENT').exists?
|
||||
end
|
||||
|
||||
def add_item (item)
|
||||
#check if the item is on promotion
|
||||
menu_category = MenuCategory.get_menu_category(item.item_code) #get menu category for menu items
|
||||
|
||||
Reference in New Issue
Block a user