[freeside-commits] freeside/FS/FS cust_pkg.pm, 1.73.2.2, 1.73.2.3 svc_acct.pm, 1.217.2.10, 1.217.2.11
Jeff Finucane,420,,
jeff at wavetail.420.am
Sun May 6 19:22:04 PDT 2007
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/home/jeff/freeside-1.7/FS/FS
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cust_pkg.pm svc_acct.pm
Log Message:
1606 correct bug in overlimit groups handling (backport)
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.73.2.2
retrieving revision 1.73.2.3
diff -u -d -r1.73.2.2 -r1.73.2.3
--- cust_pkg.pm 11 Apr 2007 04:29:48 -0000 1.73.2.2
+++ cust_pkg.pm 7 May 2007 02:22:02 -0000 1.73.2.3
@@ -1267,11 +1267,8 @@
foreach my $cust_svc ($self->cust_svc) {
if($target{$cust_svc->svcpart} > 0) {
$target{$cust_svc->svcpart}--;
- my $new = new FS::cust_svc {
- svcnum => $cust_svc->svcnum,
- svcpart => $cust_svc->svcpart,
- pkgnum => $dest_pkgnum,
- };
+ my $new = new FS::cust_svc { $cust_svc->hash };
+ $new->pkgnum($dest_pkgnum);
my $error = $new->replace($cust_svc);
return $error if $error;
} elsif ( exists $opt{'change_svcpart'} && $opt{'change_svcpart'} ) {
@@ -1290,11 +1287,9 @@
warn "alternate(s) found\n" if $DEBUG;
my $change_svcpart = $alternate[0];
$target{$change_svcpart}--;
- my $new = new FS::cust_svc {
- svcnum => $cust_svc->svcnum,
- svcpart => $change_svcpart,
- pkgnum => $dest_pkgnum,
- };
+ my $new = new FS::cust_svc { $cust_svc->hash };
+ $new->svcpart($change_svcpart);
+ $new->pkgnum($dest_pkgnum);
my $error = $new->replace($cust_svc);
return $error if $error;
} else {
Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.217.2.10
retrieving revision 1.217.2.11
diff -u -d -r1.217.2.10 -r1.217.2.11
--- svc_acct.pm 26 Apr 2007 04:47:16 -0000 1.217.2.10
+++ svc_acct.pm 7 May 2007 02:22:02 -0000 1.217.2.11
@@ -1581,7 +1581,10 @@
my $action = $op2action{$op};
- if ( &{$op2condition{$op}}($self, $column, $amount) ) {
+ if ( &{$op2condition{$op}}($self, $column, $amount) &&
+ ( $action eq 'suspend' && !$self->overlimit
+ || $action eq 'unsuspend' && $self->overlimit )
+ ) {
foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
if ($part_export->option('overlimit_groups')) {
my ($new,$old);
@@ -1608,7 +1611,7 @@
&& &{$op2condition{$op}}($self, $column, $amount) ) {
#my $error = $self->$action();
my $error = $self->cust_svc->cust_pkg->$action();
- $error ||= $self->overlimit($action);
+ # $error ||= $self->overlimit($action);
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return "Error ${action}ing: $error";
@@ -1703,15 +1706,18 @@
}
if ( $reset ) {
- my $error = $self->overlimit('unsuspend');
+ my $error;
- foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
- if ($part_export->option('overlimit_groups')) {
- my $old = new FS::svc_acct $self->hashref;
- my $groups = &{ $self->_fieldhandlers->{'usergroup'} }
- ($self, $part_export->option('overlimit_groups'));
- $old->usergroup( $groups );
- $error ||= $part_export->export_replace($self, $old);
+ if ($self->overlimit) {
+ $error = $self->overlimit('unsuspend');
+ foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
+ if ($part_export->option('overlimit_groups')) {
+ my $old = new FS::svc_acct $self->hashref;
+ my $groups = &{ $self->_fieldhandlers->{'usergroup'} }
+ ($self, $part_export->option('overlimit_groups'));
+ $old->usergroup( $groups );
+ $error ||= $part_export->export_replace($self, $old);
+ }
}
}
More information about the freeside-commits
mailing list