X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_acct.pm;h=32ffb76d15dac80cf57ab34bdbb16987dffc3aec;hb=99f1c015eb0858e178d22025d47a951c74d7916d;hp=7cbe63f6c4c6bd304c0fc041dd7a58921609f345;hpb=633c48448d9468690b7ad77eb6ff7c660a286658;p=freeside.git diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 7cbe63f6c..32ffb76d1 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -272,6 +272,7 @@ sub table_info { label => 'RADIUS groups', type => 'radius_usergroup_selector', disable_inventory => 1, + disable_select => 1, }, 'seconds' => { label => 'Seconds', type => 'text', @@ -453,7 +454,10 @@ sub insert { if ( $cust_pkg ) { my $cust_main = $cust_pkg->cust_main; - if ( $conf->exists('emailinvoiceauto') ) { + if ( $conf->exists('emailinvoiceautoalways') + || $conf->exists('emailinvoiceauto') + && ! $cust_main->invoicing_list_emailonly + ) { my @invoicing_list = $cust_main->invoicing_list; push @invoicing_list, $self->email; $cust_main->invoicing_list(\@invoicing_list); @@ -1515,6 +1519,28 @@ sub _op_usage { my $action = $op2action{$op}; + if ( &{$op2condition{$op}}($self, $column, $amount) ) { + foreach my $part_export ( $self->cust_svc->part_svc->part_export ) { + if ($part_export->option('overlimit_groups')) { + my ($new,$old); + my $other = new FS::svc_acct $self->hashref; + my $groups = &{ $self->_fieldhandlers->{'usergroup'} } + ($self, $part_export->option('overlimit_groups')); + $other->usergroup( $groups ); + if ($action eq 'suspend'){ + $new = $other; $old = $self; + }else{ + $new = $self; $old = $other; + } + my $error = $part_export->export_replace($new, $old); + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "Error replacing radius groups in export, ${op}: $error"; + } + } + } + } + if ( $conf->exists("svc_acct-usage_$action") && &{$op2condition{$op}}($self, $column, $amount) ) { #my $error = $self->$action(); @@ -1571,6 +1597,7 @@ sub set_usage { local $SIG{TSTP} = 'IGNORE'; local $SIG{PIPE} = 'IGNORE'; + local $FS::svc_Common::noexport_hack = 1; my $oldAutoCommit = $FS::UID::AutoCommit; local $FS::UID::AutoCommit = 0; my $dbh = dbh;