Changeset - db3ba4fd4d85
[Not reviewed]
0 3 0
Brett Smith - 4 years ago 2020-10-21 15:33:27
brettcsmith@brettcsmith.org
accrual: Add Prepaid Expenses to aging report.
3 files changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/accrual.py
Show inline comments
...
 
@@ -142,2 +142,3 @@ class AccrualAccount(enum.Enum):
 
    PAYABLE = Account('Liabilities:Payable', [365, 90, 60, 30])
 
    PREPAID = Account('Assets:Prepaid', [365, 120, 90, 60])
 

	
...
 
@@ -177,7 +178,11 @@ class AccrualPostings(core.RelatedPostings):
 
        key: Tuple[str, ...]
 
        prepaid_account = AccrualAccount.PREPAID.value.name
 
        for post in postings:
 
            norm_func = core.normalize_amount_func(post.account)
 
            invoice = str(post.meta.get('invoice', 'BlankInvoice'))
 
            entity = str(post.meta.get('entity', 'BlankEntity'))
 
            if post.account.is_under(prepaid_account):
 
                invoice = entity
 
            else:
 
                invoice = str(post.meta.get('invoice', 'BlankInvoice'))
 
            if norm_func(post.units.number) >= 0:
 
                entity = str(post.meta.get('entity', 'BlankEntity'))
 
                key = (post.meta.date.isoformat(), entity, invoice, post.account)
setup.py
Show inline comments
...
 
@@ -7,3 +7,3 @@ setup(
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.12.3',
 
    version='1.12.4',
 
    author='Software Freedom Conservancy',
tests/test_reports_accrual.py
Show inline comments
...
 
@@ -220,3 +220,3 @@ def check_aging_ods(ods_file, date, recv_rows=AGING_AR, pay_rows=AGING_AP):
 
    sheets = ods.spreadsheet.getElementsByType(odf.table.Table)
 
    assert len(sheets) == 2
 
    assert len(sheets) >= 2
 
    check_aging_sheet(sheets[0], recv_rows, date)
0 comments (0 inline, 0 general)