summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pkg.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-07-18 19:29:59 -0500
committerJonathan Prykop <jonathan@freeside.biz>2016-08-14 19:17:24 -0500
commit4ec2818fa42bf6b3ed00f6888c744456855ec0f1 (patch)
tree0068cbc6a8f706476323bf1eb3e3eda2fcee3bd8 /FS/FS/cust_pkg.pm
parent0edd5b9d5c03f02341b1004888f0f712c8defb47 (diff)
RT#38973: Bill for time worked on ticket resolution [fully functional]
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r--FS/FS/cust_pkg.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index de88cc0..1ee8552 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -533,6 +533,7 @@ sub delete {
# cust_bill_pay.pkgnum (wtf, shouldn't reference pkgnum)
# cust_pkg_usage.pkgnum
# cust_pkg.uncancel_pkgnum, change_pkgnum, main_pkgnum, and change_to_pkgnum
+ # rt_field_charge.pkgnum
# cust_svc is handled by canceling the package before deleting it
# cust_pkg_option is handled via option_Common
@@ -2631,6 +2632,19 @@ sub change {
return "canceling old package: $error";
}
+ # transfer rt_field_charge, if we're not changing pkgpart
+ # after billing of old package, before billing of new package
+ if ( $same_pkgpart ) {
+ foreach my $rt_field_charge ($self->rt_field_charge) {
+ $rt_field_charge->set('pkgnum', $cust_pkg->pkgnum);
+ $error = $rt_field_charge->replace;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "transferring rt_field_charge: $error";
+ }
+ }
+ }
+
if ( $conf->exists('cust_pkg-change_pkgpart-bill_now') ) {
#$self->cust_main
my $error = $cust_pkg->cust_main->bill(