summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-06-12 18:01:01 -0700
committerMark Wells <mark@freeside.biz>2013-06-12 18:01:01 -0700
commit7826d94a99cc23f5cf857c802cb7e1351a85881d (patch)
tree0217e634789a54800f413a2996f986c4cbc67d40
parent34c3b60c76f0ade9d4f7507732666ac8b9f81b67 (diff)
transfer invoice notes when changing packages, #23552
-rw-r--r--FS/FS/cust_pkg.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index a1d6556b5..ce07beeb1 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1925,6 +1925,18 @@ sub change {
}
}
+ # transfer (copy) invoice details
+ foreach my $detail ($self->cust_pkg_detail) {
+ my $new_detail = FS::cust_pkg_detail->new({ $detail->hash });
+ $new_detail->set('pkgdetailnum', '');
+ $new_detail->set('pkgnum', $cust_pkg->pkgnum);
+ $error = $new_detail->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error transferring package notes: $error";
+ }
+ }
+
# Order any supplemental packages.
my $part_pkg = $cust_pkg->part_pkg;
my @old_supp_pkgs = $self->supplemental_pkgs;