Merge pull request #37304 from GursheenK/party-totals-payable-report

fix: only float row values for total in AP summary
This commit is contained in:
ruthra kumar 2023-10-03 19:45:03 +05:30 committed by GitHub
commit ab378196bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,13 +99,11 @@ class AccountsReceivableSummary(ReceivablePayableReport):
# Add all amount columns # Add all amount columns
for k in list(self.party_total[d.party]): for k in list(self.party_total[d.party]):
if k not in ["currency", "sales_person"]: if isinstance(self.party_total[d.party][k], float):
self.party_total[d.party][k] += d.get(k) or 0.0
self.party_total[d.party][k] += d.get(k, 0.0)
# set territory, customer_group, sales person etc # set territory, customer_group, sales person etc
self.set_party_details(d) self.set_party_details(d)
self.party_total[d.party].update({"party_type": d.party_type})
def init_party_total(self, row): def init_party_total(self, row):
self.party_total.setdefault( self.party_total.setdefault(
@ -124,6 +122,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
"total_due": 0.0, "total_due": 0.0,
"future_amount": 0.0, "future_amount": 0.0,
"sales_person": [], "sales_person": [],
"party_type": row.party_type,
} }
), ),
) )
@ -133,13 +132,12 @@ class AccountsReceivableSummary(ReceivablePayableReport):
for key in ("territory", "customer_group", "supplier_group"): for key in ("territory", "customer_group", "supplier_group"):
if row.get(key): if row.get(key):
self.party_total[row.party][key] = row.get(key) self.party_total[row.party][key] = row.get(key, "")
if row.sales_person: if row.sales_person:
self.party_total[row.party].sales_person.append(row.sales_person) self.party_total[row.party].sales_person.append(row.get("sales_person", ""))
if self.filters.sales_partner: if self.filters.sales_partner:
self.party_total[row.party]["default_sales_partner"] = row.get("default_sales_partner") self.party_total[row.party]["default_sales_partner"] = row.get("default_sales_partner", "")
def get_columns(self): def get_columns(self):
self.columns = [] self.columns = []