bill api return updated

This commit is contained in:
Nweni
2017-06-09 13:33:12 +06:30
parent 9dd96c7187
commit 8b99f4844e
3 changed files with 9 additions and 3 deletions

View File

@@ -211,6 +211,7 @@ class SalePayment < ApplicationRecord
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)
puts " sale update ......"
self.sale.payment_status = "paid"
self.sale.sale_status = "completed"
self.sale.save!