[freeside-commits] freeside/FS/FS cust_pkg.pm, 1.75, 1.76 svc_acct.pm, 1.230, 1.231
Jeff Finucane,420,,
jeff at wavetail.420.am
Sun May 6 19:13:56 PDT 2007
- Previous message: [freeside-commits] freeside/fs_webdemo register.cgi, 1.5, NONE register.html, 1.4, NONE registerd, 1.8, NONE registerd.Pg, 1.11, NONE
- Next message: [freeside-commits] freeside/httemplate/misc/process link.cgi, 1.15, 1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/home/jeff/freeside/FS/FS
Modified Files:
cust_pkg.pm svc_acct.pm
Log Message:
1606 correct bug in overlimit groups handling
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- cust_pkg.pm 11 Apr 2007 04:28:21 -0000 1.75
+++ cust_pkg.pm 7 May 2007 02:13:54 -0000 1.76
@@ -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.230
retrieving revision 1.231
diff -u -d -r1.230 -r1.231
--- svc_acct.pm 26 Apr 2007 04:46:31 -0000 1.230
+++ svc_acct.pm 7 May 2007 02:13:54 -0000 1.231
@@ -1636,7 +1636,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);
@@ -1663,7 +1666,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";
@@ -1758,15 +1761,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);
+ }
}
}
- Previous message: [freeside-commits] freeside/fs_webdemo register.cgi, 1.5, NONE register.html, 1.4, NONE registerd, 1.8, NONE registerd.Pg, 1.11, NONE
- Next message: [freeside-commits] freeside/httemplate/misc/process link.cgi, 1.15, 1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list