summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/menu.html4
-rw-r--r--httemplate/elements/rate_tier_detail.html66
-rw-r--r--httemplate/elements/tr-rate_tier_detail.html24
3 files changed, 93 insertions, 1 deletions
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index b29b00595..48270da36 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -25,7 +25,7 @@
% 'style' => 'color:#999999',
% 'actionlabel' => emt('About'),
% 'width' => 300,
-% 'height' => 360,
+% 'height' => 375,
% 'color' => '#7e0079',
% 'scrolling' => 'no',
% );
@@ -503,6 +503,8 @@ tie my %config_billing_rates, 'Tie::IxHash',
'Usage classes' => [ $fsurl.'browse/usage_class.html', 'Usage classes define groups of usage for taxation.' ],
'Time periods' => [ $fsurl.'browse/rate_time.html', 'Time periods define days and hours for rate plans' ],
'Edit rates with Excel' => [ $fsurl.'misc/rate_edit_excel.html', 'Download and edit rates with Excel, then upload changes.' ], #"Edit with Excel" ?
+ 'separator' => '', #its a separator!
+ 'Tiering plans' => [ $fsurl.'browse/rate_tier.html', 'Rating tiers' ],
;
tie my %config_billing, 'Tie::IxHash';
diff --git a/httemplate/elements/rate_tier_detail.html b/httemplate/elements/rate_tier_detail.html
new file mode 100644
index 000000000..ef1f38b8a
--- /dev/null
+++ b/httemplate/elements/rate_tier_detail.html
@@ -0,0 +1,66 @@
+% unless ( $opt{'js_only'} ) {
+
+ <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
+
+ <TABLE>
+ <TR>
+% foreach my $field ( @fields ) {
+%
+% my $value = $rate_tier_detail->get($field);
+
+ <TD>
+ <% $field eq 'min_charge' ? $money_char : '' %>
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_<%$field%>"
+ ID = "<%$id%>_<%$field%>"
+ SIZE = "<% $size{$field} || 15 %>"
+ STYLE = "text-align:right"
+ VALUE = "<% scalar($cgi->param($name."_$field"))
+ || $value |h %>"
+ <% $onchange %>
+ ><BR>
+ <FONT SIZE="-1"><% $label{$field} %></FONT>
+ </TD>
+% }
+ </TR>
+ </TABLE>
+
+% }
+<%init>
+
+my( %opt ) = @_;
+
+my $conf = new FS::Conf;
+my $money_char = $conf->config('money_char') || '$';
+
+my $name = $opt{'element_name'} || $opt{'field'} || 'tierdetailnum';
+my $id = $opt{'id'} || 'tierdetailnum';
+
+my $curr_value = $opt{'curr_value'} || $opt{'value'};
+
+my $onchange = '';
+if ( $opt{'onchange'} ) {
+ $onchange = $opt{'onchange'};
+ $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
+ $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
+ #callbacks should act the same
+ $onchange = 'onChange="'. $onchange. '"';
+}
+
+my $rate_tier_detail;
+if ( $curr_value ) {
+ $rate_tier_detail = qsearchs('rate_tier_detail', { 'tierdetailnum' => $curr_value } );
+} else {
+ $rate_tier_detail = new FS::rate_tier_detail {};
+}
+
+my %size = ( 'title' => 12 );
+
+tie my %label, 'Tie::IxHash',
+ 'min_quan' => 'Minimum quantity',
+ 'min_charge' => 'Charge per minute/call',
+;
+
+my @fields = keys %label;
+
+</%init>
diff --git a/httemplate/elements/tr-rate_tier_detail.html b/httemplate/elements/tr-rate_tier_detail.html
new file mode 100644
index 000000000..7b6f26b57
--- /dev/null
+++ b/httemplate/elements/tr-rate_tier_detail.html
@@ -0,0 +1,24 @@
+% unless ( $opt{'js_only'} ) {
+
+ <% include('tr-td-label.html', %opt) %>
+ <TD <% $cell_style %>>
+
+% }
+%
+ <% include( '/elements/rate_tier_detail.html', %opt ) %>
+%
+% unless ( $opt{'js_only'} ) {
+
+ </TD>
+ </TR>
+
+% }
+<%init>
+
+my( %opt ) = @_;
+
+my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+
+$opt{'label'} ||= 'Tier';
+
+</%init>