ledger: Dedicated reporting tab for Expenses:Payroll.

To better accommodate the new payroll-type metadata.
This commit is contained in:
Brett Smith 2021-01-19 14:23:23 -05:00
parent ea79200131
commit 087b3274e7
4 changed files with 13 additions and 2 deletions

View file

@ -92,6 +92,7 @@ class LedgerODS(core.BaseODS[data.Posting, None]):
] ]
ACCOUNT_COLUMNS: Dict[str, Sequence[str]] = collections.OrderedDict([ ACCOUNT_COLUMNS: Dict[str, Sequence[str]] = collections.OrderedDict([
('Income', ['project', 'rt-id', 'receipt', 'income-type', 'memo']), ('Income', ['project', 'rt-id', 'receipt', 'income-type', 'memo']),
('Expenses:Payroll', ['project', 'rt-id', 'payroll-type', 'expense-type', 'receipt', 'approval']),
('Expenses', ['project', 'rt-id', 'receipt', 'approval', 'expense-type']), ('Expenses', ['project', 'rt-id', 'receipt', 'approval', 'expense-type']),
('Equity', ['project', 'rt-id']), ('Equity', ['project', 'rt-id']),
('Assets:Receivable', ['project', 'rt-id', 'invoice', 'approval', 'contract', 'purchase-order']), ('Assets:Receivable', ['project', 'rt-id', 'invoice', 'approval', 'contract', 'purchase-order']),

View file

@ -5,7 +5,7 @@ from setuptools import setup
setup( setup(
name='conservancy_beancount', name='conservancy_beancount',
description="Plugin, library, and reports for reading Conservancy's books", description="Plugin, library, and reports for reading Conservancy's books",
version='1.15.4', version='1.15.5',
author='Software Freedom Conservancy', author='Software Freedom Conservancy',
author_email='info@sfconservancy.org', author_email='info@sfconservancy.org',
license='GNU AGPLv3+', license='GNU AGPLv3+',

View file

@ -9,6 +9,8 @@
classification: "Accounts receivable" classification: "Accounts receivable"
2018-01-01 open Expenses:Other 2018-01-01 open Expenses:Other
classification: "Other expenses" classification: "Other expenses"
2018-01-01 open Expenses:Payroll
classification: "Payroll expenses"
2018-01-01 open Income:Other 2018-01-01 open Income:Other
classification: "Other income" classification: "Other income"
2018-01-01 open Liabilities:CreditCard 2018-01-01 open Liabilities:CreditCard

View file

@ -34,6 +34,7 @@ _ledger_load = bc_loader.load_file(testutil.test_path('books/ledger.beancount'))
DEFAULT_REPORT_SHEETS = [ DEFAULT_REPORT_SHEETS = [
'Balance', 'Balance',
'Income', 'Income',
'Expenses:Payroll',
'Expenses', 'Expenses',
'Equity', 'Equity',
'Assets:Receivable', 'Assets:Receivable',
@ -42,7 +43,9 @@ DEFAULT_REPORT_SHEETS = [
'Assets', 'Assets',
'Liabilities', 'Liabilities',
] ]
PROJECT_REPORT_SHEETS = DEFAULT_REPORT_SHEETS[:5] + [ PROJECT_REPORT_SHEETS = [
*DEFAULT_REPORT_SHEETS[:2],
*DEFAULT_REPORT_SHEETS[3:6],
'Assets:Prepaid', 'Assets:Prepaid',
'Liabilities:UnearnedIncome', 'Liabilities:UnearnedIncome',
'Liabilities:Payable', 'Liabilities:Payable',
@ -402,6 +405,11 @@ def test_account_names_report(ledger_entries, accounts, report_kwargs):
for account in iter_accounts(ledger_entries): for account in iter_accounts(ledger_entries):
if not account.startswith(accounts): if not account.startswith(accounts):
ExpectedPostings.check_not_in_report(report.document, account) ExpectedPostings.check_not_in_report(report.document, account)
# This account is reportable but has no postings
elif account == 'Expenses:Payroll':
ExpectedPostings.check_in_report(
report.document, account, START_DATE, STOP_DATE, txn_filter,
)
elif txn_filter is None: elif txn_filter is None:
expected[account].check_report(report.document, START_DATE, STOP_DATE) expected[account].check_report(report.document, START_DATE, STOP_DATE)
else: else: