fixed conflict

This commit is contained in:
Nweni
2017-06-09 13:13:54 +06:30
10 changed files with 100 additions and 219 deletions

View File

@@ -207,7 +207,9 @@ class SalePayment < ApplicationRecord
def sale_update_payment_status(paid_amount)
#update amount_outstanding
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
self.sale.amount_changed = paid_amount.to_f - self.sale.amount_received.to_f
if (self.sale.grand_total <= self.sale.amount_received.to_f && self.sale.amount_changed.to_f > 0)
self.sale.payment_status = "paid"
self.sale.sale_status = "completed"