projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add quantity to self-service change_pkg, RT#34068
[freeside.git]
/
FS
/
FS
/
ClientAPI
/
MyAccount.pm
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
023c1d6
..
2781905
100644
(file)
--- a/
FS/FS/ClientAPI/MyAccount.pm
+++ b/
FS/FS/ClientAPI/MyAccount.pm
@@
-2270,7
+2270,7
@@
sub order_pkg {
my $status = $cust_main->status;
my $status = $cust_main->status;
- my %order_pkg_options = ()
)
;
+ my %order_pkg_options = ();
if ( $p->{locationnum} > 0 ) {
$order_pkg_options{locationnum} = delete($p->{locationnum});
} elsif ( $p->{address1} ) {
if ( $p->{locationnum} > 0 ) {
$order_pkg_options{locationnum} = delete($p->{locationnum});
} elsif ( $p->{address1} ) {
@@
-2398,26
+2398,26
@@
sub change_pkg {
return { error=>"Can't change a suspended package", pkgnum=>$cust_pkg->pkgnum}
if $cust_pkg->status eq 'suspended';
return { error=>"Can't change a suspended package", pkgnum=>$cust_pkg->pkgnum}
if $cust_pkg->status eq 'suspended';
- my
@newpkg;
-
my $error = FS::cust_pkg::order( $custnum
,
- [$p->{pkgpart}],
- [$p->{pkgnum}],
- \@newpkg,
-
);
+ my
$err_or_cust_pkg = $cust_pkg->change( 'pkgpart' => $p->{'pkgpart'},
+
'quantity' => $p->{'quantity'} || 1
,
+ );
+
+ return { error=>$err_or_cust_pkg, pkgnum=>$cust_pkg->pkgnum }
+
unless ref($err_or_cust_pkg
);
if ( $conf->exists('signup_server-realtime') ) {
my $bill_error = _do_bop_realtime( $cust_main, $status, 'no_credit'=>1 );
if ($bill_error) {
if ( $conf->exists('signup_server-realtime') ) {
my $bill_error = _do_bop_realtime( $cust_main, $status, 'no_credit'=>1 );
if ($bill_error) {
- $
newpkg[0]
->suspend;
+ $
err_or_cust_pkg
->suspend;
return $bill_error;
} else {
return $bill_error;
} else {
- $
newpkg[0]
->reexport;
+ $
err_or_cust_pkg
->reexport;
}
} else {
}
} else {
- $
newpkg[0]
->reexport;
+ $
err_or_cust_pkg
->reexport;
}
return { error => '', pkgnum => $cust_pkg->pkgnum };
}
return { error => '', pkgnum => $cust_pkg->pkgnum };