[freeside-commits] freeside/httemplate/misc/process cancel_pkg.html, 1.4.2.3, 1.4.2.4
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Jun 30 22:01:31 PDT 2008
Update of /home/cvs/cvsroot/freeside/httemplate/misc/process
In directory wavetail.420.am:/tmp/cvs-serv21844/httemplate/misc/process
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cancel_pkg.html
Log Message:
correct internal reason searching, prevent interleaved suspend/cancel/expire/adjourn, backporting and refactoring
Index: cancel_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/process/cancel_pkg.html,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -d -r1.4.2.3 -r1.4.2.4
--- cancel_pkg.html 30 Jun 2008 21:49:14 -0000 1.4.2.3
+++ cancel_pkg.html 1 Jul 2008 05:01:29 -0000 1.4.2.4
@@ -46,6 +46,7 @@
$date = $cgi->param('date');
str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
$date = $1;
+ $method = ($method eq 'expire') ? 'cancel' : 'suspend';
}
my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} );
@@ -61,15 +62,7 @@
};
}
-my $error;
-if ($method eq 'expire' || $method eq 'adjourn'){
- my %hash = $cust_pkg->hash;
- $hash{$method} = $date;
- my $new = new FS::cust_pkg \%hash;
- $error = $new->replace($cust_pkg, 'reason' => $reasonnum);
-} else {
- $error = $cust_pkg->$method( 'reason' => $reasonnum );
-}
+my $error = $cust_pkg->$method( 'reason' => $reasonnum, 'date' => $date );
if ($error) {
$cgi->param('error', $error);
More information about the freeside-commits
mailing list