From 8ebb54638ca8a57b15126cb11fd6329faf639be5 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Thu, 10 Jan 2013 11:25:19 -0500 Subject: Start search from date: easy way to resume searches. Instead of always starting a search from the end date, allow a CLI option that is the data to use for the start of searching (back from the end date). This is useful when resuming a search (since they take a long time). --- contrib/non-profit-audit-reports/bank-reconcilation.plx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'contrib/non-profit-audit-reports') diff --git a/contrib/non-profit-audit-reports/bank-reconcilation.plx b/contrib/non-profit-audit-reports/bank-reconcilation.plx index ada923f3..701f053e 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 < 5) { - print STDERR "usage: $0 [-d] <ACCOUNT_REGEX> <END_DATE> <BANK_STATEMENT_BALANCE> <LEDGER_OPTIONS>\n"; +if (@ARGV < 6) { + print STDERR "usage: $0 [-d] <TITLE> <ACCOUNT_REGEX> <END_DATE> <START_SEARCH_FROM_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, $bankBalance, @mainLedgerOptions) = @ARGV; +my($title, $account, $endDate, $startSearchFromDate, $bankBalance, @mainLedgerOptions) = @ARGV; $bankBalance = ParseNumber($bankBalance); @@ -166,7 +166,7 @@ my $earliestStartDate = DateCalc(ParseDate($endDate), ParseDateDelta("- 1 month" die "Date calculation error on $endDate" if ($err); -my $startDate = ParseDate($endDate); +my $startDate = ParseDate($startSearchFromDate); my @solution; while ($startDate ge $earliestStartDate) { @@ -179,7 +179,7 @@ while ($startDate ge $earliestStartDate) { print STDERR "Testing $formattedStartDate through $endDate: \n" if $VERBOSE; my(@fullCommand) = ($LEDGER_BIN, @mainLedgerOptions, '-V', '-X', '$', - '-b', $formattedStartDate, '-e', $endDate, + '-b', $formattedStartDate, '-e', $startSearchFromDate, '-F', '"%(date)","%C","%P","%t"\n', 'reg', "/$account/"); -- cgit v1.2.3