X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=07501a4cf0f075bae1c06d852d36c65d63b9b8ce;hp=83620a9737ae67a3a19d457e203d8ead62ba5b77;hb=833cfe5c9938d33c3e6b97ed610c25a7afa6eb04;hpb=5b884dd940f7dce415ba77dcbc2ab6840f0b5673 diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 83620a973..07501a4cf 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 &> +% } +

+
- +
+ +<% mt('Charge') |h %> + % if ( $cust_pkg ) { #modify one-time charge @@ -120,15 +137,15 @@ function bill_now_changed (what) { 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 ( $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, @@ -169,21 +186,33 @@ 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') + &> +% } + +
<% mt('Tax exempt') |h %> param('setuptax') ? 'CHECKED' : '' %>>
<% mt('Tax exempt') |h %> param('setuptax') ? 'CHECKED' : '' %>>
+
% } else { # new one-time charge - <% mt('Amount to charge') |h %> + <% mt('Amount to charge') |h %> <% $money_char %> -% 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') ) { - <% mt('Quantity') |h %> + <% mt('Quantity') |h %> $classnum &> -% unless ( $quotationnum ) { - - - <% 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, - &> - - - -% # false laziness w/misc/order_pkg.html - - <% 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 %>) - - - - - -% } - -% if ( ! $quotationnum && $cust_main->payby =~ /^(CARD|CHEK)$/ ) { -% my $what = lc(FS::payby->shortname($cust_main->payby)); - - <% mt("Disable automatic $what charge") |h %> - - -% } - - <% mt('Tax exempt') |h %> - param('setuptax') ? 'CHECKED' : '' %>> - - -<& /elements/tr-select-taxclass.html, 'curr_value' => $cgi->param('taxclass') &> - -<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') &> - -<& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') &> - -% } # if !$cust_pkg - - - <% mt('Description') |h %> + <% mt('Description') |h %> +% 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) { - <% mt('Optional additional description (also printed on invoice):') |h %> + <% mt('Optional additional description (also printed on invoice):') |h %> -% my $row = 0; -% foreach (@description) { +% foreach (@description) { @@ -336,20 +277,13 @@ function bill_now_changed (what) { > -% $row++; -% } - +% $row++; +% } +% } -
-% my $label = $cust_pkg -% ? emt('Modify one-time charge') -% : emt('Add one-time charge'); -param('error') || $cust_pkg) ? '' :' DISABLED' %>> - -
+ - - + + + + Taxation + + + + + + + + <& /elements/tr-select-taxclass.html, 'curr_value' => scalar($cgi->param('taxclass')) &> + + <& /elements/tr-select-taxproduct.html, + 'label' => emt('Tax product'), + 'curr_value' => scalar($cgi->param('taxproductnum')), + &> + + <& /elements/tr-select-taxoverride.html, + 'curr_value' => scalar($cgi->param('tax_override')), + &> + +
<% mt('Tax exempt') |h %> param('setuptax') ? 'CHECKED' : '' %>>
+ +% if ( $curuser->access_right('Edit package definition costs') ) { + +
+ <% mt('Cost Accounting') |h %> + + + <& /elements/tr-input-text.html, + label => mt('Cost'), + field => 'setup_cost', + value => $setup_cost, + size => 8, + prefix => $money_char, + &> + +
+ +% } + + + + + + + +% if ( $curuser->access_right('Discount customer package') ) { +
+ <% mt('Discounting') |h %> + + <& /elements/tr-select-pkg-discount.html, + 'setup_label' => emt('Discount'), + 'disable_recur' => 1, + 'disable_waive_setup' => 1, + &> +
+% } + + +% unless ( $quotationnum ) { + +
+ <% mt('Invoicing') |h %> + + + + + + + +% # false laziness w/misc/order_pkg.html + + + + + + + + <& /elements/tr-checkbox.html, + label => emt('Invoice this charge separately'), + field => 'separate_bill', + value => 'Y' + &> + +% if ( $cust_main->has_cust_payby_auto ) { +% my $what = lc(FS::payby->shortname($cust_main->payby)); + + + + +% } + +
<% 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 %>
+ +% } + +% } # if !$cust_pkg + +
+% my $label = $cust_pkg +% ? emt('Modify one-time charge') +% : emt('Add one-time charge'); +param('error') || $cust_pkg) ? '' :' DISABLED' %>> + + + +%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;