projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0eee555
)
rate cost fields, RT#27555
author
Ivan Kohler
<ivan@freeside.biz>
Wed, 28 May 2014 09:32:54 +0000
(
02:32
-0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Wed, 28 May 2014 09:32:54 +0000
(
02:32
-0700)
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/rate_detail.pm
patch
|
blob
|
history
httemplate/browse/rate_region.html
patch
|
blob
|
history
httemplate/edit/elements/rate_detail.html
patch
|
blob
|
history
httemplate/edit/process/rate_region.cgi
patch
|
blob
|
history
httemplate/edit/rate_detail.html
patch
|
blob
|
history
httemplate/misc/process/copy-rate_detail.html
patch
|
blob
|
history
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
360a382
..
71bdec9
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-3326,13
+3326,15
@@
sub tables_hashref {
'dest_regionnum', 'int', '', '', '', '',
'min_included', 'int', '', '', '', '',
'conn_charge', 'decimal', '', '10,4', '0.0000', '',
'dest_regionnum', 'int', '', '', '', '',
'min_included', 'int', '', '', '', '',
'conn_charge', 'decimal', '', '10,4', '0.0000', '',
+ 'conn_cost', 'decimal', '', '10,4', '0.0000', '',
'conn_sec', 'int', '', '', '0', '',
'min_charge', 'decimal', '', '10,5', '', '',
'conn_sec', 'int', '', '', '0', '',
'min_charge', 'decimal', '', '10,5', '', '',
+ 'min_cost', 'decimal', '', '10,5','0.00000', '',
'sec_granularity', 'int', '', '', '', '',
'ratetimenum', 'int', 'NULL', '', '', '',
'classnum', 'int', 'NULL', '', '', '',
'cdrtypenum', 'int', 'NULL', '', '', '',
'sec_granularity', 'int', '', '', '', '',
'ratetimenum', 'int', 'NULL', '', '', '',
'classnum', 'int', 'NULL', '', '', '',
'cdrtypenum', 'int', 'NULL', '', '', '',
- 'region_group',
'char', 'NULL',
1, '', '',
+ 'region_group',
'char', 'NULL',
1, '', '',
],
'primary_key' => 'ratedetailnum',
'unique' => [ [ 'ratenum', 'orig_regionnum', 'dest_regionnum' ] ],
],
'primary_key' => 'ratedetailnum',
'unique' => [ [ 'ratenum', 'orig_regionnum', 'dest_regionnum' ] ],
diff --git
a/FS/FS/rate_detail.pm
b/FS/FS/rate_detail.pm
index
f3ee84c
..
389f439
100644
(file)
--- a/
FS/FS/rate_detail.pm
+++ b/
FS/FS/rate_detail.pm
@@
-130,7
+130,10
@@
sub check {
#|| $self->ut_money('min_charge')
#good enough for now...
#|| $self->ut_money('min_charge')
#good enough for now...
+ || $self->ut_floatn('conn_charge')
+ || $self->ut_floatn('conn_cost')
|| $self->ut_float('min_charge')
|| $self->ut_float('min_charge')
+ || $self->ut_floatn('min_cost')
|| $self->ut_number('sec_granularity')
|| $self->ut_number('sec_granularity')
diff --git
a/httemplate/browse/rate_region.html
b/httemplate/browse/rate_region.html
index
b0ce467
..
962841d
100644
(file)
--- a/
httemplate/browse/rate_region.html
+++ b/
httemplate/browse/rate_region.html
@@
-96,8
+96,9
@@
sub _rate_detail_factory {
my( $rate, $field ) = @_;
return sub {
my $rate_detail = $rate->dest_detail(shift)
my( $rate, $field ) = @_;
return sub {
my $rate_detail = $rate->dest_detail(shift)
- || new FS::rate_
region
{ 'min_included' => 0,
+ || new FS::rate_
detail
{ 'min_included' => 0,
'min_charge' => 0,
'min_charge' => 0,
+ 'min_cost' => 0,
'sec_granularity' => 0,
};
my $value = $rate_detail->$field();
'sec_granularity' => 0,
};
my $value = $rate_detail->$field();
diff --git
a/httemplate/edit/elements/rate_detail.html
b/httemplate/edit/elements/rate_detail.html
index
1b597fb
..
cd3efe1
100644
(file)
--- a/
httemplate/edit/elements/rate_detail.html
+++ b/
httemplate/edit/elements/rate_detail.html
@@
-52,6
+52,9
@@
with row headers showing the region name and prefixes.
<TABLE CLASS="inv" STYLE="border:none">
<TR><TD><% edit_link($detail) %><% $money_char.$detail->min_charge %>
<% $detail->sec_granularity ? ' / minute':' / call' %>
<TABLE CLASS="inv" STYLE="border:none">
<TR><TD><% edit_link($detail) %><% $money_char.$detail->min_charge %>
<% $detail->sec_granularity ? ' / minute':' / call' %>
+% if ( $detail->min_cost ) {
+ (<% $money_char.$detail->min_charge %> cost)
+% }
<% $edit_hint %></A>
</TD></TR>
<% granularity_detail($detail) %>
<% $edit_hint %></A>
</TD></TR>
<% granularity_detail($detail) %>
@@
-92,7
+95,7
@@
sub edit_link {
include( '/elements/popup_link_onclick.html',
'action' => "${p}edit/rate_detail.html?$ratedetailnum",
'actionlabel' => 'Edit rate',
include( '/elements/popup_link_onclick.html',
'action' => "${p}edit/rate_detail.html?$ratedetailnum",
'actionlabel' => 'Edit rate',
- 'height' => 4
2
0,
+ 'height' => 4
6
0,
#default# 'width' => 540,
#default# 'color' => '#333399',
) . '">'
#default# 'width' => 540,
#default# 'color' => '#333399',
) . '">'
@@
-110,7
+113,7
@@
sub add_link {
($rate_time ? $rate_time->ratetimenum : '').
";cdrtypenum=$cdrtypenum",
'actionlabel' => 'Add rate',
($rate_time ? $rate_time->ratetimenum : '').
";cdrtypenum=$cdrtypenum",
'actionlabel' => 'Add rate',
- 'height' => 4
2
0,
+ 'height' => 4
6
0,
).'">'.small('(add)').'</A>'
}
).'">'.small('(add)').'</A>'
}
@@
-157,7
+160,11
@@
sub conn_charge_detail {
#return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec;
'<TR><TD>'.
small( $money_char. $rate_detail->conn_charge.
#return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec;
'<TR><TD>'.
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}
).
'</TD></TR>'
}
).
'</TD></TR>'
}
diff --git
a/httemplate/edit/process/rate_region.cgi
b/httemplate/edit/process/rate_region.cgi
index
d342e60
..
87d634a
100755
(executable)
--- a/
httemplate/edit/process/rate_region.cgi
+++ b/
httemplate/edit/process/rate_region.cgi
@@
-2,7
+2,7
@@
% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
%} elsif ( $action eq 'Add' ) {
% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
%} elsif ( $action eq 'Add' ) {
-<% $cgi->redirect(popurl(2). "rate_region.cgi?$regionnum") %>
+<% $cgi->redirect(popurl(2). "rate_region.cgi?
regionnum=
$regionnum") %>
%} else {
<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
%}
%} else {
<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
%}
diff --git
a/httemplate/edit/rate_detail.html
b/httemplate/edit/rate_detail.html
index
0e40689
..
0de6ecc
100644
(file)
--- a/
httemplate/edit/rate_detail.html
+++ b/
httemplate/edit/rate_detail.html
@@
-8,10
+8,12
@@
'rate_time_name' => 'Time period',
'min_included' => 'Included minutes/calls',
'region_group' => 'Region Group',
'rate_time_name' => 'Time period',
'min_included' => 'Included minutes/calls',
'region_group' => 'Region Group',
- 'conn_charge' => '
C
onnection charge',
+ 'conn_charge' => '
Retail c
onnection charge',
'conn_sec' => 'For',
'conn_sec' => 'For',
- 'min_charge' => '
C
harge per minute/call',
+ 'min_charge' => '
Retail c
harge per minute/call',
'sec_granularity' => 'Granularity',
'sec_granularity' => 'Granularity',
+ 'conn_cost' => 'Wholesale connection cost',
+ 'min_cost' => 'Wholesale cost per minute/call',
'classnum' => 'Usage class',
},
'fields' => [
'classnum' => 'Usage class',
},
'fields' => [
@@
-29,6
+31,7
@@
},
{ field=>'min_included', type=>'text', size=>5 },
{ field=>'conn_charge', type=>'money', size=>4 },
},
{ field=>'min_included', type=>'text', size=>5 },
{ field=>'conn_charge', type=>'money', size=>4 },
+ { field=>'conn_cost', type=>'money', size=>4 },
{ field =>'conn_sec',
type =>'select',
options => [ keys %conn_secs ],
{ field =>'conn_sec',
type =>'select',
options => [ keys %conn_secs ],
@@
-36,6
+39,7
@@
disable_empty => 1,
},
{ field=>'min_charge', type=>'money', size=>4 },
disable_empty => 1,
},
{ field=>'min_charge', type=>'money', size=>4 },
+ { field=>'min_cost', type=>'money', size=>4 },
{ field =>'sec_granularity',
type =>'select',
options => [ keys %granularity ],
{ field =>'sec_granularity',
type =>'select',
options => [ keys %granularity ],
diff --git
a/httemplate/misc/process/copy-rate_detail.html
b/httemplate/misc/process/copy-rate_detail.html
index
60b2aeb
..
94acce0
100644
(file)
--- a/
httemplate/misc/process/copy-rate_detail.html
+++ b/
httemplate/misc/process/copy-rate_detail.html
@@
-47,7
+47,8
@@
foreach my $countrycode ( @countrycodes ) {
|| new FS::rate_detail \%hash;
$dst_rate_detail->$_( $src_rate_detail->get($_) )
|| new FS::rate_detail \%hash;
$dst_rate_detail->$_( $src_rate_detail->get($_) )
- foreach qw( min_included conn_charge conn_sec min_charge sec_granularity classnum );
+ foreach qw( min_included conn_charge conn_sec min_charge sec_granularity
+ conn_cost min_cost classnum );
my $method = $dst_rate_detail->ratedetailnum ? 'replace' : 'insert';
my $method = $dst_rate_detail->ratedetailnum ? 'replace' : 'insert';