Changeset - b5a22a963f77
[Not reviewed]
0 2 0
Brett Smith - 3 years ago 2021-02-01 15:11:12
brettcsmith@brettcsmith.org
statement: Accept search terms.

This is the most consistent way to be able to reconcile specific kinds of
payroll taxes.
2 files changed with 19 insertions and 4 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/reconcile/statement.py
Show inline comments
...
 
@@ -343,3 +343,3 @@ The default is one month after the start date.
 
multiple times. You can specify a part of the account hierarchy, or an account
 
classification from metadata. Default 'Cash'.
 
classification from metadata. Default adapts to your search criteria.
 
""")
...
 
@@ -363,2 +363,11 @@ been reconciled. Default varies by account.
 
The default is `ReconciliationReport_<StartDate>_<StopDate>.ods`.
 
""")
 
    parser.add_argument(
 
        'search_terms',
 
        metavar='FILTER',
 
        type=cliutil.SearchTerm.arg_parser(),
 
        nargs=argparse.ZERO_OR_MORE,
 
        help="""Report on postings that match this criteria. The format is
 
NAME=TERM. TERM is a link or word that must exist in a posting's NAME
 
metadata to match.
 
""")
...
 
@@ -366,3 +375,6 @@ The default is `ReconciliationReport_<StartDate>_<StopDate>.ods`.
 
    if not args.accounts:
 
        args.accounts = ['Cash']
 
        if any(term.meta_key == 'payroll-type' for term in args.search_terms):
 
            args.accounts = ['Expenses:Payroll']
 
        else:
 
            args.accounts = ['Cash']
 
    return args
...
 
@@ -427,2 +439,5 @@ def main(arglist: Optional[Sequence[str]]=None,
 
        logger.warning("could not initialize RT client; spreadsheet links will be broken")
 
    postings = data.Posting.from_entries(entries)
 
    for search_term in args.search_terms:
 
        postings = search_term.filter_postings(postings)
 

	
...
 
@@ -437,3 +452,3 @@ def main(arglist: Optional[Sequence[str]]=None,
 
    )
 
    report.write(data.Posting.from_entries(entries))
 
    report.write(postings)
 
    if args.output_file is None:
setup.py
Show inline comments
...
 
@@ -7,3 +7,3 @@ setup(
 
    description="Plugin, library, and reports for reading Conservancy's books",
 
    version='1.17.0',
 
    version='1.17.1',
 
    author='Software Freedom Conservancy',
0 comments (0 inline, 0 general)