Commit graph

394 commits

Author SHA1 Message Date
20d242c7c7
reconcile: Fix a mutation bug causing not all matches to be passed through. 2022-03-02 18:26:10 +11:00
54d11f2437
reconcile: Add further typing info; update tests. 2022-02-24 22:43:37 +11:00
405dd553cb
reconcile: Implement "subset sum" feature matching multiple books entries to a single statement entry. 2022-02-23 17:25:02 +11:00
965aeabde9
reconcile: Update tests with renamed module. 2022-02-23 09:58:53 +11:00
517d4027b4
reconcile: Explicitly avoid payee matching when check-id provided in books. 2022-02-21 22:43:22 +11:00
c9dd9ffb28
reconciler: Fix totals. Never consider payee if check_id in books. 2022-02-21 22:22:42 +11:00
3377918279
reconcile: Make bank-statement path relative to $CONSERVANCY_BEANCOUNT.
Also add CSV metadata.
2022-02-21 18:31:07 +11:00
a3e60c639f
reconcile: Add special case for payee first word match. 2022-02-21 12:16:24 +11:00
32fc4517a0
reconcile: show check number, remove duplicate words in payee. 2022-02-19 00:27:48 +11:00
d8f4eac53b
reconcile: Improve reconciler matching and add test cases. 2022-02-18 20:36:11 +11:00
0342c5b83e
tests: Replace skipUnless with skipif.
The function skipUnless is available in `unittest`, but not `pytest`.
2022-02-04 19:11:54 +11:00
Bradley M. Kuhn
83e6e80bb8 meta_payroll_type — US:PTO — distinguish between Earned and Taken
Metadata `payroll-type` will go on `Liabilities:Payable:Vacation` and
`Expenses:Payroll:Salary`, but we need to distinguish as to whether
the Payroll was earned or taken.

Later,  `Liabilities:Payable:Vacation` should require a
`payroll-type` metadata of either `US:PTO:Taken` or `US:PTO:Earned`,
and the `CA:` equivalents.
2021-12-06 10:43:32 -08:00
Brett Smith
6703d1af87 reports: BaseODS puts each line of strings in a P tag.
This seems to be the most straightforward way to get Calc to automatically
determine a nice row height for multi-line string cells. This has become a
lot more noticeable now that query-report supports putting postal addresses
in cells.
2021-03-15 13:19:03 -04:00
Brett Smith
39a9d0d67e query: rt_ticket() supports looking up custom fields. 2021-03-12 17:16:46 -05:00
Brett Smith
ef03893bfe query: Convert query functions that return List to Set.
Beancount's built-in renderers expect this and are better equipped for it.
2021-03-12 10:56:43 -05:00
Brett Smith
25321a81b0 query: Add rt_ticket() query function. 2021-03-12 10:36:15 -05:00
Brett Smith
7335282e5a rtutil: Add RTDateTime class.
See comments for rationale.
2021-03-11 13:52:31 -05:00
Brett Smith
9e33b2795c config: Add RTCredentials.idstr() method.
Want to reuse this code for a query-report cache key.
2021-03-10 10:37:21 -05:00
Brett Smith
1c71d7c6e1 tests: Add tests for BaseODS.add_annotation(). 2021-03-10 10:25:19 -05:00
Brett Smith
6fa1278966 query: Improve formatting of ODS output.
* Provide dedicated formatting for more Beancount types.
* Improve code to determine when we're looking up link metadata
  and should format output as links.
2021-03-09 10:39:12 -05:00
Brett Smith
8af45e5f8a query: Add BQL functions for dealing with link metadata.
query-report was heading to a place where it was going to bifurcate. You
could structure input with its own special input switches, and with ODS
output, it would have its own dedicated grouping logic and use that.

But those things shouldn't be tied together for users. Instead, add
functions to BQL to be able to do the kind of grouping we want. This commit
adds those. Next we'll extend the ODS output to detect and format these
groups correctly.
2021-03-09 10:01:13 -05:00
Brett Smith
0f58960b67 query: Add ODS output format. 2021-03-06 15:45:11 -05:00
Brett Smith
a5ebc04f5d data: Metadata.human_name() treats _ like -. 2021-03-06 12:11:16 -05:00
Brett Smith
221d42a479 query: Add --select to use with WHERE condition arguments. 2021-03-05 16:45:24 -05:00
Brett Smith
9598b29ba7 txn_date: Check more filenames.
This follows up on the recent change to books.Loader.
2021-02-26 17:02:59 -05:00
Brett Smith
6752a40206 books: Let files under books/ include any Beancount files they want.
This provides more flexibility in repository setup while remaining backwards
compatible.

