replace @shop and shop_details with current_shop
This commit is contained in:
@@ -20,7 +20,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
|
||||
#shop_detail = Shop.first
|
||||
# rounding adjustment
|
||||
if !path.include? ("credit_payment")
|
||||
if @shop.is_rounding_adj
|
||||
if current_shop.is_rounding_adj
|
||||
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
|
||||
rounding_adj = new_total - saleObj.grand_total
|
||||
saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:rounding_adj) if rounding_adj > 0
|
||||
@@ -154,7 +154,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
|
||||
other_amount = SaleItem.calculate_other_charges(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_items,saleObj,account_no, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, 'Foodcourt',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
|
||||
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,sale_items,saleObj,account_no, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, 'Foodcourt',current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
|
||||
|
||||
#end
|
||||
end
|
||||
@@ -223,7 +223,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
|
||||
@pdf_view = @lookup_pdf.value
|
||||
end
|
||||
|
||||
amount = SalePayment.get_kbz_pay_amount(sale_id, current_user,@shop)
|
||||
amount = SalePayment.get_kbz_pay_amount(sale_id, current_user,current_shop)
|
||||
@kbz_pay_amount += amount.to_f
|
||||
|
||||
#for changable on/off
|
||||
@@ -270,7 +270,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
|
||||
#end rounding adjustment
|
||||
|
||||
# rounding adjustment
|
||||
if @shop.is_rounding_adj
|
||||
if current_shop.is_rounding_adj
|
||||
a = saleObj.grand_total % 25 # Modulus
|
||||
b = saleObj.grand_total / 25 # Division
|
||||
#not calculate rounding if modulus is 0 and division is even
|
||||
@@ -472,7 +472,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
|
||||
filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "Re-print",current_balance,card_data,other_amount,latest_order_no,card_balance_amount,nil,transaction_ref)
|
||||
|
||||
result = {
|
||||
:status => true,
|
||||
@@ -571,7 +571,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,@shop, "FOC",nil,nil,other_amount,nil,nil,nil,nil)
|
||||
filename, sale_receipt_no, printer_name = printer.print_receipt_bill(print_settings, false, nil, cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,current_shop, "FOC",nil,nil,other_amount,nil,nil,nil,nil)
|
||||
result = {
|
||||
:status => true,
|
||||
:filepath => filename,
|
||||
@@ -606,7 +606,7 @@ class Foodcourt::PaymentsController < BaseFoodcourtController
|
||||
|
||||
saleObj = Sale.find(params[:sale_id])
|
||||
|
||||
if @shop.is_rounding_adj
|
||||
if current_shop.is_rounding_adj
|
||||
a = saleObj.grand_total % 25 # Modulus
|
||||
b = saleObj.grand_total / 25 # Division
|
||||
#not calculate rounding if modulus is 0 and division is even
|
||||
|
||||
Reference in New Issue
Block a user