X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fquick-charge.html;h=1d9647f2fa14fb8ac3c7ab1d220b701b05d7e597;hb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;hp=64ad3a2895a26912fd35190d245f02b77035fb89;hpb=06a85a88bfdb0d3fc79ee055eb8327658dfe63ab;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 64ad3a289..1d9647f2f 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -1,24 +1,40 @@ -<% include("/elements/header-popup.html", 'One-time charge', '', +<& /elements/header-popup.html, mt('One-time charge'), '', ( $cgi->param('error') ? '' : 'onload="addRow()"' ), - ) -%> +&> -<% include('/elements/error.html') %> +<& /elements/error.html &> -
+ - + % if ( $conf->exists('invoice-unitprice') ) { - + % } -<% include('/elements/tr-select-pkg_class.html', 'curr_value' => $cgi->param('classnum') ) %> +<& /elements/tr-select-pkg_class.html, 'curr_value' => $cgi->param('classnum') &> - + %# false laziness w/misc/order_pkg.html - + @@ -153,28 +188,42 @@ function bill_now_changed (what) { }); +% if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { +% my $what = lc(FS::payby->shortname($cust_main->payby)); + + + + +% } - + -<% include('/elements/tr-select-taxclass.html', 'curr_value' => $cgi->param('taxclass') ) %> +<& /elements/tr-select-taxclass.html, 'curr_value' => $cgi->param('taxclass') &> -<% include('/elements/tr-select-taxproduct.html', 'label' => 'Tax product', 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') ) %> +<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') &> -<% include('/elements/tr-select-taxoverride.html', 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') ) %> +<& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') &> - + - + % my $row = 0; @@ -186,7 +235,15 @@ function bill_now_changed (what) { % } @@ -196,7 +253,7 @@ function bill_now_changed (what) {
Amount <% mt('Amount') |h %> - $ + <% $money_char %>
Quantity <% mt('Quantity') |h %> - +
Invoice now<% mt('Invoice now') |h %> param('bill_now') ? 'CHECKED' : '' %> + onClick = "bill_now_changed(this);" onChange = "bill_now_changed(this);" > - with terms - <% include('/elements/select-terms.html', + <% mt('with terms') |h %> + <& /elements/select-terms.html, 'curr_value' => scalar($cgi->param('invoice_terms')), 'empty_value' => $default_terms, 'disabled' => ( $cgi->param('bill_now') ? 0 : 1 ), - ) - %> + &>
Charge date <% mt('Charge date') |h %> param('bill_now') ? 'STYLE = "background-color:#dddddd" DISABLED' : '' %> + onKeyPress="return enable_quick_charge(event)" + <% $cgi->param('bill_now') + ? 'STYLE = "background-color:#dddddd" DISABLED' + : '' + %> > param('bill_now') ? '' : 'STYLE="display:none"' %> > - (leave blank to charge immediately) + (<% mt('leave blank to charge immediately') |h %>)
<% mt("Disable automatic $what charge") |h %>
Tax exempt <% mt('Tax exempt') |h %> param('setuptax') ? 'CHECKED' : '' %>>
Description <% mt('Description') |h %> - +
Optional additional description (also printed on invoice): <% mt('Optional additional description (also printed on invoice):') |h %>
- " rownum="<% $row %>" onkeyup = "possiblyAddRow;" > + " + rownum = "<% $row %>" + onKeyPress = "return enable_quick_charge(event)" + onKeyUp = "return possiblyAddRow(event)" + >

-param('error') ? '' :' DISABLED' %>> +param('error') ? '' :' DISABLED' %>>
@@ -205,10 +262,26 @@ function bill_now_changed (what) { var rownum = <% $row %>; - function possiblyAddRow() { + function possiblyAddRow(e) { + if ( ( rownum - this.getAttribute('rownum') ) == 1 ) { addRow(); } + +% if ( $curuser->option('disable_enter_submit_onetimecharge') ) { + + var key; + if (window.event) + key = window.event.keyCode; //IE + else + key = e.which; //firefox, others + + return (key != 13); + +% } else { + return true; +% } + } function addRow() { @@ -223,14 +296,16 @@ function bill_now_changed (what) { var description_cell = document.createElement('TD'); - var description_input = document.createElement('INPUT'); - description_input.setAttribute('name', 'description'+rownum); - description_input.setAttribute('id', 'description'+rownum); - description_input.setAttribute('size', 60); - description_input.setAttribute('maxLength', 65); - description_input.setAttribute('rownum', rownum); - description_input.onkeyup = possiblyAddRow; - description_cell.appendChild(description_input); + //var description_input = document.createElement('INPUT'); + var di = document.createElement('INPUT'); + di.setAttribute('name', 'description'+rownum); + di.setAttribute('id', 'description'+rownum); + di.setAttribute('size', 60); + di.setAttribute('maxLength', 65); + di.setAttribute('rownum', rownum); + di.onkeyup = possiblyAddRow; + di.onkeypress = enable_quick_charge; + description_cell.appendChild(di); row.appendChild(description_cell); @@ -246,11 +321,14 @@ function bill_now_changed (what) { <%init> +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('One-time charge'); + unless $curuser->access_right('One-time charge'); my $conf = new FS::Conf; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; +my $money_char = $conf->config('money_char') || '$'; $cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum'; my $custnum = $1; @@ -276,12 +354,11 @@ my $pkg = $1; my $default_terms; if ( $cust_main->invoice_terms ) { - $default_terms = 'Customer default ('. $cust_main->invoice_terms. ')'; + $default_terms = emt("Customer default ([_1])", $cust_main->invoice_terms); } else { - $default_terms = - 'Default ('. - ($conf->config('invoice_default_terms') || 'Payable upon receipt'). - ')'; + $default_terms = emt("Default ([_1])", + ($conf->config('invoice_default_terms') || emt('Payable upon receipt')) + ); }