The changes to test_reports_query are just to accommodate the new
transaction in 2020-expenses.beancount.
2021-02-26 14:45:55 -05:00
Brett Smith
95f7524b00 cliutil: Add ExtendAction.
This is a user affordance we've wanted for a while, and
query-report *really* wants it.
2021-02-24 15:31:23 -05:00
Brett Smith
ccbc447a35 query: Start new reporting tool.
Ultimately this is going to be a tool that can generate nicely-formatted
spreadsheets from arbitrary bean-queries. This initial version doesn't
generate spreadsheets yet, but it does integrate our usual books-loading
tools and rewrite rules into existing bean-query functionality, so it's a
start. It also has some of the query building and parsing that higher-level
spreadsheets will need.
2021-02-24 13:15:33 -05:00
Brett Smith
5231a1784f cliutil: EnumArgument matches user arguments against aliases. 2021-02-24 13:15:33 -05:00
Brett Smith
ee2bd6c096 books: All tools use books.Loader.dispatch() and LoadResult.
This is significant code deduplication, as seen in the diffstat.
2021-02-24 13:15:33 -05:00
Brett Smith
3721226d17 books: Add Loader.dispatch() classmethod. 2021-02-24 13:15:33 -05:00
Brett Smith
f3c3ebcf59 books: Add LoadResult NamedTuple.
This refactors out some common functionality from our CLI tools.
2021-02-24 13:15:33 -05:00
Brett Smith
0a34ed6798 cliutil: ExceptHook catches RewriteRuleError.
Now that we have richer exceptions, this is the easiest way to refactor out
rewrite rule error handling from the various main functions where it
currenly lives.
2021-02-24 13:15:33 -05:00
Brett Smith
f508df06c1 rewrite: Richer exceptions for error reporting. 2021-02-19 18:54:36 -05:00
Brett Smith
b142b3e521 accrual: Use EnumArgument for ReportType. 2021-02-18 15:05:56 -05:00
Brett Smith
55b347271c ledger: Add fund ledger report type.
See the FundLedgerODS docstring for details.
2021-02-17 14:20:58 -05:00
Brett Smith
4188dc6a64 cliutil: Add EnumArgument.
This functionality already existed in the code three times, and it's about
to get more important for the ledger report, so now was the time to abstract
it.
2021-02-17 14:00:06 -05:00
Brett Smith
fe3560b748 meta_tax_reporting: New plugin validation. 2021-02-11 13:38:11 -05:00
Brett Smith
328f59231c meta_tax_implication: Accept titlecased values. 2021-02-11 11:17:24 -05:00
Brett Smith
ca38e45178 reports: Add BaseODS.row_count() method. 2021-01-29 14:26:54 -05:00
Brett Smith
250b14954f tests: Add tests for plugin.meta_payroll_type. 2021-01-29 11:28:29 -05:00
Brett Smith
fb9aa9eae1 tests: Add tests for BaseODS.bgcolor_style(). 2021-01-29 11:28:18 -05:00
Brett Smith
fdd9f2847b plugin: Skip enum value checks with a flag+FIXME.
We've long supported skipping documentation checks by flagging the
transaction. We haven't done the same for enumerated metadata because we
need it less often, and bad values tend to do more damage to reports.

However, occasionally when something very off-process happens, we do need it
as a matter of expediency. So support it.

In order to skip validation of these fields, the plugin requires that the
value start with the string "FIXME". This helps ensure that reports have a
consistent way to detect and warn about unfilled values in flagged
transactions.
2021-01-29 09:38:37 -05:00
Brett Smith
087b3274e7 ledger: Dedicated reporting tab for Expenses:Payroll.
To better accommodate the new payroll-type metadata.
2021-01-19 14:23:51 -05:00
Brett Smith
5c6d9d6f69 tax_implication: Bugfix "Corp" abbreviation in values. 2021-01-18 15:49:39 -05:00
Brett Smith
31cee4e0ba meta_tax_implication: New values for grant recipients. 2021-01-18 15:45:31 -05:00
Brett Smith
8b2633ec23 extract: Fill YAML with Python values, not PS/FDF values. 2021-01-09 13:20:15 -05:00
Brett Smith
6a3d64ff22 fields: Change FieldType capitalization.
This is friendlier to the YAML input and consistent with FieldFlags.
Less consistent with the rest of the codebase, but local consistency matters
more IMO.
2021-01-09 10:49:04 -05:00
Brett Smith
2cf4fdcfad pdfforms.fill: New module+tool.
After you edit the YAML generated by pdfform-extract,
you can re-fill the original PDF with pdfform-fill.
2021-01-09 10:09:08 -05:00
Brett Smith
902c313b4d cliutil: New function can_run. 2021-01-09 10:09:08 -05:00