manually editing usage counters removes overlimit status (#1706)
authorjeff <jeff>
Fri, 6 Jul 2007 23:55:26 +0000 (23:55 +0000)
committerjeff <jeff>
Fri, 6 Jul 2007 23:55:26 +0000 (23:55 +0000)
httemplate/edit/process/svc_acct.cgi

index a4a6c00..d9aac9f 100755 (executable)
 %
 %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;