Commit graph

12 commits

Author SHA1 Message Date
Brett Smith
3d704e2865 reports: Balance is initialized with just amounts.
This works fine with how we're currently using it, makes transformation
methods easier to implement, and avoids potential bugs where a balance is
initialized with a bad mapping.
2020-06-03 18:54:12 -04:00
Brett Smith
b37d7a3024 reports: Make RelatedPostings an immutable data structure.
This was an early mistake, it makes data consistency mistakes too
easy, and I only used it once so far in actual code. Going to fix
this now so I can more safely build on top of this data structure.
2020-06-03 18:51:38 -04:00
Brett Smith
81d216f282 reports: Add RelatedPostings.balance_at_cost() method.
This makes it easy to get results similar to `ledger -V`.
2020-05-28 09:01:00 -04:00
Brett Smith
9fef177d2d reports: Add RelatedPostings.all_meta_links() method. 2020-04-29 10:12:08 -04:00
Brett Smith
d01df054ab reports: Let RelatedPostings be initialized with an Iterable[Posting]. 2020-04-27 15:51:30 -04:00
Brett Smith
bd00822b8f reports: Add RelatedPostings.group_by_meta() classmethod. 2020-04-24 13:37:35 -04:00
Brett Smith
d41bc5e9b6 reports: Add RelatedPostings.clear() method. 2020-04-22 12:02:06 -04:00
Brett Smith
ed4258daf7 reports: Add RelatedPostings.meta_values() method.
This corresponds to the ledtag_onevalue check in the
payment-report and income-report scripts.
2020-04-22 11:59:12 -04:00
Brett Smith
99dbd1ac95 tests: Promote date_seq to testutil. 2020-04-22 09:17:58 -04:00
Brett Smith
b28646aa12 core.RelatedPostings: Add iter_with_balance method.
payment-report and accrual-report query to find the last date a
series of postings had a non/zero balance. This method is a good
building block for that.
2020-04-12 15:18:19 -04:00
Brett Smith
5aa30e5456 reports.core: Start Balance class. 2020-04-12 14:56:00 -04:00
Brett Smith
219cd4bc37 reports.core: Start RelatedPostings class. 2020-04-12 09:47:41 -04:00