Brett Smith
ae974b8e50
reports: Balance.copy() accepts tolerance argument.
2020-06-18 14:06:18 -04:00
Brett Smith
355a48381c
reports: Balance.clean_copy() creates new Balance with given tolerance.
2020-06-18 14:05:49 -04:00
Brett Smith
0f7a154ff4
reports: Balance cells try to retain currency on zero balance.
2020-06-18 10:07:10 -04:00
Brett Smith
8b8bdc0225
reports: Add BaseODS.column_style() method.
...
Use this to provide more consistent column styles throughout the reports.
2020-06-16 22:41:13 -04:00
Brett Smith
582316ae85
data: Add Metadata.report_links() method.
...
This is just a variant of get_links() that eats TypeError.
Higher-level reporting code often wants it.
2020-06-15 14:19:10 -04:00
Brett Smith
72f58d80d7
reports: BaseODS.currency_cell() sets default style.
...
It'll be rare we don't want this.
2020-06-15 14:09:42 -04:00
Brett Smith
8333ed8876
reports: Add RelatedPostings.group_by_account() classmethod.
2020-06-15 11:20:30 -04:00
Brett Smith
ccc3a829da
reports: Add RelatedPostings.balance_at_cost_by_date() method.
2020-06-15 10:38:26 -04:00
Brett Smith
b2e35d098a
reports: Add Balance subtraction methods.
2020-06-15 10:16:34 -04:00
Brett Smith
f21ac740f2
data: Add Posting.at_cost() method.
2020-06-15 10:16:34 -04:00
Brett Smith
760e0a8cd9
reports: Add column width styles to BaseODS.
2020-06-14 08:53:27 -04:00
Brett Smith
aff1fc537d
reports: Add BaseODS.meta_links_cell() method.
2020-06-12 17:10:25 -04:00
Brett Smith
17c5468a7d
reports: ODS links default to using URL as link text.
2020-06-12 16:42:54 -04:00
Brett Smith
52fc0d1b5f
reports: Add RelatedPostings.group_by_first_meta_link() method.
2020-06-11 14:01:19 -04:00
Brett Smith
f52ad4fbc1
reports: Add RelatedPostings.first_meta_links() method.
...
Basically moving this from AccrualPostings into the superclass.
2020-06-11 13:07:14 -04:00
Brett Smith
f76fa35fad
reports: RelatedPostings.all_meta_links() returns an iterator.
...
This preserves order.
2020-06-11 10:46:06 -04:00
Brett Smith
581046f988
reports: Balance.format() respects tolerance.
2020-06-09 09:04:27 -04:00
Brett Smith
cd1766adcf
reports: Balance.__eq__ respects tolerance.
2020-06-09 09:04:27 -04:00
Brett Smith
110e5038e1
reports: Balance.__init__ better handles multiple amounts of same currency.
...
This is something that should've happened with 3d704e286
but I didn't think of it at the time.
2020-06-09 09:04:27 -04:00
Brett Smith
0581525c98
reports: Add Balance.__pos__() method.
...
I did this while I was working on normalize_amount_func.
It turns out it's not immediately needed, but it's still nice to have.
2020-06-09 09:04:27 -04:00
Brett Smith
e26dffa214
reports: Add normalize_amount_func() function.
2020-06-09 09:04:27 -04:00
Brett Smith
39fa977f71
reports: Balance.le/ge_zero returns False when exactly at tolerance.
2020-06-04 10:49:55 -04:00
Brett Smith
4cba2b2681
reports: Balance has built-in tolerance for zero comparisons.
2020-06-03 22:20:37 -04:00
Brett Smith
70057fe383
reports: Start BaseODS class.
2020-06-03 21:24:47 -04:00
Brett Smith
d920c5842a
reports: Start BaseSpreadsheet class.
2020-06-03 21:24:47 -04:00
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
069939b2d3
reports: Balance classes support addition.
2020-06-03 18:53:17 -04:00
Brett Smith
cc0656dde9
reports: Add Balance.__abs__() method.
2020-06-03 18:52:44 -04:00
Brett Smith
39c9c0d83a
reports: Add RelatedPostings.__repr__() method.
2020-06-03 18:51:44 -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
dd949a4866
reports: Define RelatedPostings.__slots__.
2020-05-30 10:40:24 -04:00
Brett Smith
d8df34ebaf
reports: Balance.format() accepts None as a format.
2020-05-28 09:03:23 -04:00
Brett Smith
2c44cc8f50
reports: Add Balance.format() method.
2020-05-28 09:03:19 -04:00
Brett Smith
3780c31c59
reports: Add Balance.__eq__() method.
...
It turns out the provided implementation gets us most of the way there,
we just needed to add handling for the special case of zero balances.
Now it's confirmed with tests.
2020-05-28 09:01:00 -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
396173b55d
reports.Balance: Add eq_zero, ge_zero, and le_zero methods.
...
Support for RT#11294.
2020-05-21 23:10:03 -04:00
Brett Smith
1b81375294
reports: Add Balance.__neg__() method.
2020-04-29 14:35:20 -04:00
Brett Smith
68acb86e7e
reports: Add Balance.__str__() method.
2020-04-29 11:37:38 -04:00
Brett Smith
9fef177d2d
reports: Add RelatedPostings.all_meta_links() method.
2020-04-29 10:12:08 -04:00
Brett Smith
bd0d607032
typing: Annotate Iterators more specifically.
2020-04-28 16:35:15 -04:00
Brett Smith
d01df054ab
reports: Let RelatedPostings be initialized with an Iterable[Posting].
2020-04-27 15:51:30 -04:00
Brett Smith
5e061da940
reports: Fix return type of RelatedPostings.group_by_meta.
2020-04-24 15:36:02 -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
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