fix payment amount mismatch

This commit is contained in:
Thein Lin Kyaw
2020-01-07 10:46:45 +06:30
parent 8b5478cf27
commit eb65271d35
2 changed files with 7 additions and 8 deletions

View File

@@ -1404,7 +1404,7 @@ def self.get_payment_method_by_shift(shift_sale_range,shift,from,to,payment_type
if payment_type.present?
sale_payment = sale_payment.where(payment_method: payment_type)
end
return payments_total, sale_payment
end
@@ -1438,10 +1438,10 @@ end
cash = 0.0
self.sale_payments.each do |pay|
if pay.payment_method == 'cash'
cash = pay.payment_amount-self.amount_changed
cash += pay.payment_amount
end
end
return cash
return cash - self.amount_changed
end
def get_credit_amount