X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Frate_detail.html;h=32dd502cec50ef54b4cb14afc8814254bfface3e;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hp=14b52110be796414c1a1ed34a93baaa7c1fd4ff8;hpb=ba46a6a90321490da78c764657ae19d5c6fd81f8;p=freeside.git diff --git a/httemplate/edit/elements/rate_detail.html b/httemplate/edit/elements/rate_detail.html index 14b52110b..32dd502ce 100644 --- a/httemplate/edit/elements/rate_detail.html +++ b/httemplate/edit/elements/rate_detail.html @@ -47,34 +47,85 @@ with row headers showing the region name and prefixes. % } % foreach my $rate_time (@rate_time, '') { -% my $detail = $details[$row][$col]; -% if($detail) { + <& .detail_box, + detail => $details[$row][$col], + ratetimenum => ($rate_time ? $rate_time->ratetimenum : ''), + cdrtypenum => $cdrtypenum, + regionnum => $region->regionnum, + ratenum => $rate->ratenum + &> +% $col++; + +% } # foreach @rate_time + +% $row++; +% }# foreach @rate_region +% if ( !$opt{regionnum} ) { +% # global default for this cdrtypenum + + + Global default (for calls not matching any prefix) + + +% # default rate: set a null region for this cdr type + + <& .detail_box, + detail => $rate->default_detail($cdrtypenum), + ratetimenum => '', + cdrtypenum => $cdrtypenum, + regionnum => '', + ratenum => $rate->ratenum + &> + + +% } + +<%def .detail_box> +<%args> +$detail => undef, +$ratetimenum +$cdrtypenum +$regionnum +$ratenum + +% if ($detail) { - <% granularity_detail($detail) %> <% min_included_detail($detail) %> <% conn_charge_detail($detail) %> -
<% edit_link($detail) %><% $money_char.$detail->min_charge %> +
<% edit_link($detail) %> +% if ( $detail->min_charge > 0 or $detail->conn_charge > 0) { + <% $money_char.$detail->min_charge %> <% $detail->sec_granularity ? ' / minute':' / call' %> % if ( $detail->min_cost ) { (<% $money_char.$detail->min_cost %> cost) % } +% if ( $detail->upstream_mult_charge > 0 +% or $detail->upstream_mult_cost > 0) { +
+ +% } +% } +% if ( $detail->upstream_mult_charge > 0 +% or $detail->upstream_mult_cost > 0) { + <% $detail->upstream_mult_charge %> × upstream price +% if ( $detail->upstream_mult_cost > 0 ) { + (<% $detail->upstream_mult_cost %> cost) +% } +% } +% if ( $detail->upstream_mult_charge == 0 +% and $detail->min_charge == 0 +% and $detail->conn_charge == 0 ) { + Free +% } <% $edit_hint %>
<% ( $rate_time || $cdrtypenum ) ? delete_link($detail) : '' %> +
<% ( $ratetimenum || $cdrtypenum ) ? delete_link($detail) : '' %>
-% } -% else { #!$detail - <% add_link($rate, $region, $rate_time, $cdrtypenum) %> -% } -% $col++; - -% } # foreach @rate_time - -% $row++; -% }# foreach @rate_region - - +% } else { + <% add_link($ratenum, $regionnum, $ratetimenum, $cdrtypenum) %> +% } + <%once> tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities(); @@ -95,25 +146,27 @@ sub edit_link { include( '/elements/popup_link_onclick.html', 'action' => "${p}edit/rate_detail.html?$ratedetailnum", 'actionlabel' => 'Edit rate', - 'height' => 460, + 'height' => 550, + 'width' => 580, #default# 'width' => 540, #default# 'color' => '#333399', ) . '">' } sub add_link { - my ($rate, $region, $rate_time, $cdrtypenum) = @_; + my ($ratenum, $regionnum, $ratetimenum, $cdrtypenum) = @_; ' 'Add rate', - 'height' => 460, + 'width' => 580, + 'height' => 550, ).'">'.small('(add)').'' } @@ -133,7 +186,10 @@ sub delete_link { sub granularity_detail { my $rate_detail = shift; - if($rate_detail->sec_granularity != 60 && $rate_detail->sec_granularity > 0) { + if( + $rate_detail->sec_granularity != 60 + && $rate_detail->sec_granularity > 0 + && $rate_detail->min_charge > 0) { ''. small('in '.$granularity{$rate_detail->sec_granularity}.' increments'). '';