[freeside-commits] freeside/FS/FS svc_acct.pm,1.208,1.209
Jeff Finucane,420,,
jeff at wavetail.420.am
Fri Dec 8 07:11:24 PST 2006
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv32102
Modified Files:
svc_acct.pm
Log Message:
stop unsuspending inappropriately
Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -d -r1.208 -r1.209
--- svc_acct.pm 7 Dec 2006 02:40:31 -0000 1.208
+++ svc_acct.pm 8 Dec 2006 15:11:22 -0000 1.209
@@ -1450,15 +1450,9 @@
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- if ( $conf->exists("svc_acct-usage_unsuspend") ) {
- my $error = $self->cust_svc->cust_pkg->unsuspend;
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- return "Error unsuspending: $error";
- }
- }
-
+ my $reset = 0;
foreach my $field (keys %$valueref){
+ $reset = 1 if $valueref->{$field};
$self->setfield($field, $valueref->{$field});
$self->setfield( $field.'_threshold',
int($self->getfield($field)
@@ -1472,6 +1466,14 @@
my $error = $self->replace;
die $error if $error;
+ if ( $conf->exists("svc_acct-usage_unsuspend") && $reset ) {
+ my $error = $self->cust_svc->cust_pkg->unsuspend;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error unsuspending: $error";
+ }
+ }
+
warn "$me update successful; committing\n"
if $DEBUG;
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
More information about the freeside-commits
mailing list