fix bugs and improvement

This commit is contained in:
Thein Lin Kyaw
2020-06-16 12:26:25 +06:30
parent 160c43699e
commit e697108a6e
8 changed files with 18 additions and 26 deletions

View File

@@ -648,7 +648,7 @@ class SalePayment < ApplicationRecord
sale.payment_status = 'foc'
sale.sale_status = 'completed'
elsif sale.grand_total <= sale_payments.sum(&:payment_amount) && sale.sale_status == "new"
sale.amount_received = sale.amount_received + paid_amount
sale.amount_received = sale.amount_received + paid_amount.to_d
sale.amount_changed = sale_payments.sum(&:payment_amount) - sale.grand_total
sale.payment_status = "paid"