[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 46571761a938080713ef03e1b61a5138f05c606e
Ivan
ivan at 420.am
Thu May 10 20:30:20 PDT 2012
The branch, FREESIDE_2_3_BRANCH has been updated
via 46571761a938080713ef03e1b61a5138f05c606e (commit)
from d6c36f251779288c9147275c5a6d1d1ddf795b8f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 46571761a938080713ef03e1b61a5138f05c606e
Author: Ivan Kohler <ivan at freeside.biz>
Date: Thu May 10 20:30:18 2012 -0700
fix uncancellation w/services that have been re-provisioned, RT#17518
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 64736ba..39a4d5c 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -976,7 +976,16 @@ sub uncancel {
my $svc_error = $svc_x->insert;
if ( $svc_error && $options{svc_fatal} ) {
$dbh->rollback if $oldAutoCommit;
- return $error;
+ return $svc_error;
+ } else {
+ my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_x->svcnum });
+ if ( $cust_svc ) {
+ my $cs_error = $cust_svc->delete;
+ if ( $cs_error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $cs_error;
+ }
+ }
}
push @svc_errors, $svc_error if $svc_error;
}
diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html
index 3a6a4d1..348f0a6 100755
--- a/httemplate/misc/cancel_pkg.html
+++ b/httemplate/misc/cancel_pkg.html
@@ -44,6 +44,12 @@
'format' => $date_format,
} &>
+ <& /elements/tr-checkbox.html,
+ 'label' => mt("Uncancel even if a service can't be re-provisioned"),
+ 'field' => 'svc_not_fatal',
+ 'value' => 'Y',
+ &>
+
% $date_init = 1;
% }
diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html
index bc3a8cd..b2d7bfa 100755
--- a/httemplate/misc/process/cancel_pkg.html
+++ b/httemplate/misc/process/cancel_pkg.html
@@ -80,11 +80,14 @@ my $last_bill =
my $bill =
$cgi->param('bill') ? parse_datetime($cgi->param('bill')) : '';
+my $svc_fatal = ( $cgi->param('svc_not_fatal') ne 'Y' );
+
my $error = $cust_pkg->$method( 'reason' => $reasonnum,
'date' => $date,
'resume_date' => $resume_date,
'last_bill' => $last_bill,
'bill' => $bill,
+ 'svc_fatal' => $svc_fatal,
);
if ($error) {
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_pkg.pm | 11 ++++++++++-
httemplate/misc/cancel_pkg.html | 6 ++++++
httemplate/misc/process/cancel_pkg.html | 3 +++
3 files changed, 19 insertions(+), 1 deletions(-)
More information about the freeside-commits
mailing list