X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fsvc_acct.cgi;h=d9aac9fac20af07b6010027233f6f9f343d2f829;hb=d6dbf288fd8ea42ebd5171d80817356248cf22ce;hp=30552c8463074c98a73e4cd5c6480d92040d7f09;hpb=bc392247350c4a124c8835f18dd19154ac343e9d;p=freeside.git diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index 30552c846..d9aac9fac 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -23,6 +23,11 @@ %#unmunge usergroup %$cgi->param('usergroup', [ $cgi->param('radius_usergroup') ] ); % +%#unmunge bytecounts +%foreach (map { $_,$_."_threshold" } qw( upbytes downbytes totalbytes )) { +% $cgi->param($_, FS::UI::bytecount::parse_bytecount($cgi->param($_)) ); +%} +% %my %hash = $svcnum ? $old->hash : (); %map { % $hash{$_} = scalar($cgi->param($_)); @@ -33,7 +38,15 @@ % %my $error; %if ( $svcnum ) { -% $error = $new->replace($old); +% foreach (grep { $old->$_ != $new->$_ } qw( seconds upbytes downbytes totalbytes )) { +% my %hash = map { $_ => $new->$_ } +% grep { $new->$_ } +% qw( seconds upbytes downbytes totalbytes ); +% +% $error = $new->set_usage(\%hash); #unoverlimit and trigger radius changes +% last; #once is enough +% } +% $error ||= $new->replace($old); %} else { % $error = $new->insert; % $svcnum = $new->svcnum;