Changeset - 950536e4f19b
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-08-18 17:22:07
brettcsmith@brettcsmith.org
balance_sheet: Transform "chart of accounts" into trial balances.

It was mostly this already, just needed to add a column and change the
title.
2 files changed with 17 insertions and 12 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/balance_sheet.py
Show inline comments
...
 
@@ -244,3 +244,3 @@ class Report(core.BaseODS[Sequence[None], None]):
 
        self.write_cash_flows()
 
        self.write_chart_of_accounts()
 
        self.write_trial_balances()
 

	
...
 
@@ -567,8 +567,10 @@ class Report(core.BaseODS[Sequence[None], None]):
 

	
 
    def write_chart_of_accounts(self) -> None:
 
    def write_trial_balances(self) -> None:
 
        self.start_sheet(
 
            "Chart of Accounts",
 
            ["Account Name"], ["Classification"],
 
            "Trial Balances",
 
            ["Account Name"],
 
            ["Classification"],
 
            ["Balance Ending", self.opening_name],
 
            totals_prefix=["Change During", "Year Ending"],
 
            title_fmt="{sheet_name}",
 
            title_fmt="Chart of Accounts with DRAFT {sheet_name}",
 
        )
...
 
@@ -581,6 +583,6 @@ class Report(core.BaseODS[Sequence[None], None]):
 
        header_row.removeChild(header_row.firstChild)
 
        header_row.addElement(self.multiline_cell(
 
        header_row.insertBefore(self.multiline_cell(
 
            ["Balance Ending", self.period_name],
 
            stylename=header_row.lastChild.getAttribute('stylename'),
 
        ))
 
        ), header_row.lastChild)
 

	
...
 
@@ -594,6 +596,8 @@ class Report(core.BaseODS[Sequence[None], None]):
 
                if want_balance:
 
                    total_bal = self.balances.total(account=account)
 
                    total_cell = self.balance_cell(norm_func(total_bal))
 
                    close_bal = self.balances.total(account=account)
 
                    close_cell = self.balance_cell(norm_func(close_bal))
 
                    open_cell = self.balance_cell(norm_func(close_bal - period_bal))
 
                else:
 
                    total_cell = odf.table.TableCell()
 
                    close_cell = odf.table.TableCell()
 
                    open_cell = odf.table.TableCell()
 
                self.add_row(
...
 
@@ -601,5 +605,6 @@ class Report(core.BaseODS[Sequence[None], None]):
 
                    self.string_cell(account.meta.get('classification', '')),
 
                    open_cell,
 
                    self.balance_cell(norm_func(period_bal)),
 
                    close_cell,
 
                    self.balance_cell(norm_func(prior_bal)),
 
                    total_cell,
 
                )
setup.py
Show inline comments
...
 
@@ -7,3 +7,3 @@ setup(
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.8.1',
 
    version='1.8.2',
 
    author='Software Freedom Conservancy',
0 comments (0 inline, 0 general)