ledger: Improve sheet size math.

This commit is contained in:
Brett Smith 2020-07-17 11:00:33 -04:00
parent e5aa63996a
commit 6f1d01a3d4

View file

@ -110,7 +110,7 @@ class LedgerODS(core.BaseODS[data.Posting, data.Account]):
# keeping the default limit conservative seems good to avoid running into
# other limits (like the number of hyperlinks per worksheet), plus just
# better for human organization and readability.
SHEET_SIZE = 65000
SHEET_SIZE = 65500
def __init__(self,
start_date: datetime.date,
@ -355,7 +355,8 @@ class LedgerODS(core.BaseODS[data.Posting, data.Account]):
for account, related in self.account_groups.items()
)
tally_by_account = {
account: count
# 3 for the rows generated by start_section+end_section
account: count + 3
for account, count in tally_by_account_iter
if count or account.keeps_balance()
}