[freeside-commits] branch FREESIDE_4_BRANCH updated. ba0afcb2c51e2aaa5b0c7d52c7e04e13c965c15b

Christopher Burger burgerc at freeside.biz
Thu Mar 28 16:48:09 PDT 2019


The branch, FREESIDE_4_BRANCH has been updated
       via  ba0afcb2c51e2aaa5b0c7d52c7e04e13c965c15b (commit)
      from  b888fee860fa5d346fb218292aa0db2d8f4dc9a8 (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 ba0afcb2c51e2aaa5b0c7d52c7e04e13c965c15b
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Mar 28 14:18:38 2019 -0400

    RT# 83091 - fixed selfserivce to insert payment account if one does not exits

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 7d49c87e1..162e6ae76 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -752,8 +752,13 @@ sub edit_info {
 
     ## get default cust_payby and change it. For old v3 selfservice that upgraded to v4.  this is for v4 only
     my ($cust_payby) = $cust_main->cust_payby();
-    $p->{'custpaybynum'} = $cust_payby->custpaybynum;
-    update_payby($p);
+    if ($cust_payby) {
+      $p->{'custpaybynum'} = $cust_payby->custpaybynum;
+      update_payby($p);
+    }
+    else {
+      insert_payby($p);
+    }
   }
 
   my $new = new FS::cust_main { $cust_main->hash };
@@ -1705,6 +1710,9 @@ sub insert_payby {
      my $payinfo2 = $1;
      $p->{'payinfo'} = $payinfo1. '@'. $payinfo2;
    }
+   elsif ($p->{'payby'} eq 'CARD') {
+    $p->{paydate} = $p->{year} . '-' . $p->{month} . '-01' unless $p->{paydate};
+   }
 
   my $cust_payby = new FS::cust_payby {
     'custnum' => $custnum,

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

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list