fixed trial balance related to showing zero balance
This commit is contained in:
parent
5207d1205e
commit
2db8dc922a
@ -123,7 +123,8 @@ def accumulate_values_into_parents(accounts, accounts_by_name):
|
|||||||
def prepare_data(accounts, filters, total_row):
|
def prepare_data(accounts, filters, total_row):
|
||||||
show_zero_values = cint(filters.show_zero_values)
|
show_zero_values = cint(filters.show_zero_values)
|
||||||
data = []
|
data = []
|
||||||
for i, d in enumerate(accounts):
|
accounts_with_zero_value = []
|
||||||
|
for d in accounts:
|
||||||
has_value = False
|
has_value = False
|
||||||
row = {
|
row = {
|
||||||
"account_name": d.account_name,
|
"account_name": d.account_name,
|
||||||
@ -141,7 +142,12 @@ def prepare_data(accounts, filters, total_row):
|
|||||||
if row[key]:
|
if row[key]:
|
||||||
has_value = True
|
has_value = True
|
||||||
|
|
||||||
if has_value or show_zero_values:
|
if show_zero_values:
|
||||||
|
data.append(row)
|
||||||
|
else:
|
||||||
|
if not has_value:
|
||||||
|
accounts_with_zero_value.append(d.name)
|
||||||
|
elif d.parent_account not in accounts_with_zero_value:
|
||||||
data.append(row)
|
data.append(row)
|
||||||
|
|
||||||
data.extend([{},total_row])
|
data.extend([{},total_row])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user