refactor: use flt on outstanding on AR/AP summary report

(cherry picked from commit e4bdd3a28d7fa29b0460ad6661ff39a219c1fc5c)
This commit is contained in:
ruthra kumar 2023-11-30 15:57:57 +05:30 committed by Mergify
parent 5e6a4d257e
commit f44bb0df50

View File

@ -8,7 +8,7 @@ from frappe.utils import cint, flt
from erpnext.accounts.party import get_partywise_advanced_payment_amount
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport
from erpnext.accounts.utils import get_party_types_from_account_type
from erpnext.accounts.utils import get_currency_precision, get_party_types_from_account_type
def execute(filters=None):
@ -34,6 +34,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
def get_data(self, args):
self.data = []
self.receivables = ReceivablePayableReport(self.filters).run(args)[1]
self.currency_precision = get_currency_precision() or 2
self.get_party_total(args)
@ -57,7 +58,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
gl_balance_map = get_gl_balance(self.filters.report_date, self.filters.company)
for party, party_dict in self.party_total.items():
if party_dict.outstanding == 0:
if flt(party_dict.outstanding, self.currency_precision) == 0:
continue
row = frappe._dict()