summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pkg.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-01-31 13:37:45 -0800
committerMark Wells <mark@freeside.biz>2014-01-31 13:37:45 -0800
commitd5d1293020ff677240347c6b88e57ee957945750 (patch)
treef03ae7d0f247e391370175f88dbaa395590c5084 /FS/FS/cust_pkg.pm
parent573e68cc026cddd6e52d2f2027da388054a128d1 (diff)
preserve order_date across package changes, #25130
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r--FS/FS/cust_pkg.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 8aea17d..8ee11a4 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -334,7 +334,9 @@ sub insert {
}
# set order date unless it was specified as part of an import
- $self->order_date(time) unless $import && $self->order_date;
+ # or this was previously a different package
+ $self->order_date(time) unless ($import && $self->order_date)
+ or $self->change_pkgnum;
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
@@ -1792,6 +1794,9 @@ sub change {
$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');
# allow $opt->{'locationnum'} = '' to specifically set it to null
# (i.e. customer default location)