Changeset - ba8aaaa98831
[Not reviewed]
0 4 0
Brett Smith - 4 years ago 2020-06-09 18:52:55
brettcsmith@brettcsmith.org
accrual: Aging report uses group since last nonzero. RT#11600.

This makes it consistent with our other reports. The fact that it wasn't
already was basically an oversight.
4 files changed with 25 insertions and 2 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/accrual.py
Show inline comments
...
 
@@ -477,13 +477,17 @@ class AgingReport(BaseReport):
 
            date = datetime.date.today()
 
        self.out_bin = out_file
 
        self.logger = logger.getChild(type(self).__name__)
 
        self.ods = AgingODS(rt_client, date, self.logger)
 

	
 
    def run(self, groups: PostGroups) -> None:
 
        rows = list(group for group in groups.values() if not group.is_zero())
 
        rows = list(
 
            group.since_last_nonzero()
 
            for group in groups.values()
 
            if not group.is_zero()
 
        )
 
        rows.sort(key=lambda related: (
 
            related.account,
 
            related[0].meta.date,
 
            min(related.entities()) if related.accrued_entities else '',
 
        ))
 
        self.ods.write(rows)
setup.py
Show inline comments
...
 
@@ -2,13 +2,13 @@
 

	
 
from setuptools import setup
 

	
 
setup(
 
    name='conservancy_beancount',
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.1.4',
 
    version='1.1.5',
 
    author='Software Freedom Conservancy',
 
    author_email='info@sfconservancy.org',
 
    license='GNU AGPLv3+',
 

	
 
    install_requires=[
 
        'babel>=2.6',  # Debian:python3-babel
tests/books/accruals.beancount
Show inline comments
...
 
@@ -21,12 +21,24 @@
 
2010-03-06 * "EarlyBird" "Payment for payment from previous FY"
 
  rt-id: "rt:44"
 
  invoice: "rt:44/440"
 
  Liabilities:Payable:Accounts  125 USD
 
  Assets:Checking  -125 USD
 

	
 
2010-03-15 * "GrantCo" "2010Q1 grant"
 
  rt-id: "rt:470"
 
  invoice: "rt:470/4700"
 
  Assets:Receivable:Accounts  5000 USD
 
  Income:Donations           -5000 USD
 

	
 
2010-03-25 * "GrantCo" "2010Q1 grant ACH payment"
 
  rt-id: "rt:470"
 
  invoice: "rt:470/4700"
 
  Assets:Receivable:Accounts  -5000 USD
 
  Assets:Checking              5000 USD
 

	
 
2010-03-30 * "EarlyBird" "Travel reimbursement"
 
  rt-id: "rt:490"
 
  invoice: "rt:490/4900"
 
  Liabilities:Payable:Accounts  -75 USD
 
  Expenses:Travel  75 USD
 

	
...
 
@@ -112,6 +124,12 @@
 
  ; searching and generating the outgoing report.
 
  rt-id: "rt:520 rt:525"
 
  invoice: "rt:520/5200"
 
  contract: "rt:520/5220"
 
  Liabilities:Payable:Accounts  -1,000 EUR {1.100 USD}
 
  Expenses:FilingFees  1,000 EUR {1.100 USD}
 

	
 
2010-06-15 * "GrantCo" "2010Q2 grant"
 
  rt-id: "rt:470"
 
  invoice: "rt:470/4700"
 
  Assets:Receivable:Accounts  5500 USD
 
  Income:Donations           -5500 USD
tests/test_reports_accrual.py
Show inline comments
...
 
@@ -115,12 +115,13 @@ AGING_AP = [
 
]
 

	
 
AGING_AR = [
 
    AgingRow.make_simple('2010-03-05', 'EarlyBird', -500, 'rt:40/400'),
 
    AgingRow.make_simple('2010-05-15', 'MatchingProgram', 1500,
 
                         'rt://ticket/515/attachments/5150'),
 
    AgingRow.make_simple('2010-06-15', 'GrantCo', 5500, 'rt:470/4700'),
 
]
 

	
 
class RTClient(testutil.RTClient):
 
    TICKET_DATA = {
 
        '40': [
 
            ('400', 'invoice feb.csv', 'text/csv', '40.4k'),
0 comments (0 inline, 0 general)