[freeside-commits] branch master updated. 8d953e7c2f94dc007d94da74650d27c5a74cc792

Ivan ivan at 420.am
Sun Jan 25 21:44:57 PST 2015


The branch, master has been updated
       via  8d953e7c2f94dc007d94da74650d27c5a74cc792 (commit)
       via  446fb74f2f31d48dd303c9a52105d40f11079e10 (commit)
      from  7b777a5bf7fcdb0f966e3789e00f646febedc60c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8d953e7c2f94dc007d94da74650d27c5a74cc792
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jan 25 21:44:54 2015 -0800

    manual echeck payment type, RT#26995

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index e584f00..39f12c2 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2622,7 +2622,7 @@ and customer address. Include units.',
     'section'     => 'billing',
     'description' => 'Available payment types.',
     'type'        => 'selectmultiple',
-    'select_enum' => [ qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD PPAL COMP) ],
+    'select_enum' => [ qw(CARD DCRD CHEK DCHK BILL CASH WEST MCRD MCHK PPAL COMP) ],
   },
 
   {
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 294546c..9f95620 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -400,7 +400,7 @@ sub insert {
 
     $payby = 'PREP' if $amount;
 
-  } elsif ( $self->payby =~ /^(CASH|WEST|MCRD|PPAL)$/ ) {
+  } elsif ( $self->payby =~ /^(CASH|WEST|MCRD|MCHK|PPAL)$/ ) {
 
     $payby = $1;
     $self->payby('BILL');
@@ -3074,6 +3074,7 @@ Old-style:
 
 =cut
 
+#super false laziness w/quotation::charge
 sub charge {
   my $self = shift;
   my ( $amount, $setup_cost, $quantity, $start_date, $classnum );
diff --git a/FS/FS/payby.pm b/FS/FS/payby.pm
index 197d499..c4aa1b1 100644
--- a/FS/FS/payby.pm
+++ b/FS/FS/payby.pm
@@ -113,6 +113,12 @@ tie %hash, 'Tie::IxHash',
     longname  => 'Manual credit card', 
     cust_main => 'BILL', #this is a payment type only, customers go to BILL...
   },
+  'MCHK' => { #not the same as DCHK
+    tinyname  => 'card',
+    shortname => 'Manual electronic check', # initial payment, then billing
+    longname  => 'Manual electronic check', 
+    cust_main => 'BILL', #this is a payment type only, customers go to BILL...
+  },
   'APPL' => {
     tinyname  => 'apple store',
     shortname => 'Apple Store',
@@ -207,7 +213,9 @@ sub longname {
 %payby2bop = (
   'CARD' => 'CC',
   'CHEK' => 'ECHECK',
-  'MCRD' => 'CC',
+  'MCRD' => 'CC', #?  but doesn't MCRD mean _offline_ card?  i think it got
+                  # overloaded for third-party card payments -- but no one is
+                  # doing those other than paypal now
   'PPAL' => 'PAYPAL',
 );
 
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index e14c589..c66e3bc 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -38,14 +38,15 @@ For Customers (cust_main):
 For Refunds (cust_refund):
 'CARD' (credit cards), 'CHEK' (electronic check/ACH),
 'LECB' (Phone bill billing), 'BILL' (billing), 'CASH' (cash),
-'WEST' (Western Union), 'MCRD' (Manual credit card), 'CBAK' Chargeback, or 'COMP' (free)
+'WEST' (Western Union), 'MCRD' (Manual credit card), 'MCHK' (Manual electronic
+check), 'CBAK' Chargeback, or 'COMP' (free)
 
 
 For Payments (cust_pay):
 'CARD' (credit cards), 'CHEK' (electronic check/ACH),
 'LECB' (phone bill billing), 'BILL' (billing), 'PREP' (prepaid card),
-'CASH' (cash), 'WEST' (Western Union), 'MCRD' (Manual credit card),
-'PPAL' (PayPal)
+'CASH' (cash), 'WEST' (Western Union), 'MCRD' (Manual credit card), 'MCHK'
+(Manual electronic check), 'PPAL' (PayPal)
 'COMP' (free) is depricated as a payment type in cust_pay
 
 =cut 
@@ -129,7 +130,11 @@ sub mask_payinfo {
     return 'N/A (tokenized)'; #?
   } else { # if not, mask it...
 
-    if ($payby eq 'CARD' || $payby eq 'DCRD' || $payby eq 'MCRD') {
+    if ($payby eq 'CARD' || $payby eq 'DCRD') {
+                                                #|| $payby eq 'MCRD') {
+                                                #MCRD isn't a card in payinfo,
+                                                #its a record of an _offline_
+                                                #card
 
       # Credit Cards
 
@@ -177,23 +182,6 @@ sub mask_payinfo {
 
 Checks payby and payinfo.
 
-For Customers (cust_main):
-'CARD' (credit card - automatic), 'DCRD' (credit card - on-demand),
-'CHEK' (electronic check - automatic), 'DCHK' (electronic check - on-demand),
-'LECB' (Phone bill billing), 'BILL' (billing), 'COMP' (free), or
-'PREPAY' (special billing type: applies a credit - see L<FS::prepay_credit> and sets billing type to I<BILL>)
-
-For Refunds (cust_refund):
-'CARD' (credit cards), 'CHEK' (electronic check/ACH),
-'LECB' (Phone bill billing), 'BILL' (billing), 'CASH' (cash),
-'WEST' (Western Union), 'MCRD' (Manual credit card), 'CBAK' (Chargeback),  or 'COMP' (free)
-
-For Payments (cust_pay):
-'CARD' (credit cards), 'CHEK' (electronic check/ACH),
-'LECB' (phone bill billing), 'BILL' (billing), 'PREP' (prepaid card),
-'CASH' (cash), 'WEST' (Western Union), or 'MCRD' (Manual credit card)
-'COMP' (free) is depricated as a payment type in cust_pay
-
 =cut
 
 sub payinfo_check {
@@ -276,6 +264,8 @@ sub payby_payinfo_pretty {
     $lh->maketext('Western Union');
   } elsif ( $self->payby eq 'MCRD' ) {
     $lh->maketext('Manual credit card');
+  } elsif ( $self->payby eq 'MCHK' ) {
+    $lh->maketext('Manual electronic check');
   } elsif ( $self->payby eq 'EDI' ) {
     $lh->maketext('EDI') . ' ' . $self->paymask;
   } elsif ( $self->payby eq 'PPAL' ) {
diff --git a/httemplate/edit/cust_refund.cgi b/httemplate/edit/cust_refund.cgi
index f9095fd..fa049a3 100755
--- a/httemplate/edit/cust_refund.cgi
+++ b/httemplate/edit/cust_refund.cgi
@@ -140,7 +140,7 @@ my $reason  = $cgi->param('reason');
 my $link    = $cgi->param('popup') ? 'popup' : '';
 
 my @rights = ();
-push @rights, 'Post refund'                if $payby =~ /^(BILL|CASH|MCRD)$/;
+push @rights, 'Post refund'                if $payby =~ /^(BILL|CASH|MCRD|MCHK)$/;
 push @rights, 'Post check refund'          if $payby eq 'BILL';
 push @rights, 'Post cash refund '          if $payby eq 'CASH';
 push @rights, 'Refund payment'             if $payby =~ /^(CARD|CHEK)$/;
diff --git a/httemplate/edit/process/cust_refund.cgi b/httemplate/edit/process/cust_refund.cgi
index 599c8b8..52fede8 100755
--- a/httemplate/edit/process/cust_refund.cgi
+++ b/httemplate/edit/process/cust_refund.cgi
@@ -31,7 +31,7 @@ my $link    = $cgi->param('popup') ? 'popup' : '';
 my $payby = $cgi->param('payby');
 
 my @rights = ();
-push @rights, 'Post refund'                if $payby =~ /^(BILL|CASH|MCRD)$/;
+push @rights, 'Post refund'                if $payby =~ /^(BILL|CASH|MCRD|MCHK)$/;
 push @rights, 'Post check refund'          if $payby eq 'BILL';
 push @rights, 'Post cash refund '          if $payby eq 'CASH';
 push @rights, 'Refund payment'             if $payby =~ /^(CARD|CHEK)$/;
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html
index b5172fb..7bebe7f 100755
--- a/httemplate/search/elements/cust_pay_or_refund.html
+++ b/httemplate/search/elements/cust_pay_or_refund.html
@@ -271,7 +271,7 @@ if ( $cgi->param('magic') ) {
       foreach my $payby ( $cgi->param('payby') ) {
 
         $payby =~
-          /^(CARD|CHEK|BILL|CASH|PPAL|APPL|ANRD|PREP|WIRE|WEST|EDI|MCRD)(-(VisaMC|Amex|Discover|Maestro|Tokenized))?$/
+          /^(CARD|CHEK|BILL|CASH|PPAL|APPL|ANRD|PREP|WIRE|WEST|EDI|MCRD|MCHK)(-(VisaMC|Amex|Discover|Maestro|Tokenized))?$/
             or die "illegal payby $payby";
 
         my $payby_search = "$table.payby = '$1'";
diff --git a/httemplate/search/elements/report_cust_pay_or_refund.html b/httemplate/search/elements/report_cust_pay_or_refund.html
index 3026605..9c4ca27 100644
--- a/httemplate/search/elements/report_cust_pay_or_refund.html
+++ b/httemplate/search/elements/report_cust_pay_or_refund.html
@@ -53,6 +53,7 @@ Examples:
         <OPTION VALUE="WEST" SELECTED><% mt('Western Union') |h %></OPTION>
         <OPTION VALUE="EDI" SELECTED><% mt('Electronic Debit (EDI)') |h %></OPTION>
         <OPTION VALUE="MCRD" SELECTED><% mt('manual credit card') |h %></OPTION>
+        <OPTION VALUE="MCHK" SELECTED><% mt('manual electronic check') |h %></OPTION>
       </SELECT>
     </TD>
   </TR>
diff --git a/httemplate/search/report_h_cust_pay.html b/httemplate/search/report_h_cust_pay.html
index 5c7f27a..13b7ff3 100644
--- a/httemplate/search/report_h_cust_pay.html
+++ b/httemplate/search/report_h_cust_pay.html
@@ -54,6 +54,7 @@
         <OPTION VALUE="CASH">cash</OPTION>
         <OPTION VALUE="WEST">Western Union</OPTION>
         <OPTION VALUE="MCRD">manual credit card</OPTION>
+        <OPTION VALUE="MCHK">manual electronic check</OPTION>
       </SELECT>
     </TD>
   </TR>
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
index 3440304..27376d5 100755
--- a/httemplate/view/cust_bill.cgi
+++ b/httemplate/view/cust_bill.cgi
@@ -25,7 +25,7 @@
 % }
 
 % if ( $cust_bill->owed > 0
-%      && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) )
+%      && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD MCHK) )
 %      && $curuser->access_right(['Post payment', 'Post check payment', 'Post cash payment'])
 %      && ! $conf->exists('pkg-balances')
 %    )
@@ -54,6 +54,11 @@
           <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCRD;invnum=<% $invnum %>"><% mt('manual credit card') |h %></A>
 %     } 
 
+%     if ( $payby{'MCHK'} && $curuser->access_right(['Post payment']) ) { 
+          <% $s++ ? ' | ' : '' %>
+          <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCHK;invnum=<% $invnum %>"><% mt('manual electronic check') |h %></A>
+%     } 
+
       <% mt('payment against this invoice') |h %><BR><BR>
 
 % } 
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index a8f2f86..0aacb0a 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -58,6 +58,11 @@
   <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCRD;custnum=<% $custnum %>"><% mt('Post manual (offline/POS) credit card payment') |h %></A>
 % } 
 
+% if ( $payby{'MCRD'} && $curuser->access_right('Post payment') ) { 
+  <% $s++ ? ' | ' : '' %>
+  <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCHK;custnum=<% $custnum %>"><% mt('Post manual (offline) electronic check payment') |h %></A>
+% } 
+
 <% $s ? '<BR>' : '' %>
 
 %# credit links
@@ -136,6 +141,11 @@
   <A HREF="<% $p %>edit/cust_refund.cgi?payby=MCRD;custnum=<% $custnum %>"><% mt('Post manual (offline/POS) credit card refund') |h %></A>
 % } 
 
+% if ( $payby{'MCHK'} && $curuser->access_right('Post refund') ) { 
+  <% $s++ ? ' | ' : '' %>
+  <A HREF="<% $p %>edit/cust_refund.cgi?payby=MCRD;custnum=<% $custnum %>"><% mt('Post manual (offline) electronic check refund') |h %></A>
+% } 
+
     </TD>
     <TD ALIGN="right" VALIGN="top">
 

commit 446fb74f2f31d48dd303c9a52105d40f11079e10
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jan 25 21:43:32 2015 -0800

    manual echeck payment type, RT#26995

diff --git a/FS/FS/cust_main/Billing_ThirdParty.pm b/FS/FS/cust_main/Billing_ThirdParty.pm
index faced8f..a1d19fb 100644
--- a/FS/FS/cust_main/Billing_ThirdParty.pm
+++ b/FS/FS/cust_main/Billing_ThirdParty.pm
@@ -36,7 +36,11 @@ to that URL.
 =cut
 
 my @methods = qw(PAYPAL CC);
-my %method2payby = ( 'PAYPAL' => 'PPAL', 'CC' => 'MCRD' );
+my %method2payby = ( 'PAYPAL' => 'PPAL',
+                     'CC'     => 'MCRD', #?  but doesn't MCRD mean _offline_
+                                         #card, not third-party card?  but no
+                                         #one is doing non-paypal right now
+                   );
 
 sub create_payment {
   my $self = shift;
diff --git a/FS/FS/cust_payby.pm b/FS/FS/cust_payby.pm
index 42bf64a..ad3d80a 100644
--- a/FS/FS/cust_payby.pm
+++ b/FS/FS/cust_payby.pm
@@ -353,7 +353,7 @@ sub check {
   if ( $self->paydate eq '' || $self->paydate eq '-' ) {
     return "Expiration date required"
       # shouldn't payinfo_check do this?
-      unless $self->payby =~ /^(BILL|PREPAY|CHEK|DCHK|LECB|CASH|WEST|MCRD|PPAL)$/;
+      unless $self->payby =~ /^(BILL|PREPAY|CHEK|DCHK|LECB|CASH|WEST|MCRD|MCHK|PPAL)$/;
     $self->paydate('');
   } else {
     my( $m, $y );

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Conf.pm                                      |    2 +-
 FS/FS/cust_main.pm                                 |    3 +-
 FS/FS/cust_main/Billing_ThirdParty.pm              |    6 +++-
 FS/FS/cust_payby.pm                                |    2 +-
 FS/FS/payby.pm                                     |   10 +++++-
 FS/FS/payinfo_Mixin.pm                             |   32 +++++++-------------
 httemplate/edit/cust_refund.cgi                    |    2 +-
 httemplate/edit/process/cust_refund.cgi            |    2 +-
 httemplate/search/elements/cust_pay_or_refund.html |    2 +-
 .../search/elements/report_cust_pay_or_refund.html |    1 +
 httemplate/search/report_h_cust_pay.html           |    1 +
 httemplate/view/cust_bill.cgi                      |    7 ++++-
 httemplate/view/cust_main/payment_history.html     |   10 ++++++
 13 files changed, 50 insertions(+), 30 deletions(-)




More information about the freeside-commits mailing list