1 <& elements/process.html,
2 'table' => 'rate_detail',
3 'popup_reload' => 'Rate changed', #a popup "parent reload" for now
4 #someday change the individual element and go away instead
5 #'noerror_callback' => $set_default_detail
9 my $conf = new FS::Conf;
11 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
13 my $set_default_detail = sub {
14 my ($cgi, $rate_detail) = @_;
15 if (!$rate_detail->dest_regionnum and !$rate_detail->cdrtypenum) {
16 # then this is a global default rate
17 # default_detailnum is no longer used, but maintain it anyway (and point
18 # it at the one with null cdrtypenum)
19 my $rate = $rate_detail->rate;
20 $rate->set('default_detailnum' => $rate_detail->ratedetailnum);
21 my $error = $rate->replace;
22 die "$error (setting default rate)\n" if $error;