fix: Consolidated Financial Report throws error for empty equity data list

This commit is contained in:
Subin Tom 2021-10-28 13:19:19 +05:30
parent 07a3be6f61
commit d786855d94

View File

@ -114,8 +114,9 @@ def prepare_companywise_opening_balance(asset_data, liability_data, equity_data,
# opening_value = Aseet - liability - equity # opening_value = Aseet - liability - equity
for data in [asset_data, liability_data, equity_data]: for data in [asset_data, liability_data, equity_data]:
account_name = get_root_account_name(data[0].root_type, company) if data:
opening_value += (get_opening_balance(account_name, data, company) or 0.0) account_name = get_root_account_name(data[0].root_type, company)
opening_value += (get_opening_balance(account_name, data, company) or 0.0)
opening_balance[company] = opening_value opening_balance[company] = opening_value