[fix] a better solution for #2776
This commit is contained in:
parent
3ee1f11771
commit
e027d3f34f
@ -408,6 +408,7 @@ def get_outstanding_invoices(amount_query, account, party_type, party):
|
|||||||
}), (account, party_type, party, d.voucher_type, d.voucher_no))
|
}), (account, party_type, party, d.voucher_type, d.voucher_no))
|
||||||
|
|
||||||
payment_amount = -1*payment_amount[0][0] if payment_amount else 0
|
payment_amount = -1*payment_amount[0][0] if payment_amount else 0
|
||||||
|
precision = frappe.get_precision("Sales Invoice", "outstanding_amount")
|
||||||
|
|
||||||
if d.invoice_amount > payment_amount:
|
if d.invoice_amount > payment_amount:
|
||||||
|
|
||||||
@ -415,8 +416,8 @@ def get_outstanding_invoices(amount_query, account, party_type, party):
|
|||||||
'voucher_no': d.voucher_no,
|
'voucher_no': d.voucher_no,
|
||||||
'voucher_type': d.voucher_type,
|
'voucher_type': d.voucher_type,
|
||||||
'posting_date': d.posting_date,
|
'posting_date': d.posting_date,
|
||||||
'invoice_amount': flt(d.invoice_amount),
|
'invoice_amount': flt(d.invoice_amount, precision),
|
||||||
'outstanding_amount': d.invoice_amount - payment_amount
|
'outstanding_amount': flt(d.invoice_amount - payment_amount, precision)
|
||||||
})
|
})
|
||||||
|
|
||||||
return all_outstanding_vouchers
|
return all_outstanding_vouchers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user