Changeset - 3519933b8cea
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-08-19 20:09:53
brettcsmith@brettcsmith.org
balance_sheet: Normalize handling of release from restrictions.
2 files changed with 13 insertions and 13 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/balance_sheet.py
Show inline comments
...
 
@@ -89,2 +89,8 @@ class BalanceKey(NamedTuple):
 
class Balances:
 
    ACCOUNT_REWRITES: Mapping[str, data.Account] = {
 
        # Normalize the chart of accounts from prior FYs to the current one.
 
        'Expenses:CurrencyConversion': data.Account('Income:CurrencyConversion'),
 
        'Income:Donations:Released': data.Account('Equity:Funds:Restricted'),
 
    }
 

	
 
    def __init__(self,
...
 
@@ -125,6 +131,2 @@ class Balances:
 
                period = Period.OPENING
 
            if post.account == 'Expenses:CurrencyConversion':
 
                account = data.Account('Income:CurrencyConversion')
 
            else:
 
                account = post.account
 
            if post.meta.get(fund_key) == unrestricted_fund_value:
...
 
@@ -133,2 +135,3 @@ class Balances:
 
                fund = Fund.RESTRICTED
 
            account = self.ACCOUNT_REWRITES.get(post.account, post.account)
 
            try:
...
 
@@ -218,3 +221,2 @@ class Report(core.BaseODS[Sequence[None], None]):
 
    C_CASH = 'Cash'
 
    C_SATISFIED = 'Satisfaction of program restrictions'
 
    NO_BALANCE = core.Balance()
...
 
@@ -427,5 +429,3 @@ class Report(core.BaseODS[Sequence[None], None]):
 
        self.add_row()
 
        income_totals = self.write_classifications_by_account(
 
            'Income', bal_kwargs, (self.C_SATISFIED,),
 
        )
 
        income_totals = self.write_classifications_by_account('Income', bal_kwargs)
 
        self.write_totals_row("", income_totals, stylename=self.style_subtotline)
...
 
@@ -436,5 +436,5 @@ class Report(core.BaseODS[Sequence[None], None]):
 
        released = self.balances.total(
 
            account='Expenses', period=Period.PERIOD, fund=Fund.RESTRICTED,
 
        ) - self.balances.total(
 
            classification=self.C_SATISFIED, period=Period.PERIOD, fund=Fund.UNRESTRICTED,
 
            account=('Expenses', 'Equity'),
 
            period=Period.PERIOD,
 
            fund=Fund.RESTRICTED,
 
        )
...
 
@@ -443,3 +443,3 @@ class Report(core.BaseODS[Sequence[None], None]):
 
        other_totals[1] -= released
 
        self.write_totals_row(self.C_SATISFIED, other_totals)
 
        self.write_totals_row("Satisfaction of program restrictions", other_totals)
 
        self.write_totals_row(
setup.py
Show inline comments
...
 
@@ -7,3 +7,3 @@ setup(
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.8.5',
 
    version='1.8.6',
 
    author='Software Freedom Conservancy',
0 comments (0 inline, 0 general)