[freeside-commits] freeside/httemplate/search report_cust_pay.html, 1.7, 1.8 cust_pay.cgi, 1.20, 1.21

Ivan,,, ivan at wavetail.420.am
Fri Oct 21 08:21:39 PDT 2005


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv1308/httemplate/search

Modified Files:
	report_cust_pay.html cust_pay.cgi 
Log Message:
add CASH and WEST payment types (payments only, not cust_main.payby)


Index: report_cust_pay.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_cust_pay.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- report_cust_pay.html	6 Mar 2005 03:04:29 -0000	1.7
+++ report_cust_pay.html	21 Oct 2005 15:21:37 -0000	1.8
@@ -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>

Index: cust_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pay.cgi,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cust_pay.cgi	10 Oct 2005 12:20:57 -0000	1.20
+++ cust_pay.cgi	21 Oct 2005 15:21:37 -0000	1.21
@@ -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;
                      }



More information about the freeside-commits mailing list