X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=07501a4cf0f075bae1c06d852d36c65d63b9b8ce;hb=c6d8896d882b684b1f3c7a2538a90358b27aaf89;hp=2bbbe43d8fb70db2af68608c9ef607d833e3c0df;hpb=1aecd5bf33146bf3f374341a3814960ae1d419e8;p=freeside.git
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index 2bbbe43d8..07501a4cf 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -1,11 +1,19 @@
-<& /elements/header.html, mt('One-time charge'), '',
- ( ($quotationnum || $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;
@@ -94,13 +102,7 @@ function bill_now_changed (what) {
-% if ( $cust_main ) {
-<& /elements/small_custview.html,
- $cust_main->custnum,
- scalar($conf->config('countrydefault')),
- 1, #no balance
-&>
-% } else {
+% if ( $prospect_main ) {
<& /elements/small_prospect_view.html, $prospect_main &>
% }
@@ -116,7 +118,10 @@ function bill_now_changed (what) {
-
+
+
+<% mt('Charge') |h %>
+
% if ( $cust_pkg ) { #modify one-time charge
@@ -132,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,
@@ -189,7 +194,7 @@ function bill_now_changed (what) {
curr_value => $cust_pkg->get('separate_bill'),
&>
- <% mt('Tax exempt') |h %> |
+ <% mt('Tax exempt') |h %> |
param('setuptax') ? 'CHECKED' : '' %>> |
@@ -199,12 +204,15 @@ function bill_now_changed (what) {
'label' => emt('Tax product'),
'curr_value' => $part_pkg->get('taxproductnum')
&>
-% }
+% }
+
+
+ |
% } 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 %>)
- |
-
-
-
-
-<& /elements/tr-checkbox.html,
- label => emt('Invoice this charge separately'),
- field => 'separate_bill',
- value => 'Y'
-&>
-
-% }
-
-% 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'),
- 'curr_value' => $cgi->param('taxproductnum')
-&>
-
-<& /elements/tr-select-taxoverride.html,
- 'curr_value' => $cgi->param('tax_override')
-&>
-
-% } # if !$cust_pkg
-
- <% mt('Description') |h %> |
+ <% mt('Description') |h %> |
| |
- <% mt('Optional additional description (also printed on invoice):') |h %> |
+ <% mt('Optional additional description (also printed on invoice):') |h %> |
% foreach (@description) {
@@ -375,17 +281,9 @@ function bill_now_changed (what) {
% }
% }
-
-
-% my $label = $cust_pkg
-% ? emt('Modify one-time charge')
-% : emt('Add one-time charge');
-param('error') || $cust_pkg) ? '' :' DISABLED' %>>
-
-
+
-