summaryrefslogtreecommitdiff
path: root/httemplate/search/cust_pay.cgi
diff options
context:
space:
mode:
authorivan <ivan>2005-03-30 01:18:47 +0000
committerivan <ivan>2005-03-30 01:18:47 +0000
commit5aac758096514bfcb94f7e8479e817e3ee39d341 (patch)
tree7706257d745097aa279bed8839f3f0166ee947e7 /httemplate/search/cust_pay.cgi
parent36939d45fbe729c953a81354030bedcb17fad91f (diff)
fix ambiguous column error when selecting by credit card, fixes: Bug#1189
Diffstat (limited to 'httemplate/search/cust_pay.cgi')
-rwxr-xr-xhttemplate/search/cust_pay.cgi27
1 files changed, 15 insertions, 12 deletions
diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi
index 01a2ed95a..c23653aa9 100755
--- a/httemplate/search/cust_pay.cgi
+++ b/httemplate/search/cust_pay.cgi
@@ -19,20 +19,23 @@
if ( $3 ) {
if ( $3 eq 'VisaMC' ) {
#avoid posix regexes for portability
- push @search, " ( substring(payinfo from 1 for 1) = '4' ".
- " OR substring(payinfo from 1 for 2) = '51' ".
- " OR substring(payinfo from 1 for 2) = '52' ".
- " OR substring(payinfo from 1 for 2) = '53' ".
- " OR substring(payinfo from 1 for 2) = '54' ".
- " OR substring(payinfo from 1 for 2) = '54' ".
- " OR substring(payinfo from 1 for 2) = '55' ".
- " ) ";
+ push @search,
+ " ( substring(cust_pay.payinfo from 1 for 1) = '4' ".
+ " 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' ".
+ " OR substring(cust_pay.payinfo from 1 for 2) = '54' ".
+ " OR substring(cust_pay.payinfo from 1 for 2) = '54' ".
+ " OR substring(cust_pay.payinfo from 1 for 2) = '55' ".
+ " ) ";
} elsif ( $3 eq 'Amex' ) {
- push @search, " ( substring(payinfo from 1 for 2 ) = '34' ".
- " OR substring(payinfo from 1 for 2 ) = '37' ".
- " ) ";
+ push @search,
+ " ( substring(cust_pay.payinfo from 1 for 2 ) = '34' ".
+ " OR substring(cust_pay.payinfo from 1 for 2 ) = '37' ".
+ " ) ";
} elsif ( $3 eq 'Discover' ) {
- push @search, " substring(payinfo from 1 for 4 ) = '6011' ";
+ push @search,
+ " substring(cust_pay.payinfo from 1 for 4 ) = '6011' ";
} else {
die "unknown card type $3";
}