summaryrefslogtreecommitdiff
path: root/httemplate/edit/quick-charge.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-12-12 19:20:22 -0800
committerIvan Kohler <ivan@freeside.biz>2014-12-12 19:20:22 -0800
commit2457752a82358108aa078f175a4e866f1786299a (patch)
tree549de3733498a617765abaa38d7ec877c79c1bbd /httemplate/edit/quick-charge.html
parente2213aaeab76983c26d92c1e1d928fe4e062accf (diff)
costs for one-time charges, RT#31429
Diffstat (limited to 'httemplate/edit/quick-charge.html')
-rw-r--r--httemplate/edit/quick-charge.html60
1 files changed, 43 insertions, 17 deletions
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index da9ac6e66..ec1a58046 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -111,13 +111,23 @@ function bill_now_changed (what) {
% # don't allow changing these after the fact
% $field = '/elements/tr-fixed.html' if $billed;
<& $field,
- label => 'Amount',
- field => 'amount',
- value => sprintf('%.2f',$part_pkg->option('setup_fee')),
- size => 8,
- prefix => $money_char,
+ label => mt('Amount to charge'),
+ field => 'amount',
+ value => sprintf('%.2f',$part_pkg->option('setup_fee')),
+ size => 8,
+ prefix => $money_char,
&>
+% if ( $curuser->access_right('Edit package definition costs') ) {
+ <& $field,
+ label => mt('Cost'),
+ field => 'setup_cost',
+ value => sprintf('%.2f',$part_pkg->setup_cost),
+ size => 8,
+ prefix => $money_char,
+ &>
+% }
+
% if ( $conf->exists('invoice-unitprice') ) {
<& $field,
label => 'Quantity',
@@ -158,20 +168,31 @@ function bill_now_changed (what) {
}
&>
% }
+
% } else { # new one-time charge
-<TR>
- <TD ALIGN="right"><% mt('Amount') |h %> </TD>
- <TD>
- <% $money_char %><INPUT TYPE = "text"
- NAME = "amount"
- SIZE = 6
- VALUE = "<% $amount %>"
- onChange = "return enable_quick_charge(event)"
- onKeyPress = "return enable_quick_charge(event)"
- >
- </TD>
-</TR>
+ <TR>
+ <TD ALIGN="right"><% mt('Amount to charge') |h %> </TD>
+ <TD>
+ <% $money_char %><INPUT TYPE = "text"
+ NAME = "amount"
+ SIZE = 8
+ VALUE = "<% $amount %>"
+ onChange = "return enable_quick_charge(event)"
+ onKeyPress = "return enable_quick_charge(event)"
+ >
+ </TD>
+ </TR>
+
+% if ( $curuser->access_right('Edit package definition costs') ) {
+ <& /elements/tr-input-text.html,
+ label => mt('Cost'),
+ field => 'setup_cost',
+ value => $setup_cost,
+ size => 8,
+ prefix => $money_char,
+ &>
+% }
% if ( $conf->exists('invoice-unitprice') ) {
<TR>
@@ -417,6 +438,11 @@ if ( $cgi->param('amount') =~ /^\s*\$?\s*(\d+(\.\d{1,2})?)\s*$/ ) {
$amount = $1;
}
+my $setup_cost = '';
+if ( $cgi->param('setup_cost') =~ /^\s*\$?\s*(\d+(\.\d{1,2})?)\s*$/ ) {
+ $setup_cost = $1;
+}
+
my $quantity = 1;
if ( $cgi->param('quantity') =~ /^\s*(\d+)\s*$/ ) {
$quantity = $1;