Changeset - f192d250e778
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-06-09 19:04:41
brettcsmith@brettcsmith.org
accrual: More detailed text for "total aged" lines in aging report.

Per bkuhn's request.
2 files changed with 21 insertions and 4 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/accrual.py
Show inline comments
...
 
@@ -402,5 +402,7 @@ class AgingODS(core.BaseODS[AccrualPostings, Optional[data.Account]]):
 
            return
 
        self.add_row()
 
        total_balance = core.MutableBalance()
 
        text_style = self.merge_styles(self.style_bold, self.style_endtext)
 
        text_span = self.COL_COUNT - 1
 
        last_age_text: Optional[str] = None
 
        self.add_row()
 
        for threshold, balance in zip(self.age_thresholds, self.age_balances):
...
 
@@ -415,5 +417,9 @@ class AgingODS(core.BaseODS[AccrualPostings, Optional[data.Account]]):
 
                age_text = days_text
 
            if last_age_text is None:
 
                age_range = f"Over {age_text}"
 
            else:
 
                age_range = f"{age_text}–{last_age_text}"
 
            self.add_row(
 
                self.string_cell(
 
                    f"Total Aged Over {age_text}: ",
 
                    f"Total Aged {age_range}: ",
 
                    stylename=text_style,
...
 
@@ -424,2 +430,13 @@ class AgingODS(core.BaseODS[AccrualPostings, Optional[data.Account]]):
 
            )
 
            last_age_text = age_text
 
            total_balance += balance
 
        self.add_row(
 
            self.string_cell(
 
                "Total Unpaid: ",
 
                stylename=text_style,
 
                numbercolumnsspanned=text_span,
 
            ),
 
            *(odf.table.TableCell() for _ in range(1, text_span)),
 
            self.balance_cell(total_balance),
 
        )
 

	
tests/test_reports_accrual.py
Show inline comments
...
 
@@ -184,3 +184,3 @@ def check_aging_sheet(sheet, aging_rows, date, accrue_date):
 
    for row in rows:
 
        if row.text.startswith("Total Aged Over "):
 
        if row.text.startswith("Total Aged "):
 
            break
...
 
@@ -190,3 +190,3 @@ def check_aging_sheet(sheet, aging_rows, date, accrue_date):
 
    for row in rows:
 
        if row.text.startswith("Total Aged Over "):
 
        if row.text.startswith("Total Aged "):
 
            actual_sum += Decimal(row.childNodes[-1].value)
0 comments (0 inline, 0 general)