summaryrefslogtreecommitdiff
path: root/contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx')
-rwxr-xr-xcontrib/non-profit-audit-reports/cash-receipts-and-disbursments-journals.plx6
1 files changed, 6 insertions, 0 deletions
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 cb19a19e..58cc75a9 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
@@ -64,6 +64,8 @@ open(CHART_DATA, "-|", $LEDGER_CMD, @chartOfAccountsOpts)
my @accounts;
while (my $line = <CHART_DATA>) {
chomp $line;
+ next if $line =~ /^\s*\<\s*Adjustment\s*\>\s*$/;
+ next if $line =~ /^Equity:/; # Stupid auto-account made by ledger.
$line =~ s/^\s*//; $line =~ s/\s*$//;
push(@accounts, $line);
@@ -127,6 +129,10 @@ foreach my $typeData ({ name => 'disbursements', query => 'a<=0' },
while (my $line = <CSV_DATA>) {
$line =~ s/"link:"/""/g;
+ # Skip lines that have Adjustment or Equity: in them.
+ next if $line =~
+ /^\s*"[^"]*","[^"]*","[^"]*","(\s*\<\s*Adjustment\s*\>\s*|Equity:)/;
+
my $date = $line; chomp $date;
$date =~ s/^\s*"([^"]*)"\s*,.*$/$1/;
if (defined $date and $date !~ /^\s*$/ and