@@ -184,25 +184,27 @@ def check_ods_sheet(sheet, account_balances, *, full):
}
totals = {key: Decimal() for key in total_keys}
for fund, balances in account_bals.items():
for key in totals:
totals[key] += balances[key]
account_bals[''] = totals
if full:
account_bals['Unrestricted'] = unrestricted
for row in itertools.islice(sheet.getElementsByType(odf.table.TableRow), 4, None):
cells = iter(testutil.ODSCell.from_row(row))
try:
fund = next(cells).firstChild.text
except (AttributeError, StopIteration):
except AttributeError:
fund = ''
except StopIteration:
continue
balances = account_bals.pop(fund)
except KeyError:
pytest.fail(f"report included unexpected fund {fund}")
check_cell_balance(next(cells), balances['opening'])
check_cell_balance(next(cells), balances['Income'])
check_cell_balance(next(cells), -balances['Expenses'])
check_cell_balance(next(cells), balances['Equity'])
else:
check_cell_balance(