change credit payment query for dashboard and daily sales

This commit is contained in:
phyusin
2018-07-30 16:10:17 +06:30
parent cbb649c8d5
commit ca14b1e399
5 changed files with 39 additions and 30 deletions

View File

@@ -21,7 +21,7 @@ class SalePayment < ApplicationRecord
invoice_sale_payments = invoice.sale_payments
amount_due = invoice.grand_total
end
invoice_sale_payments.each do |payment|
if (payment.payment_status == "paid" )
amount_due = amount_due - payment.payment_amount