summaryrefslogtreecommitdiff
path: root/contrib/non-profit-audit-reports
diff options
context:
space:
mode:
authorBradley M. Kuhn <bkuhn@ebb.org>2013-01-18 17:04:08 -0500
committerBradley M. Kuhn <bkuhn@ebb.org>2013-02-18 14:08:46 -0500
commitc0206418f730b0df45898dcf4280d9d96e801bb1 (patch)
tree7ece12a1ed6a853cba5cac9db0c47863b549f6d8 /contrib/non-profit-audit-reports
parent9fcdfc893c41447099169bf4ad51f5856db399a1 (diff)
downloadfork-ledger-c0206418f730b0df45898dcf4280d9d96e801bb1.tar.gz
fork-ledger-c0206418f730b0df45898dcf4280d9d96e801bb1.tar.bz2
fork-ledger-c0206418f730b0df45898dcf4280d9d96e801bb1.zip
Correct regular expression for account queries to avoid inclusion of sub-accounts.
The previous queries had a bug whereby an account in the form "A:B" would include all transactions for sub accounts such as "A:B:C". That's not the intended effect. Entries should appear in the lowest level account, and not in their parent. The regular expression now is anchored at start and finish in both queries to ensure this works correctly.
Diffstat (limited to 'contrib/non-profit-audit-reports')
-rwxr-xr-xcontrib/non-profit-audit-reports/general-ledger-report.plx4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/non-profit-audit-reports/general-ledger-report.plx b/contrib/non-profit-audit-reports/general-ledger-report.plx
index 1fd0e7ce..1e6d9caf 100755
--- a/contrib/non-profit-audit-reports/general-ledger-report.plx
+++ b/contrib/non-profit-audit-reports/general-ledger-report.plx
@@ -166,7 +166,7 @@ foreach my $acct (@sortedAccounts) {
print GL_TEXT_OUT "\n\nACCOUNT: $acct\nFROM: $beginDate TO $formattedEndDate\n\n";
my @acctLedgerOpts = ('-V', '-F',
"%(date) %-.10C %-.80P %-.80N %18t %18T\n", '-w', '--sort', 'd',
- '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg', $acct);
+ '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg', '/^' . $acct . '$/');
open(GL_TEXT_DATA, "-|", $LEDGER_CMD, @acctLedgerOpts)
or die "Unable to run $LEDGER_CMD @acctLedgerOpts: $!";
@@ -190,7 +190,7 @@ foreach my $acct (@sortedAccounts) {
print GL_CSV_OUT "\"$formattedBeginDate\"", ',"","BALANCE","","$', "$balanceData{totalBegin}{$acct}\"\n";
}
- @acctLedgerOpts = ('-V', '-F', $formatString, '-w', '--sort', 'd', '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg', $acct);
+ @acctLedgerOpts = ('-V', '-F', $formatString, '-w', '--sort', 'd', '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg', '/^' . $acct . '$/');
open(GL_CSV_DATA, "-|", $LEDGER_CMD, @acctLedgerOpts)
or die "Unable to run $LEDGER_CMD @acctLedgerOpts: $!";