X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Frate_detail.html;h=14b52110be796414c1a1ed34a93baaa7c1fd4ff8;hb=ef3c3ca13b2b93df158e01d4fc0713a3e8191a8c;hp=faf11f8447e69985100cf8b6f9f068652db0ae53;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/httemplate/edit/elements/rate_detail.html b/httemplate/edit/elements/rate_detail.html index faf11f844..14b52110b 100644 --- a/httemplate/edit/elements/rate_detail.html +++ b/httemplate/edit/elements/rate_detail.html @@ -35,14 +35,14 @@ with row headers showing the region name and prefixes. % $region = $r; % foreach ($r->regionname, $r->prefixes_short) { - <% $_ %> + <% $_ %> % } % } % elsif ( !$opt{'ratenum'} ) { % $rate = $r; - <% $r->ratename %> + <% $r->ratename %> % } % foreach my $rate_time (@rate_time, '') { @@ -52,16 +52,20 @@ with row headers showing the region name and prefixes. <% granularity_detail($detail) %> <% min_included_detail($detail) %> <% conn_charge_detail($detail) %> - +
<% edit_link($detail) %><% $money_char.$detail->min_charge %> <% $detail->sec_granularity ? ' / minute':' / call' %> +% if ( $detail->min_cost ) { + (<% $money_char.$detail->min_cost %> cost) +% } <% $edit_hint %>
<% $rate_time ? delete_link($detail) : '' %>
<% ( $rate_time || $cdrtypenum ) ? delete_link($detail) : '' %> +
% } % else { #!$detail - <% add_link($rate, $region, $rate_time) %> + <% add_link($rate, $region, $rate_time, $cdrtypenum) %> % } % $col++; @@ -91,25 +95,25 @@ sub edit_link { include( '/elements/popup_link_onclick.html', 'action' => "${p}edit/rate_detail.html?$ratedetailnum", 'actionlabel' => 'Edit rate', - 'height' => 420, + 'height' => 460, #default# 'width' => 540, #default# 'color' => '#333399', ) . '">' } sub add_link { - my ($rate, $region, $rate_time) = @_; + my ($rate, $region, $rate_time, $cdrtypenum) = @_; ' 'Add rate', - 'height' => 420, + 'height' => 460, ).'">'.small('(add)').'' } @@ -156,7 +160,11 @@ sub conn_charge_detail { #return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec; ''. small( $money_char. $rate_detail->conn_charge. - ' for '.$conn_secs{$rate_detail->conn_sec} + ( $rate_detail->conn_cost + ? ' ('. $money_char.$rate_detail->conn_cost. ' cost)' + : '' + ). + ' for '. $conn_secs{$rate_detail->conn_sec} ). '' } @@ -172,6 +180,7 @@ die "access denied" my %opt = @_; my $ratenum = $opt{'ratenum'} || ''; my $regionnum = $opt{'regionnum'} || ''; +my $cdrtypenum = $opt{'cdrtypenum'} || ''; # either of these, if the $opt isn't passed, will be set to the # correct object when generating each row. @@ -202,10 +211,10 @@ if ( $ratenum ) { )"; } @rows = qsearch({ table => 'rate_region', - hashref => { }, + hashref => {}, extra_sql => $where, }); - die "no region found" if !@rows; + #die "no region found" if !@rows; unshift @header, 'Region', 'Prefix(es)'; unshift @hlinks, '', ''; @@ -214,6 +223,7 @@ if ( $ratenum ) { push @details, [ map { qsearchs('rate_detail', { 'ratenum' => $ratenum, 'dest_regionnum' => $region->regionnum, + 'cdrtypenum' => $cdrtypenum, 'ratetimenum' => $_ } ) or '' } @rtns ]; @@ -227,6 +237,7 @@ elsif ( $regionnum ) { push @details, [ map { qsearchs('rate_detail', { 'ratenum' => $rate->ratenum, 'dest_regionnum' => $regionnum, + 'cdrtypenum' => $cdrtypenum, 'ratetimenum' => $_ } ) or '' } @rtns ];