add other charges amt for void Transactions

This commit is contained in:
phyusin
2018-07-20 17:26:15 +06:30
parent 77c0cc2b67
commit 1895936f38
2 changed files with 4 additions and 3 deletions

View File

@@ -345,7 +345,7 @@ class Transactions::SalesController < ApplicationController
customer= Customer.find(sale.customer_id)
#shop detail
shop_details = Shop.find(1)
shop_details = Shop.find_by_id(1)
# get member information
rebate = MembershipSetting.find_by_rebate(1)
if customer.membership_id != nil && rebate
@@ -361,8 +361,9 @@ class Transactions::SalesController < ApplicationController
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) #other charges
printer = Printer::ReceiptPrinter.new(print_settings)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil)
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil,other_amount)
result = {
:filepath => filename,
:printer_model => print_settings.brand_name,