From e027d3f34f5d2998035f72b3eee805a79b5fc046 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 15 Apr 2015 12:03:21 +0530 Subject: [PATCH] [fix] a better solution for #2776 --- erpnext/accounts/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index f6d9529713..4b5b5f65c5 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -408,6 +408,7 @@ def get_outstanding_invoices(amount_query, account, party_type, party): }), (account, party_type, party, d.voucher_type, d.voucher_no)) 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: @@ -415,9 +416,9 @@ def get_outstanding_invoices(amount_query, account, party_type, party): 'voucher_no': d.voucher_no, 'voucher_type': d.voucher_type, 'posting_date': d.posting_date, - 'invoice_amount': flt(d.invoice_amount), - 'outstanding_amount': d.invoice_amount - payment_amount - }) + 'invoice_amount': flt(d.invoice_amount, precision), + 'outstanding_amount': flt(d.invoice_amount - payment_amount, precision) + }) return all_outstanding_vouchers