summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-part_fee_usage.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-02-27 14:04:52 -0800
committerMark Wells <mark@freeside.biz>2014-02-27 15:08:21 -0800
commita0e00fa0547e99893c735ab3dbdacdb2bb054f5a (patch)
tree2784c6564ab363606a606fbbac56539006bb16a1 /httemplate/elements/tr-part_fee_usage.html
parent55190e4a18ff318cf2a0ac2eb6abaf7a3b95e087 (diff)
package fees and usage-based fees, #27687, #25899
Diffstat (limited to 'httemplate/elements/tr-part_fee_usage.html')
-rw-r--r--httemplate/elements/tr-part_fee_usage.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/httemplate/elements/tr-part_fee_usage.html b/httemplate/elements/tr-part_fee_usage.html
new file mode 100644
index 000000000..00f4e122a
--- /dev/null
+++ b/httemplate/elements/tr-part_fee_usage.html
@@ -0,0 +1,29 @@
+% my $n = 0;
+% foreach my $class (@classes) {
+% my $pre = "feepartusagenum$n";
+% my $x = $part_fee_usage{$class->classnum} || FS::part_fee_usage->new({});
+<tr>
+ <td align="right">
+ <input type="hidden" name="<%$pre%>" value="<% $x->partfeeusagenum %>">
+ <input type="hidden" name="<%$pre%>_classnum" value="<% $class->classnum %>">
+ <% $class->classname %>:</td>
+ <td>
+ <%$money_char%><input size=4 name="<%$pre%>_amount" \
+ value="<% sprintf("%.2f", $x->amount) %>">
+ </td>
+ <td>per call<b> + </b></td>
+ <td>
+ <input size=4 name="<%$pre%>_percent" \
+ value="<% sprintf("%.1f", $x->percent) %>">%
+ </td>
+</tr>
+% $n++;
+% }
+<%init>
+my %opt = @_;
+my $value = $opt{'curr_value'} || $opt{'value'};
+# values is an arrayref of part_fee_usage objects
+my %part_fee_usage = map { $_->classnum => $_ } @$value;
+my @classes = qsearch('usage_class', { disabled => '' });
+my $money_char = FS::Conf->new->config('money_char') || '$';
+</%init>