Changeset - 2c3438ba0f89
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-09-03 21:01:28
brettcsmith@brettcsmith.org
balance_sheet: Add account code column to chart of accounts.
2 files changed with 8 insertions and 2 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/balance_sheet.py
Show inline comments
...
 
@@ -198,7 +198,7 @@ class Balances:
 
            return prefix, -max_bal
 
        return sorted(class_bals, key=sortkey)
 

	
 
    def iter_accounts(self, root: str) -> Sequence[data.Account]:
 
    def iter_accounts(self, root: Optional[str]=None) -> Sequence[data.Account]:
 
        start_date = self.period_range.start
 
        stop_date = self.period_range.stop
 
        return sorted(
...
 
@@ -573,6 +573,7 @@ class Report(core.BaseODS[Sequence[None], None]):
 
            "Trial Balances",
 
            ["Account Name"],
 
            ["Classification"],
 
            ["Account Code"],
 
            ["Balance Beginning", self.balances.period_range.start.strftime(self.date_fmt)],
 
            totals_prefix=["Change During", f"{self.period_desc} Ending"],
 
            title_fmt="Chart of Accounts with DRAFT {sheet_name}",
...
 
@@ -588,6 +589,10 @@ class Report(core.BaseODS[Sequence[None], None]):
 
            ["Balance Ending", self.period_name],
 
            stylename=header_row.lastChild.getAttribute('stylename'),
 
        ), header_row.lastChild)
 
        # Hide account code if it's not ready.
 
        # FIXME: This code can be removed once codes are fully established.
 
        if not any(acct.meta.get('account-code') for acct in self.balances.iter_accounts()):
 
            self.sheet.childNodes[2].setAttribute('visibility', 'collapse')
 

	
 
        for acct_root in ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity']:
 
            norm_func = core.normalize_amount_func(f'{acct_root}:Dummy')
...
 
@@ -606,6 +611,7 @@ class Report(core.BaseODS[Sequence[None], None]):
 
                self.add_row(
 
                    self.string_cell(account),
 
                    self.string_cell(account.meta.get('classification', '')),
 
                    self.string_cell(account.meta.get('account-code', '')),
 
                    open_cell,
 
                    self.balance_cell(norm_func(period_bal)),
 
                    close_cell,
setup.py
Show inline comments
...
 
@@ -5,7 +5,7 @@ from setuptools import setup
 
setup(
 
    name='conservancy_beancount',
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.9.4',
 
    version='1.9.5',
 
    author='Software Freedom Conservancy',
 
    author_email='info@sfconservancy.org',
 
    license='GNU AGPLv3+',
0 comments (0 inline, 0 general)