Changeset - 0f7a154ff4eb
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-06-18 14:07:10
brettcsmith@brettcsmith.org
reports: Balance cells try to retain currency on zero balance.
2 files changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reports/core.py
Show inline comments
...
 
@@ -925,5 +925,7 @@ class BaseODS(BaseSpreadsheet[RT, ST], metaclass=abc.ABCMeta):
 
    def balance_cell(self, balance: Balance, **attrs: Any) -> odf.table.TableCell:
 
        if balance.is_zero():
 
        balance = balance.clean_copy() or balance
 
        balance_currency_count = len(balance)
 
        if balance_currency_count == 0:
 
            return self.float_cell(0, **attrs)
 
        elif len(balance) == 1:
 
        elif balance_currency_count == 1:
 
            amount = next(iter(balance.values()))
tests/test_reports_ledger.py
Show inline comments
...
 
@@ -130,3 +130,3 @@ class ExpectedPostings(core.RelatedPostings):
 
        assert closing_row[0].value == end_date
 
        assert closing_row[4].text == closing_bal.format(None, empty='0', sep='\0')
 
        assert closing_row[4].text == closing_bal.format(None, empty='$0.00', sep='\0')
 

	
0 comments (0 inline, 0 general)