diff options
author | ivan <ivan> | 2009-03-24 09:42:13 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-03-24 09:42:13 +0000 |
commit | 48d92203f94f5592f1face92e3f1c74acf306a11 (patch) | |
tree | 82309e9767a2e00916e1bbefadd2d4eda29428ac /bin/countdeclines | |
parent | 5bc96f1f56a0549bcf2cebdea0ad4bcae815d021 (diff) |
quick tool for RT#3843
Diffstat (limited to 'bin/countdeclines')
-rwxr-xr-x | bin/countdeclines | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/countdeclines b/bin/countdeclines new file mode 100755 index 000000000..bbc392560 --- /dev/null +++ b/bin/countdeclines @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use Date::Parse; + +my $e = 'PlugnPay error: 97: Declined for CVV failure'; +my @y = (2008,2009); + +my $p = 0; + +foreach my $y (@y) { + foreach my $m (1..12) { + my $d = "$m/1/$y"; + my $t = str2time($d); + + #print "$pd-$d: SELECT count(*) from cust_bill_event where statustext = '$e' and _date >= $p and _date < $t;\n" + print "SELECT count(*) from cust_bill_event where statustext = '$e' and _date >= $p and _date < $t;\n" + if $p; + + $p = $t; + $pd = $d; + } +} |