shop code

This commit is contained in:
Myat Zin Wai Maw
2019-12-10 15:18:48 +06:30
parent c606ca73db
commit 79598c0126
115 changed files with 247 additions and 396 deletions

View File

@@ -64,14 +64,14 @@ class Foodcourt::VoidController < BaseFoodcourtController
# FOr Sale Audit
action_by = current_user.name
if access_code != "null" && current_user.role == "cashier"
action_by = Employee.find_by_emp_id_and_shop_code(access_code,Shop.current_shop.shop_code).name
action_by = Employee.find_by_emp_id_and_shop_code(access_code,@shop.shop_code).name
end
# remark = "Void Sale ID #{sale_id} | Receipt No #{sale.receipt_no} | Receipt No #{sale.receipt_no} | Table ->#{table.name}"
sale_audit = SaleAudit.record_audit_for_edit(sale_id,current_user.name, action_by,remark,"SALEVOID" )
#call paymal to void
if sale.sale_payments
if sale.sale_payments.nil?
membership_response =sale.paymal_payment_void
end
Rails.logger.debug "---------Paymal Payment Void response in VoidController"
@@ -110,7 +110,7 @@ class Foodcourt::VoidController < BaseFoodcourtController
current_balance = 0
end
printer = PrintSetting.where("shop_code='#{Shop.current_shop.shop_code}'")
printer = PrintSetting.where("shop_code='#{@shop.shop_code}'")
unique_code="ReceiptBillPdf"
if !printer.empty?
@@ -125,13 +125,13 @@ class Foodcourt::VoidController < BaseFoodcourtController
end
end
# get printer info
print_settings=PrintSetting.find_by_unique_code_and_shop_code(unique_code,Shop.current_shop.shop_code)
print_settings=PrintSetting.find_by_unique_code_and_shop_code(unique_code,@shop.shop_code)
# Calculate Food and Beverage Total
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale.sale_items)
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
other_amount = SaleItem.calculate_other_charges(sale.sale_items)
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,Shop.current_shop, "VOID",current_balance,nil,other_amount,nil,nil,nil,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "VOID",current_balance,nil,other_amount,nil,nil,nil,nil)
result = {
:filepath => filename,
:printer_model => print_settings.brand_name,