projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a88f08
)
RT# 83091 - fixed selfserivce to insert payment account if one does not exits
author
Christopher Burger
<burgerc@freeside.biz>
Thu, 28 Mar 2019 18:18:38 +0000
(14:18 -0400)
committer
Christopher Burger
<burgerc@freeside.biz>
Thu, 28 Mar 2019 18:18:38 +0000
(14:18 -0400)
FS/FS/ClientAPI/MyAccount.pm
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
c303ae6
..
e813016
100644
(file)
--- 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();
## 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 };
}
my $new = new FS::cust_main { $cust_main->hash };
@@
-1703,6
+1708,9
@@
sub insert_payby {
my $payinfo2 = $1;
$p->{'payinfo'} = $payinfo1. '@'. $payinfo2;
}
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,
my $cust_payby = new FS::cust_payby {
'custnum' => $custnum,