summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-04-22 14:33:50 -0700
committerIvan Kohler <ivan@freeside.biz>2015-04-22 14:33:50 -0700
commit4d27115f3f5d290602d1c656d8b20d5bbfc30f4d (patch)
tree8dab3ebe0084daa55271ceac04e40bcff93b697a
parent4e3d17eefa30165031b551ddaed03007a7579ceb (diff)
parent005571eaf7291ae53724590e2c8d8374c0020378 (diff)
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
-rw-r--r--FS/FS/cust_pkg.pm29
-rw-r--r--FS/FS/part_export/pbxware.pm2
2 files changed, 14 insertions, 17 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 6fbc2d6eb..f7de23595 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2085,14 +2085,15 @@ sub change {
}
if ( $keep_dates ) {
- foreach my $date ( qw(setup bill last_bill susp adjourn cancel expire
- resume start_date contract_end ) ) {
+ foreach my $date ( qw(setup bill last_bill) ) {
$hash{$date} = $self->getfield($date);
}
}
- # always keep this date, regardless of anything
- # (the date of the package change is in a different field)
- $hash{'order_date'} = $self->getfield('order_date');
+ # always keep the following dates
+ foreach my $date (qw(order_date susp adjourn cancel expire resume
+ start_date contract_end)) {
+ $hash{$date} = $self->getfield($date);
+ }
# allow $opt->{'locationnum'} = '' to specifically set it to null
# (i.e. customer default location)
@@ -2128,19 +2129,15 @@ sub change {
# changed from this package.
$cust_pkg = $opt->{'cust_pkg'};
- foreach ( qw( pkgnum pkgpart locationnum ) ) {
- $cust_pkg->set("change_$_", $self->get($_));
+ # follow all the above rules for date changes, etc.
+ foreach (keys %hash) {
+ $cust_pkg->set($_, $hash{$_});
}
- $cust_pkg->set('change_date', $time);
- $cust_pkg->set('start_date', ''); # it's starting now
- # if we are crediting unused time, then create the new package as a new
- # package, charge its setup fee, etc. (same as an immediate change)
- if (! $unused_credit) {
- foreach my $date ( qw(setup bill last_bill susp adjourn resume
- contract_end ) ) {
- $cust_pkg->set($date, $self->getfield($date));
- }
+ # except those that implement the future package change behavior
+ foreach (qw(change_to_pkgnum start_date expire)) {
+ $cust_pkg->set($_, '');
}
+
$error = $cust_pkg->replace;
} else {
diff --git a/FS/FS/part_export/pbxware.pm b/FS/FS/part_export/pbxware.pm
index e647dce75..3da4c2ad1 100644
--- a/FS/FS/part_export/pbxware.pm
+++ b/FS/FS/part_export/pbxware.pm
@@ -57,7 +57,7 @@ returns an error message. If there are no new CDRs, returns nothing.
# map their column names to cdr fields
# (warning: API docs are not quite accurate here)
our %column_map = (
- 'Tenant' => 'subscriber',
+ 'Tenant' => 'accountcode',
'From' => 'src',
'To' => 'dst',
'Date/Time' => 'startdate',