diff options
| author | Mark Wells <mark@freeside.biz> | 2015-10-23 12:03:24 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2015-10-23 12:03:38 -0700 |
| commit | eb8176675b99422a309534808e38d51571228cfe (patch) | |
| tree | 241becf8dc0cc0e1791ff018eb074a65235c8e5d /httemplate/edit/process | |
| parent | e8a7a756aa97a62dec29cdbdc24e6bb3c15aa5ee (diff) | |
allow a default rate detail for each CDR type, #38633
Diffstat (limited to 'httemplate/edit/process')
| -rw-r--r-- | httemplate/edit/process/rate_detail.html | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/httemplate/edit/process/rate_detail.html b/httemplate/edit/process/rate_detail.html index f8a744418..4020ce9e2 100644 --- a/httemplate/edit/process/rate_detail.html +++ b/httemplate/edit/process/rate_detail.html @@ -2,7 +2,7 @@ 'table' => 'rate_detail', 'popup_reload' => 'Rate changed', #a popup "parent reload" for now #someday change the individual element and go away instead - 'noerror_callback' => $set_default_detail + #'noerror_callback' => $set_default_detail &> <%init> @@ -12,19 +12,11 @@ die "access denied" my $set_default_detail = sub { my ($cgi, $rate_detail) = @_; - if (!$rate_detail->dest_regionnum) { + if (!$rate_detail->dest_regionnum and !$rate_detail->cdrtypenum) { # then this is a global default rate + # default_detailnum is no longer used, but maintain it anyway (and point + # it at the one with null cdrtypenum) my $rate = $rate_detail->rate; - if ($rate->default_detailnum) { - if ($rate->default_detailnum == $rate_detail->ratedetailnum) { - return; - } else { - # there's somehow an existing default rate. remove it. - my $old_default = $rate->default_detail; - my $error = $old_default->delete; - die "$error (removing old default rate)\n" if $error; - } - } $rate->set('default_detailnum' => $rate_detail->ratedetailnum); my $error = $rate->replace; die "$error (setting default rate)\n" if $error; |
