summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorBradley M. Kuhn <bkuhn@ebb.org>2013-01-10 11:25:19 -0500
committerBradley M. Kuhn <bkuhn@ebb.org>2013-02-18 14:08:45 -0500
commit8ebb54638ca8a57b15126cb11fd6329faf639be5 (patch)
tree19060348085006c3eb2c386ec40204282def5d53 /contrib
parent94094ce3650e26e584b68f3c0d94d593732dc3bc (diff)
downloadfork-ledger-8ebb54638ca8a57b15126cb11fd6329faf639be5.tar.gz
fork-ledger-8ebb54638ca8a57b15126cb11fd6329faf639be5.tar.bz2
fork-ledger-8ebb54638ca8a57b15126cb11fd6329faf639be5.zip
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).
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/non-profit-audit-reports/bank-reconcilation.plx10
1 files changed, 5 insertions, 5 deletions
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] <TITLE> <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/");