summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pkg.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-09-10 21:33:37 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-09-14 23:05:54 -0500
commit205cf3b843285a5858f1d6387386381564a5deca (patch)
tree2bf54867b4a4105c610147d3f28cfab99b0d3a31 /FS/FS/cust_pkg.pm
parentb78bb7aeaa27daab707106217b33e4096e985262 (diff)
RT#33410: Package GB add-ons
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r--FS/FS/cust_pkg.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index c5a3d2e..0ef7aa0 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2296,9 +2296,15 @@ sub change {
}
}
- # transfer usage pricing add-ons, if we're not changing pkgpart
- if ( $same_pkgpart ) {
- foreach my $old_cust_pkg_usageprice ($self->cust_pkg_usageprice) {
+ # transfer usage pricing add-ons, if we're not changing pkgpart or if they were specified
+ if ( $same_pkgpart || $opt->{'cust_pkg_usageprice'}) {
+ my @old_cust_pkg_usageprice;
+ if ($opt->{'cust_pkg_usageprice'}) {
+ @old_cust_pkg_usageprice = @{ $opt->{'cust_pkg_usageprice'} };
+ } else {
+ @old_cust_pkg_usageprice = $self->cust_pkg_usageprice;
+ }
+ foreach my $old_cust_pkg_usageprice (@old_cust_pkg_usageprice) {
my $new_cust_pkg_usageprice = new FS::cust_pkg_usageprice {
'pkgnum' => $cust_pkg->pkgnum,
'usagepricepart' => $old_cust_pkg_usageprice->usagepricepart,