X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=inline;f=httemplate%2Fedit%2Fquick-charge.html;h=379aaaea44004320699309438cee53f054673086;hb=30026a09a72bb16b8c7e17035250b9d797bd47e2;hp=466091dfac97173e6faa0625d7cf32ff317943dc;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 466091dfa..379aaaea4 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -1,11 +1,12 @@ <& /elements/header-popup.html, mt('One-time charge'), '', - ( $cgi->param('error') ? '' : 'onload="addRow()"' ), + ( ($quotationnum || $cgi->param('error')) ? '' : 'onload="addRow()"' ), &> + <& /elements/error.html &> @@ -39,7 +40,7 @@ function enable_quick_charge (e) { function validate_quick_charge () { var pkg = document.QuickChargeForm.pkg.value; - var pkg_regex = /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]]*)$/ ; + var pkg_regex = XRegExp('^([\\p{L}\\p{N} \_\!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\\[\\]]*)$'); var amount = document.QuickChargeForm.amount.value; var amount_regex = /^\s*\$?\s*(\d*(\.?\d{1,2}))\s*$/ ; var rval = true; @@ -100,24 +101,118 @@ function bill_now_changed (what) { onSubmit = "document.QuickChargeForm.submit.disabled=true; return validate_quick_charge();" > - + + +
<% mt('Amount') |h %> | -- <% $money_char %> - | +% if ( $cust_pkg ) { #modify one-time charge + + +% my $field = '/elements/tr-input-text.html'; +% # don't allow changing these after the fact +% $field = '/elements/tr-fixed.html' if $billed; +<& $field, + 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', + field => 'quantity', + value => $cust_pkg->quantity +&> +% } + +<& /elements/tr-select-pkg_class.html, 'curr_value' => $classnum &> + +% # crudely estimate whether any agent commission credits might exist +% my @events = grep { $_->part_event->action =~ /credit/ } +% $cust_pkg->cust_event; +% if ( scalar @events ) { +
+ | +<% emt('Adjust commission credits if necessary') %> + |
<% mt('Tax exempt') |h %> | +param('setuptax') ? 'CHECKED' : '' %>> | +
<% mt('Amount to charge') |h %> | ++ <% $money_char %> + | +
<% mt('Quantity') |h %> | @@ -128,66 +223,77 @@ function bill_now_changed (what) { onKeyPress = "return enable_quick_charge(event)"> |
<% mt('Invoice now') |h %> | -- param('bill_now') ? 'CHECKED' : '' %> - onClick = "bill_now_changed(this);" - onChange = "bill_now_changed(this);" - > - <% mt('with terms') |h %> - <& /elements/select-terms.html, - 'curr_value' => scalar($cgi->param('invoice_terms')), - 'disabled' => ( $cgi->param('bill_now') ? 0 : 1 ), - &> - | -
<% mt('Charge date') |h %> | -- param('bill_now') - ? 'STYLE = "background-color:#dddddd" DISABLED' - : '' - %> - > - - param('bill_now') ? '' : 'STYLE="display:none"' %> - > - (<% mt('leave blank to charge immediately') |h %>) - | -
<% mt('Invoice now') |h %> | ++ param('bill_now') ? 'CHECKED' : '' %> + onClick = "bill_now_changed(this);" + onChange = "bill_now_changed(this);" + > + <% mt('with terms') |h %> + <& /elements/select-terms.html, + 'curr_value' => scalar($cgi->param('invoice_terms')), + 'disabled' => ( $cgi->param('bill_now') ? 0 : 1 ), + 'agentnum' => $cust_or_prospect->agentnum, + &> + | +
<% mt('Charge date') |h %> | ++ param('bill_now') + ? 'STYLE = "background-color:#dddddd" DISABLED' + : '' + %> + > + + param('bill_now') ? '' : 'STYLE="display:none"' %> + > + (<% mt('leave blank to charge immediately') |h %>) + | +
<% mt("Disable automatic $what charge") |h %> | @@ -206,6 +312,8 @@ function bill_now_changed (what) { <& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') &> +% } # if !$cust_pkg +|
<% mt('Description') |h %> | @@ -220,17 +328,16 @@ function bill_now_changed (what) { |
<% mt('Optional additional description (also printed on invoice):') |h %> | |
@@ -238,21 +345,26 @@ function bill_now_changed (what) { NAME = "description<% $row %>" SIZE = "60" MAXLENGTH = "65" - VALUE = "<% $param->{"description$row"} |h %>" + VALUE = "<% $_ |h %>" rownum = "<% $row %>" onKeyPress = "return enable_quick_charge(event)" onKeyUp = "return possiblyAddRow(event)" > |