Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -212,7 +212,8 @@ 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
|
||||
|
||||
self.sale.amount_changed = self.sale.amount_received.to_f - self.sale.grand_total.to_f
|
||||
all_received_amount = 0.0
|
||||
sObj = Sale.find(self.sale_id)
|
||||
sObj.sale_payments.each do |spay|
|
||||
|
||||
Reference in New Issue
Block a user