Payment via card Bug fix

This commit is contained in:
Phyo
2017-06-15 09:49:44 +06:30
parent a1a6adbdd6
commit c6f976bab3

View File

@@ -212,7 +212,7 @@ class SalePayment < ApplicationRecord
def sale_update_payment_status(paid_amount) def sale_update_payment_status(paid_amount)
#update amount_outstanding #update amount_outstanding
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
self.sale.save!
self.sale.amount_changed = self.sale.amount_received.to_f - self.sale.grand_total.to_f self.sale.amount_changed = self.sale.amount_received.to_f - self.sale.grand_total.to_f
all_received_amount = 0.0 all_received_amount = 0.0
sObj = Sale.find(self.sale_id) sObj = Sale.find(self.sale_id)