summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2005-10-21 15:21:37 +0000
committerivan <ivan>2005-10-21 15:21:37 +0000
commitcccd0b7cd38a88c131e19981be38434f87abe194 (patch)
treeddd0960706fcefdf495fe23178f0479b954093ee /httemplate/search
parenta4fcab2fecfce70e38c7f150e5a870a0f60d1136 (diff)
add CASH and WEST payment types (payments only, not cust_main.payby)
Diffstat (limited to 'httemplate/search')
-rwxr-xr-xhttemplate/search/cust_pay.cgi43
-rw-r--r--httemplate/search/report_cust_pay.html6
2 files changed, 44 insertions, 5 deletions
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 @@
<OPTION VALUE="CARD-VisaMC">credit card (Visa/MasterCard)</OPTION>
<OPTION VALUE="CARD-Amex">credit card (American Express)</OPTION>
<OPTION VALUE="CARD-Discover">credit card (Discover)</OPTION>
+ <OPTION VALUE="CARD-Maestro">credit card (Maestro/Switch/Solo)</OPTION>
<OPTION VALUE="CHEK">electronic check / ACH</OPTION>
- <OPTION VALUE="BILL">check / cash</OPTION>
+ <OPTION VALUE="BILL">check</OPTION>
+ <OPTION VALUE="PREP">prepaid card</OPTION>
+ <OPTION VALUE="CASH">cash</OPTION>
+ <OPTION VALUE="WEST">Western Union</OPTION>
</SELECT>
</TD>
</TR>