update receipt bill

This commit is contained in:
Aung Myo
2017-06-30 18:02:17 +06:30
parent 45c69ab536
commit 2548fdcac1
7 changed files with 121 additions and 133 deletions

View File

@@ -9,10 +9,6 @@ class Origami::PaymentsController < BaseOrigamiController
sale_data = Sale.find_by_sale_id(sale_id)
sale_items = SaleItem.where("sale_id=?",sale_id)
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
rounding_adj = sale_data.grand_total - new_total
sale_data.update_attributes(grand_total: new_total,rounding_adjustment:rounding_adj)
# Print for First Bill to Customer
unique_code = "ReceiptBillPdf"
@@ -43,7 +39,12 @@ class Origami::PaymentsController < BaseOrigamiController
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
sale_payment.process_payment(saleObj, @user, cash, "cash")
sale_payment.process_payment(saleObj, @user, cash, "cash")
new_total = Sale.get_rounding_adjustment(saleObj.grand_total)
rounding_adj = saleObj.grand_total - new_total
saleObj.update_attributes(grand_total: new_total,rounding_adjustment:rounding_adj)
rebate_amount = nil