add other charges amt for void Transactions
This commit is contained in:
@@ -345,7 +345,7 @@ class Transactions::SalesController < ApplicationController
|
|||||||
customer= Customer.find(sale.customer_id)
|
customer= Customer.find(sale.customer_id)
|
||||||
|
|
||||||
#shop detail
|
#shop detail
|
||||||
shop_details = Shop.find(1)
|
shop_details = Shop.find_by_id(1)
|
||||||
# get member information
|
# get member information
|
||||||
rebate = MembershipSetting.find_by_rebate(1)
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
if customer.membership_id != nil && rebate
|
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)
|
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)
|
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)
|
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 = {
|
result = {
|
||||||
:filepath => filename,
|
:filepath => filename,
|
||||||
:printer_model => print_settings.brand_name,
|
:printer_model => print_settings.brand_name,
|
||||||
|
|||||||
@@ -281,7 +281,7 @@
|
|||||||
}, function (isConfirm) {
|
}, function (isConfirm) {
|
||||||
if (isConfirm) {
|
if (isConfirm) {
|
||||||
var sale_id = "<%= @sale.sale_id %>"
|
var sale_id = "<%= @sale.sale_id %>"
|
||||||
console.log(sale_id)
|
// console.log(sale_id)
|
||||||
var ajax_url = "/transactions/sales/" + sale_id + '/cashier/void';
|
var ajax_url = "/transactions/sales/" + sale_id + '/cashier/void';
|
||||||
var remark = $("#remark").val();
|
var remark = $("#remark").val();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user