From e774555a6ae69da65e7774c701232fdf9dd052b1 Mon Sep 17 00:00:00 2001 From: levinse Date: Fri, 29 Apr 2011 12:12:45 +0000 Subject: apply discount to setup fees, part 1 of 2, RT11512 --- httemplate/edit/discount.html | 2 ++ httemplate/edit/process/cust_pkg_discount.html | 1 + httemplate/edit/process/quick-cust_pkg.cgi | 1 + httemplate/elements/tr-select-discount.html | 19 +++++++++++++++++++ 4 files changed, 23 insertions(+) (limited to 'httemplate') diff --git a/httemplate/edit/discount.html b/httemplate/edit/discount.html index 6e0d8e1a7..b195eb37b 100644 --- a/httemplate/edit/discount.html +++ b/httemplate/edit/discount.html @@ -21,6 +21,7 @@ { field => 'months', type => 'text', size => 2, postfix => '
(blank for non-expiring discount)', }, + { field => 'setup', type => 'checkbox', value=>'Y', }, ], 'labels' => { 'discountnum' => 'Discount #', @@ -30,6 +31,7 @@ 'amount' => 'Amount ', 'percent' => 'Percentage ', 'months' => 'Duration (months)', + 'setup' => 'Apply to setup fees', }, 'viewall_dir' => 'browse', 'new_callback' => $new_callback, diff --git a/httemplate/edit/process/cust_pkg_discount.html b/httemplate/edit/process/cust_pkg_discount.html index ad9842a89..6f97a791e 100644 --- a/httemplate/edit/process/cust_pkg_discount.html +++ b/httemplate/edit/process/cust_pkg_discount.html @@ -39,6 +39,7 @@ my $cust_pkg_discount = new FS::cust_pkg_discount { 'amount' => scalar($cgi->param('discountnum_amount')), 'percent' => scalar($cgi->param('discountnum_percent')), 'months' => scalar($cgi->param('discountnum_months')), + 'setup' => scalar($cgi->param('discountnum_setup')), #'disabled' => $self->discountnum_disabled, }; my $error = $cust_pkg_discount->insert; diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index bf5087c5e..4ab56e19a 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -91,6 +91,7 @@ my $cust_pkg = new FS::cust_pkg { 'discountnum_amount' => scalar($cgi->param('discountnum_amount')), 'discountnum_percent' => scalar($cgi->param('discountnum_percent')), 'discountnum_months' => scalar($cgi->param('discountnum_months')), + 'discountnum_setup' => scalar($cgi->param('discountnum_setup')), 'contract_end' => ( scalar($cgi->param('contract_end')) ? parse_datetime($cgi->param('contract_end')) : '' diff --git a/httemplate/elements/tr-select-discount.html b/httemplate/elements/tr-select-discount.html index 258eeb349..e8be3938c 100644 --- a/httemplate/elements/tr-select-discount.html +++ b/httemplate/elements/tr-select-discount.html @@ -64,6 +64,16 @@ ) %> + <% include( '/elements/tr-checkbox.html', + 'label' => 'Apply discount to setup fee', + 'field' => $name.'_setup', + 'id' => $name.'_setup', + 'curr_value' => scalar($cgi->param($name.'_setup')), + 'value' => 'Y', + 'colspan' => $opt{'colspan'}, + ) + %> +