summaryrefslogtreecommitdiff
path: root/contrib/non-profit-audit-reports/general-ledger-report.plx
diff options
context:
space:
mode:
authorBradley M. Kuhn <bkuhn@ebb.org>2012-11-21 13:09:55 -0500
committerBradley M. Kuhn <bkuhn@ebb.org>2012-11-26 13:54:42 -0500
commit01dc0416b9262905e66887b29ccef31d2867b9df (patch)
tree5690c0d7a35c0187c74c26cb094cbc1741818fee /contrib/non-profit-audit-reports/general-ledger-report.plx
parent287a756ab6c7072349dee8818e9775d67c8847be (diff)
downloadfork-ledger-01dc0416b9262905e66887b29ccef31d2867b9df.tar.gz
fork-ledger-01dc0416b9262905e66887b29ccef31d2867b9df.tar.bz2
fork-ledger-01dc0416b9262905e66887b29ccef31d2867b9df.zip
Support a broader set of possible tags to be placed into the spreadsheet.
I've now made a hard-coded list of potential tags that are supported and will be linked to in the general ledger spreadsheet. This list should probably be in a configuration file of some sort eventually, rather than hard coded. Indeed, note that the hard-coding goes into two different scripts, and thus the lists could easily get out of sync.
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: $!";