summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-07-05 18:35:41 -0500
committerJonathan Prykop <jonathan@freeside.biz>2016-07-07 19:06:26 -0500
commit0b019cbcd4f285cf76a4aa5d7143a4154748ae5f (patch)
tree0e2b6c70066dc76add5fe3af25ba369680765ff7
parent7fdbfcef21985e7c8455929eb0ad70c0863ac47b (diff)
RT#17599: display cancelled services from history [bug fixes, v3 merge]
-rw-r--r--FS/FS/cust_pkg.pm8
-rw-r--r--FS/FS/h_svc_acct.pm1
-rw-r--r--FS/FS/h_svc_forward.pm4
-rw-r--r--FS/FS/h_svc_www.pm1
4 files changed, 13 insertions, 1 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 9bcf455a5..2275c5980 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1226,7 +1226,13 @@ sub uncancel_svc_summary {
'uncancel_svcnum' => $svc_x->get('_h_svc_x')->svcnum,
};
$svc_x->pkgnum($self->pkgnum); # provisioning services on a canceled package, will be rolled back
- if ($opt{'no_test_reprovision'} or $svc_x->insert) {
+ my $insert_error;
+ unless ($opt{'no_test_reprovision'}) {
+ # avoid possibly fatal errors from missing linked records
+ eval { $insert_error = $svc_x->insert };
+ $insert_error ||= $@;
+ }
+ if ($opt{'no_test_reprovision'} or $insert_error) {
# avoid possibly fatal errors from missing linked records
eval { $out->{'label'} = $svc_x->label };
eval { $out->{'label'} = $svc_x->get('_h_svc_x')->label } unless defined($out->{'label'});
diff --git a/FS/FS/h_svc_acct.pm b/FS/FS/h_svc_acct.pm
index f525f8206..7416054bc 100644
--- a/FS/FS/h_svc_acct.pm
+++ b/FS/FS/h_svc_acct.pm
@@ -28,6 +28,7 @@ FS::h_svc_acct - Historical account objects
sub svc_domain {
my $self = shift;
+ $_[0] ||= $self->history_date;
qsearchs( 'h_svc_domain',
{ 'svcnum' => $self->domsvc },
FS::h_svc_domain->sql_h_searchs(@_),
diff --git a/FS/FS/h_svc_forward.pm b/FS/FS/h_svc_forward.pm
index 25b203904..c0eeb3fc5 100644
--- a/FS/FS/h_svc_forward.pm
+++ b/FS/FS/h_svc_forward.pm
@@ -32,6 +32,8 @@ FS::h_svc_forward - Historical mail forwarding alias objects
sub srcsvc_acct {
my $self = shift;
+
+ $_[0] ||= $self->history_date;
my $h_svc_acct = qsearchs(
'h_svc_acct',
{ 'svcnum' => $self->srcsvc },
@@ -52,6 +54,8 @@ sub srcsvc_acct {
sub dstsvc_acct {
my $self = shift;
+
+ $_[0] ||= $self->history_date;
my $h_svc_acct = qsearchs(
'h_svc_acct',
{ 'svcnum' => $self->dstsvc },
diff --git a/FS/FS/h_svc_www.pm b/FS/FS/h_svc_www.pm
index 2a3b6dca6..20002214b 100644
--- a/FS/FS/h_svc_www.pm
+++ b/FS/FS/h_svc_www.pm
@@ -33,6 +33,7 @@ sub domain_record {
carp 'Called FS::h_svc_www->domain_record on svcnum ' . $self->svcnum if $DEBUG;
+ $_[0] ||= $self->history_date;
my $domain_record = qsearchs(
'h_domain_record',
{ 'recnum' => $self->recnum },