X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=2d38203fa63b310a7ec00f8035d170a7137125c6;hp=83620a9737ae67a3a19d457e203d8ead62ba5b77;hb=62157b20f819936d8287f12689c3b5cb34efe7ae;hpb=899cf5029429c1183024cd4bf838573a951d0ede diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 83620a973..2d38203fa 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -1,11 +1,19 @@ -<& /elements/header-popup.html, mt('One-time charge'), '', - ( $cgi->param('error') ? '' : 'onload="addRow()"' ), +% if ( $quotationnum && ! $cust_main ) { +<& /elements/header.html, mt('Quotation #[_1]: add one-time charge', $quotationnum) &> +% } else { +<& /elements/header-cust_main.html, + view => $quotationnum ? 'quotations' : 'packages', + cust_main => $cust_main, + etc => $cgi->param('error') ? '' : 'onload="addRow()"', &> +

<% $quotationnum + ? emt('Quotation #[_1]: add one-time charge', $quotationnum) + : mt('One-time charge') + %>

+% } - - - - +<& /elements/init_calendar.html &> + <& /elements/error.html &> @@ -39,7 +47,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; @@ -93,6 +101,12 @@ function bill_now_changed (what) { +

+% if ( $prospect_main ) { +<& /elements/small_prospect_view.html, $prospect_main &> +% } +

+
- +
% if ( $cust_pkg ) { #modify one-time charge @@ -169,21 +183,30 @@ function bill_now_changed (what) { noinit => 1, } &> -% } - - - - + <& /elements/tr-checkbox.html, + label => emt('Invoice this charge separately'), + field => 'separate_bill', + value => 'Y', + curr_value => $cust_pkg->get('separate_bill'), + &> + + + + -<& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass') &> + <& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass') &> -<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $part_pkg->get('taxproductnum') &> + <& /elements/tr-select-taxproduct.html, + 'label' => emt('Tax product'), + 'curr_value' => $part_pkg->get('taxproductnum') + &> +% } % } else { # new one-time charge - + - + + + - + -<& /elements/tr-select-taxclass.html, 'curr_value' => $cgi->param('taxclass') &> +<& /elements/tr-select-taxclass.html, 'curr_value' => scalar($cgi->param('taxclass')) &> -<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') &> +<& /elements/tr-select-taxproduct.html, + 'label' => emt('Tax product'), + 'curr_value' => scalar($cgi->param('taxproductnum')), +&> -<& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') &> +<& /elements/tr-select-taxoverride.html, + 'curr_value' => scalar($cgi->param('tax_override')), +&> % } # if !$cust_pkg - + +% my $row = 0; +% # quotation details are handled by quotation_pkg_detail records, added via link from view/quotation.html +% # the details below get attached to the part_pkg record, and there's no way to edit that from quotations +% unless ($quotationnum) { -% my $row = 0; -% foreach (@description) { +% foreach (@description) { -% $row++; -% } +% $row++; +% } +% }
<% mt('Tax exempt') |h %> param('setuptax') ? 'CHECKED' : '' %>>
<% mt('Tax exempt') |h %> param('setuptax') ? 'CHECKED' : '' %>>
<% mt('Amount to charge') |h %> <% mt('Amount to charge') |h %> <% $money_char %>exists('invoice-unitprice') ) {
<% mt('Quantity') |h %> <% mt('Quantity') |h %> - <% mt('Invoice now') |h %><% mt('Invoice now') |h %> - <% mt('Charge date') |h %> <% mt('Charge date') |h %> +<& /elements/tr-checkbox.html, + label => emt('Invoice this charge separately'), + field => 'separate_bill', + value => 'Y' +&> + % } % if ( ! $quotationnum && $cust_main->payby =~ /^(CARD|CHEK)$/ ) { @@ -289,20 +318,25 @@ function bill_now_changed (what) { % }
<% mt('Tax exempt') |h %> <% mt('Tax exempt') |h %> param('setuptax') ? 'CHECKED' : '' %>>
<% mt('Description') |h %> <% mt('Description') |h %>
<% mt('Optional additional description (also printed on invoice):') |h %>
@@ -336,8 +373,9 @@ function bill_now_changed (what) { >
@@ -411,8 +449,20 @@ function bill_now_changed (what) { - - +%my %footer_args = ( +% formvalidation => { +% QuickChargeForm => { +% validate_fields => { +% quantity => 'digits: true, min: 1, required: true', +% }, +% }, +% }, +%); +% if ( $quotationnum ) { + <& /elements/footer.html, %footer_args &> +% } else { + <& /elements/footer-cust_main.html, %footer_args &> +% } <%init> my $curuser = $FS::CurrentUser::CurrentUser;