From: Jonathan Prykop Date: Tue, 5 Jul 2016 23:35:41 +0000 (-0500) Subject: RT#17599: display cancelled services from history [bug fixes, v3 merge] X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=0b019cbcd4f285cf76a4aa5d7143a4154748ae5f RT#17599: display cancelled services from history [bug fixes, v3 merge] --- 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 },