Merge pull request #22098 from deepeshgarg007/accounts_payable_error

fix: Error when no data is present in AR/AP report
This commit is contained in:
Deepesh Garg 2020-06-03 21:59:28 +05:30 committed by GitHub
commit c83ad8185a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,9 +169,11 @@ class ReceivablePayableReport(object):
def append_subtotal_row(self, party):
sub_total_row = self.total_row_map.get(party)
self.data.append(sub_total_row)
self.data.append({})
self.update_sub_total_row(sub_total_row, 'Total')
if sub_total_row:
self.data.append(sub_total_row)
self.data.append({})
self.update_sub_total_row(sub_total_row, 'Total')
def get_voucher_balance(self, gle):
if self.filters.get("sales_person"):
@ -232,7 +234,8 @@ class ReceivablePayableReport(object):
if self.filters.get('group_by_party'):
self.append_subtotal_row(self.previous_party)
self.data.append(self.total_row_map.get('Total'))
if self.data:
self.data.append(self.total_row_map.get('Total'))
def append_row(self, row):
self.allocate_future_payments(row)