From 5a3ee24589053c59a54a314546afa74ca473536b 2020-08-18 20:26:12 From: Brett Smith Date: 2020-08-18 20:26:12 Subject: [PATCH] balance_sheet: Correct "release from restrictions" calculation. The old version was causing Income:Donations:Released postings to be "double-released." This version gets the bottom line numbers for Net Assets With/out Donor Restrictions match the corresponding numbers in the fund report. --- diff --git a/conservancy_beancount/reports/balance_sheet.py b/conservancy_beancount/reports/balance_sheet.py index 372fc1fe612d78a0725941afa01b0811ccabfeb0..16f351300f5fbe9044d3ec1625d3e1be0cb67198 100644 --- a/conservancy_beancount/reports/balance_sheet.py +++ b/conservancy_beancount/reports/balance_sheet.py @@ -433,14 +433,16 @@ class Report(core.BaseODS[Sequence[None], None]): self.add_row( self.string_cell("Net Assets released from restrictions:"), ) - released = self.balances.total( + released_expenses = self.balances.total( account='Expenses', period=Period.PERIOD, fund=Fund.RESTRICTED, - ) - self.balances.total( - classification=self.C_SATISFIED, period=Period.PERIOD, fund=Fund.RESTRICTED, ) other_totals = [core.MutableBalance() for _ in bal_kwargs] - other_totals[0] += released - other_totals[1] -= released + other_totals[0] += released_expenses - self.balances.total( + classification=self.C_SATISFIED, period=Period.PERIOD, fund=Fund.UNRESTRICTED, + ) + other_totals[1] -= released_expenses + self.balances.total( + classification=self.C_SATISFIED, period=Period.PERIOD, fund=Fund.RESTRICTED, + ) self.write_totals_row(self.C_SATISFIED, other_totals) self.write_totals_row( "Total Support and Revenue", diff --git a/setup.py b/setup.py index c5b51e7206beba138c8687d9c3175c4c29a9e219..28e2a7448b71e50bc4c978ad17354718d64614e4 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup setup( name='conservancy_beancount', description="Plugin, library, and reports for reading Conservancy's books", - version='1.8.4', + version='1.8.5', author='Software Freedom Conservancy', author_email='info@sfconservancy.org', license='GNU AGPLv3+',