From cccd0b7cd38a88c131e19981be38434f87abe194 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 21 Oct 2005 15:21:37 +0000 Subject: add CASH and WEST payment types (payments only, not cust_main.payby) --- httemplate/search/cust_pay.cgi | 43 ++++++++++++++++++++++++++++++---- httemplate/search/report_cust_pay.html | 6 ++++- 2 files changed, 44 insertions(+), 5 deletions(-) (limited to 'httemplate/search') diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi index 89da7426a..2106a649a 100755 --- a/httemplate/search/cust_pay.cgi +++ b/httemplate/search/cust_pay.cgi @@ -16,14 +16,27 @@ } if ( $cgi->param('payby') ) { - $cgi->param('payby') =~ /^(CARD|CHEK|BILL)(-(VisaMC|Amex|Discover))?$/ - or die "illegal payby ". $cgi->param('payby'); + $cgi->param('payby') =~ + /^(CARD|CHEK|BILL|PREP|CASH|WEST)(-(VisaMC|Amex|Discover|Maestro))?$/ + or die "illegal payby ". $cgi->param('payby'); push @search, "cust_pay.payby = '$1'"; if ( $3 ) { if ( $3 eq 'VisaMC' ) { #avoid posix regexes for portability push @search, - " ( substring(cust_pay.payinfo from 1 for 1) = '4' ". + " ( ( substring(cust_pay.payinfo from 1 for 1) = '4' ". + " AND substring(cust_pay.payinfo from 1 for 4) != '4936' ". + " AND substring(cust_pay.payinfo from 1 for 6) ". + " NOT SIMILAR TO '49030[2-9]' ". + " AND substring(cust_pay.payinfo from 1 for 6) ". + " NOT SIMILAR TO '49033[5-9]' ". + " AND substring(cust_pay.payinfo from 1 for 6) ". + " NOT SIMILAR TO '49110[1-2]' ". + " AND substring(cust_pay.payinfo from 1 for 6) ". + " NOT SIMILAR TO '49117[4-9]' ". + " AND substring(cust_pay.payinfo from 1 for 6) ". + " NOT SIMILAR TO '49118[1-2]' ". + " )". " OR substring(cust_pay.payinfo from 1 for 2) = '51' ". " OR substring(cust_pay.payinfo from 1 for 2) = '52' ". " OR substring(cust_pay.payinfo from 1 for 2) = '53' ". @@ -38,7 +51,25 @@ " ) "; } elsif ( $3 eq 'Discover' ) { push @search, - " substring(cust_pay.payinfo from 1 for 4 ) = '6011' "; + " substring(cust_pay.payinfo from 1 for 4 ) = '6011' ". + " OR substring(cust_pay.payinfo from 1 for 3 ) = '650' "; + } elsif ( $3 eq 'Maestro' ) { + push @search, + " ( substring(cust_pay.payinfo from 1 for 2 ) = '63' ". + ' OR substring(cust_pay.payinfo from 1 for 2 ) = '67' ". + ' OR substring(cust_pay.payinfo from 1 for 6 ) = '564182' ". + " OR substring(cust_pay.payinfo from 1 for 4 ) = '4936' ". + " OR substring(cust_pay.payinfo from 1 for 6 ) ". + " SIMILAR TO '49030[2-9]' ". + " OR substring(cust_pay.payinfo from 1 for 6 ) ". + " SIMILAR TO '49033[5-9]' ". + " OR substring(cust_pay.payinfo from 1 for 6 ) ". + " SIMILAR TO '49110[1-2]' ". + " OR substring(cust_pay.payinfo from 1 for 6 ) ". + " SIMILAR TO '49117[4-9]' ". + " OR substring(cust_pay.payinfo from 1 for 6 ) ". + " SIMILAR TO '49118[1-2]' ". + " ) "; } else { die "unknown card type $3"; } @@ -134,6 +165,10 @@ 'Check #'. $cust_pay->payinfo; } elsif ( $cust_pay->payby eq 'PREP' ) { 'Prepaid card #'. $cust_pay->payinfo; + } elsif ( $cust_pay->payby eq 'CASH' ) { + 'Cash '. $cust_pay->payinfo; + } elsif ( $cust_pay->payby eq 'WEST' ) { + 'Western Union'; #. $cust_pay->payinfo; } else { $cust_pay->payby. ' '. $cust_pay->payinfo; } diff --git a/httemplate/search/report_cust_pay.html b/httemplate/search/report_cust_pay.html index 8b9e27302..18501d5b5 100644 --- a/httemplate/search/report_cust_pay.html +++ b/httemplate/search/report_cust_pay.html @@ -19,8 +19,12 @@ + - + + + + -- cgit v1.2.1