From 8908b032341eaa18c81c43a4792a84cdac05fe36 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Fri, 12 Jul 2013 14:26:29 -0400 Subject: Use "ledger accounts" command rather than the '-F "%150A\n" reg' report solution. Ledger has had (probably for some time) an "accounts" command that will list all the accounts from all transactions meeting the other criteria set on the command line. That's really what we're looking for here when we build this chart of accounts, and thus that should be used. Note that this corrects a subtle bug that wasn't apparent with the old solution. With the '-F "%150A\n" reg' solution, accounts that balanced out to zero for period (e.g., accrual accounts that were emptied during in the month) did not show up on the reports. This bug that I didn't know I had here is thus now fixed by switching to the "accounts" report. --- .../cash-receipts-and-disbursments-journals.plx | 3 +-- contrib/non-profit-audit-reports/general-ledger-report.plx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx b/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx index 6234542c..937d2a45 100755 --- a/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx +++ b/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx @@ -67,8 +67,7 @@ if (@ARGV < 2) { my($beginDate, $endDate, @otherLedgerOpts) = @ARGV; -my(@chartOfAccountsOpts) = ('-V', '-F', "%150A\n", '-w', '-s', - '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg'); +my(@chartOfAccountsOpts) = ('-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'accounts'); open(CHART_DATA, "-|", $LEDGER_CMD, @chartOfAccountsOpts) or die "Unable to run $LEDGER_CMD @chartOfAccountsOpts: $!"; diff --git a/contrib/non-profit-audit-reports/general-ledger-report.plx b/contrib/non-profit-audit-reports/general-ledger-report.plx index 0d6b28e6..4a4f89cc 100755 --- a/contrib/non-profit-audit-reports/general-ledger-report.plx +++ b/contrib/non-profit-audit-reports/general-ledger-report.plx @@ -62,8 +62,7 @@ die "badly formatted end date, $beginDate" if $formattedBeginDate->parse($beginD $formattedBeginDate = $formattedBeginDate->printf("%Y/%m/%d"); -my(@chartOfAccountsOpts) = ('-V', '-F', "%150A\n", '-w', '-s', - '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg'); +my(@chartOfAccountsOpts) = ('-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'accounts'); open(CHART_DATA, "-|", $LEDGER_CMD, @chartOfAccountsOpts) or die "Unable to run $LEDGER_CMD @chartOfAccountsOpts: $!"; -- cgit v1.2.3