summaryrefslogtreecommitdiff
path: root/contrib/non-profit-audit-reports/general-ledger-report.plx
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/non-profit-audit-reports/general-ledger-report.plx')
-rwxr-xr-xcontrib/non-profit-audit-reports/general-ledger-report.plx12
1 files changed, 10 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 5286d625..1c293db9 100755
--- a/contrib/non-profit-audit-reports/general-ledger-report.plx
+++ b/contrib/non-profit-audit-reports/general-ledger-report.plx
@@ -107,8 +107,16 @@ foreach my $acct (@sortedAccounts) {
close(GL_TEXT_DATA); die "error reading ledger output for chart of accounts: $!" unless $? == 0;
print GL_CSV_OUT "\n\"ACCOUNT:\",\"$acct\"\n\"PERIOD START:\",\"$beginDate\"\n\"PERIOD END:\",\"$formattedEndDate\"\n";
- print GL_CSV_OUT '"DATE","CHECK NUM","NAME","TRANSACTION AMT","RUNNING TOTAL","Receipt","Invoice"', "\n";
- @acctLedgerOpts = ('-F', '"%(date)","%C","%P","%t","%T","%(tag(\'Receipt\'))","%(tag(\'Invoice\'))"\n', '-w', '--sort', 'd', '-b', $beginDate, '-e', $endDate, @otherLedgerOpts, 'reg', $acct);
+ print GL_CSV_OUT '"DATE","CHECK NUM","NAME","TRANSACTION AMT","RUNNING TOTAL"';
+ my $formatString = '"%(date)","%C","%P","%t","%T"';
+ foreach my $tagField (qw/Receipt Invoice Statement Contract PurchaseOrder Approval Check IncomeDistributionAnalysis CurrencyRate/) {
+ print GL_CSV_OUT ',"', $tagField, '"';
+ $formatString .= ',"%(tag(\'' . $tagField . '\'))"';
+ }
+ $formatString .= "\n";
+ print GL_CSV_OUT "\n";
+
+ @acctLedgerOpts = ('-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: $!";