summaryrefslogtreecommitdiff
path: root/contrib/non-profit-audit-reports
diff options
context:
space:
mode:
authorBradley M. Kuhn <bkuhn@ebb.org>2012-11-23 08:48:32 -0500
committerBradley M. Kuhn <bkuhn@ebb.org>2012-11-26 13:54:45 -0500
commit23dd0899f2634cad221b1859f127a0a6c96d62a2 (patch)
tree7cc715f913b57d97efca668d15dfde1d083c33d1 /contrib/non-profit-audit-reports
parentccd5d06c04576bbd3911d4ce0c9ccb8c4ec4cfc5 (diff)
downloadfork-ledger-23dd0899f2634cad221b1859f127a0a6c96d62a2.tar.gz
fork-ledger-23dd0899f2634cad221b1859f127a0a6c96d62a2.tar.bz2
fork-ledger-23dd0899f2634cad221b1859f127a0a6c96d62a2.zip
Allow for one penny margin of error on totals.
Diffstat (limited to 'contrib/non-profit-audit-reports')
-rwxr-xr-xcontrib/non-profit-audit-reports/summary-reports.plx15
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/non-profit-audit-reports/summary-reports.plx b/contrib/non-profit-audit-reports/summary-reports.plx
index 14923a42..875f89be 100755
--- a/contrib/non-profit-audit-reports/summary-reports.plx
+++ b/contrib/non-profit-audit-reports/summary-reports.plx
@@ -44,6 +44,7 @@ sub ParseNumber($) {
}
Math::BigFloat->precision(-2);
my $ZERO = Math::BigFloat->new("0.00");
+my $ONE_PENNY = Math::BigFloat->new("0.01");
if (@ARGV < 2) {
print STDERR "usage: $0 <START_DATE> <END_DATE> <LEDGER_OPTIONS>\n";
@@ -153,20 +154,20 @@ print STDERR "\n";
die "unable to write to Assets-and-liabilities.txt: $!" unless ($? == 0);
die "Cash+accounts receivable total does not equal net assets and liabilities total"
- if ( ($reportFields{'Cash'}{total} + $reportFields{'Accounts Receivable'}{total}
- + $reportFields{'Loans Receivable'}{total}) !=
- ($reportFields{'Accounts Payable'}{total} +
+ if (abs( ($reportFields{'Cash'}{total} + $reportFields{'Accounts Receivable'}{total}
+ + $reportFields{'Loans Receivable'}{total})) -
+ abs($reportFields{'Accounts Payable'}{total} +
$reportFields{'Accrued Expenses'}{total} +
$reportFields{'Unearned Income, Conference Registration'}{total} +
$reportFields{'Unearned Income, Other'}{total} +
$reportFields{'Liabilities, Credit Cards'}{total} +
$reportFields{'Liabilities, Other'}{total} +
- $reportFields{'Total Net Assets'}{total}));
+ $reportFields{'Total Net Assets'}{total}) > $ONE_PENNY);
die "Total net assets doesn't equal sum of restricted and unrestricted ones!"
- if ($reportFields{'Total Net Assets'}{total} !=
- $reportFields{'Unrestricted Net Assets'}{total} +
- $reportFields{'Temporarily Restricted Net Assets'}{total});
+ if (abs($reportFields{'Total Net Assets'}{total}) -
+ abs($reportFields{'Unrestricted Net Assets'}{total} +
+ $reportFields{'Temporarily Restricted Net Assets'}{total}) > $ONE_PENNY);
###############################################################################
#