summaryrefslogtreecommitdiff
path: root/httemplate/edit/part_fee.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/edit/part_fee.html
parent55190e4a18ff318cf2a0ac2eb6abaf7a3b95e087 (diff)
package fees and usage-based fees, #27687, #25899
Diffstat (limited to 'httemplate/edit/part_fee.html')
-rw-r--r--httemplate/edit/part_fee.html44
1 files changed, 29 insertions, 15 deletions
diff --git a/httemplate/edit/part_fee.html b/httemplate/edit/part_fee.html
index b1044c921..e057a752d 100644
--- a/httemplate/edit/part_fee.html
+++ b/httemplate/edit/part_fee.html
@@ -14,13 +14,11 @@
'credit_weight' => 'Credit weight',
'agentnum' => 'Agent',
'amount' => 'Flat fee amount',
- 'percent' => 'Percentage of invoice amount',
'basis' => 'Based on',
'setuprecur' => 'Report this fee as',
'minimum' => 'Minimum fee',
'maximum' => 'Maximum fee',
'limit_credit' => 'Limit to customer credit balance',
- 'nextbill' => 'Hold until the customer\'s next invoice',
%locale_labels
},
'fields' => \@fields,
@@ -56,8 +54,8 @@ my $n = 0;
my (@locale_fields, %locale_labels);
foreach (@locales) {
push @locale_fields,
- { field => 'feepartmsgnum'. $n, type => 'hidden' },
- { field => 'feepartmsgnum'. $n. '_locale', type => 'hidden' },
+ { field => 'feepartmsgnum'. $n, type => 'hidden' },
+ { field => 'feepartmsgnum'. $n. '_locale', type => 'hidden', value => $_ },
{ field => 'feepartmsgnum'. $n. '_itemdesc', type => 'text', size => 40 },
;
$locale_labels{ 'feepartmsgnum'.$n.'_itemdesc' } =
@@ -65,6 +63,19 @@ foreach (@locales) {
$n++;
}
+$n = 0;
+my %layer_fields = (
+ 'charged' => [
+ 'percent' => { label => 'Fraction of invoice total', type => 'percentage', },
+ ],
+ 'owed' => [
+ 'percent' => { label => 'Fraction of balance', type => 'percentage', },
+ ],
+ 'usage' => [
+ 'usage' => { type => 'part_fee_usage' }
+ ],
+);
+
my @fields = (
{ field => 'itemdesc', type => 'text', size => 40, },
@@ -87,11 +98,6 @@ my @fields = (
value => 'Y',
},
- { field => 'nextbill',
- type => 'checkbox',
- value => 'Y',
- },
-
{ field => 'setuprecur',
type => 'select',
options => [ 'setup', 'recur' ],
@@ -101,15 +107,23 @@ my @fields = (
{ type => 'justtitle', value => 'Fee calculation' },
{ field => 'amount', type => 'money', },
- { field => 'percent', type => 'percentage', },
{ field => 'basis',
- type => 'select',
- options => [ 'charged', 'owed' ],
- labels => { 'charged' => 'amount charged',
- 'owed' => 'balance due', },
+ type => 'selectlayers',
+ options => [ 'charged', 'owed', 'usage' ],
+ labels => { 'charged' => 'amount charged',
+ 'owed' => 'balance due',
+ 'usage' => 'usage charges' },
+ layer_fields => \%layer_fields,
+ layer_values_callback => sub {
+ my ($cgi, $obj) = @_;
+ {
+ 'charged' => { percent => $obj->percent },
+ 'owed' => { percent => $obj->percent },
+ 'usage' => { usage => [ $obj->part_fee_usage ] },
+ }
+ },
},
-
{ field => 'minimum', type => 'money', },
{ field => 'maximum', type => 'money', },
{ field => 'limit_credit',