Commit graph

630 commits

Author SHA1 Message Date
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
4de5df9035 typing: Upgrade more Posting Iterables to Iterators. 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
bd1a5fc9de ledger: Add program metadata column to all reports. 2021-02-17 14:21:45 -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
b5a22a963f statement: Accept search terms.
This is the most consistent way to be able to reconcile specific kinds of
payroll taxes.
2021-02-01 10:11:12 -05:00
Brett Smith
32eaf08552 statement: Fix typo in --output-file help. 2021-02-01 09:38:22 -05:00
Brett Smith
f23e0431e2 reconcile: New statement reconciler.
For now, this is basically just a specialized ledger report. It highlights
rows that already appear reconciled, and reports different balances, with
appropriate formulas to assist interactive reconciliation.

In the future I hope we can extend this to read various CSV statements and
then highlight rows different based on discrepancies between the statement
and the books, sort of like the PayPal reconciler does now.
2021-01-31 17:06:40 -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
c230f91ab7 meta_payroll_type: Add values for Exp:Pay:Benefits:Other. 2021-01-28 16:06:58 -05:00
Brett Smith
eba4ed45b0 reconcile: Start module with PayPal reconciliation report. 2021-01-23 10:23:03 -05:00
Brett Smith
91cbbc9159 reports.core: Add BaseODS.bgcolor_style() method. 2021-01-23 10:22:42 -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
ea79200131 ledger: Report accounts that are not open but have postings. 2021-01-19 14:23:06 -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
728db9983e fill: Use program logger over module logger to report problems. 2021-01-10 11:08:25 -05:00
Brett Smith
1c95c1b1b1 irs990scheduleA: New PDF extractor. 2021-01-09 15:17:55 -05:00
Brett Smith
1908358c30 extract: Lay the groundwork for specialized PDF extractors.
* Start a whole extract submodule.
* Parametrize FormExtractor.
* Add a FormExtractor._transform_fields() hook.
2021-01-09 15:16:07 -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
188063cbb7 setup: New release for pdfforms tools. 2021-01-09 10:11:56 -05:00
Brett Smith
b074edc538 cliutil: Set floor for pdfminer loglevel. 2021-01-09 10:09:45 -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
Brett Smith
0045d8d032 fields: Add FormField.add_kid() method. 2021-01-09 10:09:08 -05:00
Brett Smith
391fde5447 fields: TextField.set_value() accepts numeric types. 2021-01-09 10:09:08 -05:00
Brett Smith
13c66e8ce2 pdfforms: Initial module and tool to extract PDF form data to YAML.
Next steps:

* A tool to fill the PDF form based on values written to that YAML.
* An extension to fill some of those values with numbers queried from the
  books (which is why we need something more involved than FDF).
2021-01-09 10:09:08 -05:00
Brett Smith
1b7fdf4f3b Clarify and organize license info including additional permission. 2021-01-08 16:58:04 -05:00
Brett Smith
71f50a6cf8 data: Bugfix is_opening_balance_txn() for donations from equity. RT#13516
Opening balance transactions should only include opening equity
accounts and non-equity accounts. Reflect that in the test.
2020-12-29 12:20:53 -05:00
Brett Smith
7abc01b1ac fund: Bugfix crash when text report has an empty balance.
This mostly happens when a date range includes the opening or closing of a
fund account, because then the reported beginning/ending balance is empty.
2020-12-29 10:53:55 -05:00
Brett Smith
e06b400998 meta_payroll_type: Prefer :Tax: over :Taxes: in metadata values.
This is something we're doing generally, e.g., in our chart of accounts.
Do it here too for consistency. Accept the :Taxes: versions as synonyms.
2020-12-23 18:31:32 -05:00
Brett Smith
7c18bc221f meta_payroll_type: Refactor for more code reuse. 2020-12-23 17:27:30 -05:00
Bradley M. Kuhn
9d41f79c52 meta_payroll_type: Basic validation support for payroll-type 2020-12-23 17:06:07 -05:00
Brett Smith
51eee8ec8f meta_entity: Don't set transaction metadata when payee is None. RT#12913 2020-11-04 13:43:54 -05:00
Brett Smith
770b22f2f0 reports: Initial budget variance skeleton. RT#12680
This is a *very* rough initial draft of a report. As the docstring mentions,
it's basically counting on the user to provide rewrite rules to provide the
desired representation.

Long-term I'm hoping maybe we can standardize the program metadata enough,
or plan its replacement well enough, that this report can be written against
that directly. But that will take more planning about books structure, and
support from the plugin, before the report can be written that way.
2020-10-26 14:57:15 -04:00
Brett Smith
2b23eba549 data: PostingMeta.detached() can be chain-called. 2020-10-26 14:52:41 -04:00
Brett Smith
f7883ac314 reports: Separate methods for Balances to get posting classification.
For easier subclass customization.
2020-10-24 11:54:46 -04:00
Brett Smith
69f597a47c rewrite: Support `metakey in value` conditions.
For now, works exactly like ``.account in value``.
2020-10-24 11:43:46 -04:00
Brett Smith
ea69d58957 tests: Test updates for accrual report changes in the last commit.
Where assertions are removed from individual tests, I believe that
functionality is covered by other tests (although probably not to the extent
of checking multiple splits).
2020-10-24 11:31:39 -04:00