diff options
author | Bradley M. Kuhn <bkuhn@ebb.org> | 2013-01-27 20:24:34 -0500 |
---|---|---|
committer | Bradley M. Kuhn <bkuhn@ebb.org> | 2013-02-18 14:08:46 -0500 |
commit | afe912f163da2259f29bfd3ac3f5bfbc50190156 (patch) | |
tree | 74d07eaaf27ee054ea467d018c921f06c05b7e11 /contrib | |
parent | 11639785bba1b97600e9b06a85be248e8d2d7688 (diff) | |
download | fork-ledger-afe912f163da2259f29bfd3ac3f5bfbc50190156.tar.gz fork-ledger-afe912f163da2259f29bfd3ac3f5bfbc50190156.tar.bz2 fork-ledger-afe912f163da2259f29bfd3ac3f5bfbc50190156.zip |
Searching is better when you can set the begin date, end date and then go back from begin date.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/non-profit-audit-reports/bank-reconcilation.plx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/non-profit-audit-reports/bank-reconcilation.plx b/contrib/non-profit-audit-reports/bank-reconcilation.plx index 5b8d3d6f..2a3d0d38 100755 --- a/contrib/non-profit-audit-reports/bank-reconcilation.plx +++ b/contrib/non-profit-audit-reports/bank-reconcilation.plx @@ -125,8 +125,8 @@ my $firstArg = shift @ARGV; my $solver = \&BruteForceSubSetSumSolver; -if (@ARGV < 6) { - print STDERR "usage: $0 [-d] <TITLE> <ACCOUNT_REGEX> <END_DATE> <START_SEARCH_FROM_DATE> <BANK_STATEMENT_BALANCE> <LEDGER_OPTIONS>\n"; +if (@ARGV < 7) { + print STDERR "usage: $0 [-d] <TITLE> <ACCOUNT_REGEX> <END_DATE> <START_SEARCH_FROM_DATE> <END_SEARCH_TO_DATE> <BANK_STATEMENT_BALANCE> <LEDGER_OPTIONS>\n"; exit 1; } if ($firstArg eq '-d') { @@ -134,7 +134,7 @@ if ($firstArg eq '-d') { } else { unshift(@ARGV, $firstArg); } -my($title, $account, $endDate, $startSearchFromDate, $bankBalance, @mainLedgerOptions) = @ARGV; +my($title, $account, $endDate, $startSearchFromDate, $endSearchToDate, $bankBalance, @mainLedgerOptions) = @ARGV; $bankBalance = ParseNumber($bankBalance); @@ -170,16 +170,16 @@ my $startDate = ParseDate($startSearchFromDate); my @solution; while ($startDate ge $earliestStartDate) { - print STDERR "START LOOP ITR: $startDate $earliestStartDate\n" if ($VERBOSE); $startDate = DateCalc(ParseDate($startDate), ParseDateDelta("- 1 day"), \$err); die "Date calculation error on $endDate" if ($err); my $formattedStartDate = UnixDate($startDate, "%Y-%m-%d"); - print STDERR "Testing $formattedStartDate through $endDate: \n" if $VERBOSE; + print STDERR "Testing $formattedStartDate through $endSearchToDate for a total of ", Commify($differenceSought), ": \n" + if $VERBOSE; my(@fullCommand) = ($LEDGER_BIN, @mainLedgerOptions, '-V', '-X', '$', - '-b', $formattedStartDate, '-e', $startSearchFromDate, + '-b', $formattedStartDate, '-e', $endSearchToDate, '-F', '"%(date)","%C","%P","%t"\n', 'reg', "/$account/"); |