fix: advance amount is not calculating properly
This commit is contained in:
parent
2ae018a653
commit
1a6e01542a
@ -576,8 +576,10 @@ def get_party_shipping_address(doctype, name):
|
||||
def get_partywise_advanced_payment_amount(party_type="Customer"):
|
||||
data = frappe.db.sql(""" SELECT party, sum({0}) as amount
|
||||
FROM `tabGL Entry`
|
||||
WHERE party_type = %s and against_voucher is null GROUP BY party"""
|
||||
.format(("credit - debit") if party_type == "Customer" else "debit") , party_type)
|
||||
WHERE
|
||||
party_type = %s and against_voucher is null
|
||||
GROUP BY party"""
|
||||
.format(("credit") if party_type == "Customer" else "debit") , party_type)
|
||||
|
||||
if data:
|
||||
return frappe._dict(data)
|
@ -144,9 +144,10 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
||||
row += [self.get_party_name(args.get("party_type"), party)]
|
||||
|
||||
row += [partywise_advance_amount.get(party, 0)]
|
||||
paid_amt = flt(party_dict.paid_amt - partywise_advance_amount.get(party, 0))
|
||||
|
||||
row += [
|
||||
party_dict.invoiced_amt, party_dict.paid_amt, party_dict.credit_amt, party_dict.outstanding_amt,
|
||||
party_dict.invoiced_amt, paid_amt, party_dict.credit_amt, party_dict.outstanding_amt,
|
||||
party_dict.range1, party_dict.range2, party_dict.range3, party_dict.range4,
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user