update rounding adj

This commit is contained in:
Aung Myo
2017-11-30 15:44:48 +06:30
parent a871bf3789
commit 5b9182c1d1
17 changed files with 126 additions and 78 deletions

View File

@@ -4,9 +4,18 @@ class Origami::CreditPaymentsController < BaseOrigamiController
# limit visa_amount
sale_data = Sale.find_by_sale_id(@sale_id)
total = sale_data.grand_total
total = sale_data.grand_total
@creditcount = 0
others = 0
@shop = Shop::ShopDetail
if @shop.is_rounding_adj
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
else
new_total = sale_data.grand_total
end
@rounding_adj = new_total-sale_data.grand_total
sale_data.sale_payments.each do |sale_payment|
if sale_payment.payment_method == "creditnote"
@creditcount = @creditcount + sale_payment.payment_amount