X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=1ff70009c12f79f95b98be86d74d6fb22036566b;hb=55daa3803103f841d0fb2b559040115908724da8;hp=666ba82de7897de85df3b9daa45beba69b6a6349;hpb=6422e165313ee8d67790007581821217240734fb;p=freeside.git
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index 666ba82de..1ff70009c 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -1,5 +1,5 @@
<& /elements/header-popup.html, mt('One-time charge'), '',
- ( $cgi->param('error') ? '' : 'onload="addRow()"' ),
+ ( ($quotationnum || $cgi->param('error')) ? '' : 'onload="addRow()"' ),
&>
@@ -15,9 +15,9 @@ function enable_quick_charge (e) {
if ( document.QuickChargeForm.amount.value
&& document.QuickChargeForm.pkg.value ) {
- document.QuickChargeForm.submit.disabled = false;
+ document.QuickChargeForm.submitButton.disabled = false;
} else {
- document.QuickChargeForm.submit.disabled = true;
+ document.QuickChargeForm.submitButton.disabled = true;
}
% if ( $curuser->option('disable_enter_submit_onetimecharge') ) {
@@ -97,24 +97,41 @@ function bill_now_changed (what) {
NAME = "QuickChargeForm"
ID = "QuickChargeForm"
METHOD = "POST"
- onSubmit = "document.QuickChargeForm.submit.disabled=true; return validate_quick_charge();"
+ onSubmit = "document.QuickChargeForm.submitButton.disabled=true; return validate_quick_charge();"
>
-
+
+
+
-% if ( $cust_pkg ) {
+% if ( $cust_pkg ) { #modify one-time charge
-<& /elements/tr-fixed.html,
- label => 'Amount',
- field => 'amount',
- value => $money_char . sprintf('%.2f',$part_pkg->option('setup_fee')),
-&>
+% 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') ) {
-<& /elements/tr-fixed.html,
+<& $field,
label => 'Quantity',
field => 'quantity',
value => $cust_pkg->quantity
@@ -137,28 +154,62 @@ function bill_now_changed (what) {
% #display the future or past charge date, but don't allow changes
% # XXX we probably _could_ let as-yet unbilled charges be rescheduled, but
% # there's no compelling need yet
-% if ( $cust_pkg->setup or $cust_pkg->start_date ) {
-% my $label = $cust_pkg->setup ? emt('Billed on') : emt('Will be billed');
-% my $field = $cust_pkg->setup ? 'setup' : 'start_date';
+% if ( $billed ) {
<& /elements/tr-fixed-date.html,
- label => $label,
- value => $cust_pkg->get($field)
+ label => emt('Billed on'),
+ value => $cust_pkg->get('setup')
+ &>
+% } else {
+ <& /elements/tr-input-date-field.html,
+ {
+ name => 'start_date',
+ label => emt('Will be billed'),
+ value => $cust_pkg->get('start_date'),
+ format => $date_format,
+ noinit => 1,
+ }
&>
-% } # else we don't show anything here
+
+ <& /elements/tr-checkbox.html,
+ label => emt('Invoice this charge separately'),
+ field => 'separate_bill',
+ value => 'Y',
+ curr_value => $cust_pkg->get('separate_bill'),
+ &>
+
+ <% mt('Tax exempt') |h %>
+ param('setuptax') ? 'CHECKED' : '' %>>
+
+
+ <& /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') &>
+% }
+
% } else { # new one-time charge
-
- <% mt('Amount') |h %>
-
- <% $money_char %>
-
-
+
+ <% 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') ) {
@@ -175,62 +226,73 @@ function bill_now_changed (what) {
<& /elements/tr-select-pkg_class.html, 'curr_value' => $classnum &>
-
- <% 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 ),
- &>
-
-
+% unless ( $quotationnum ) {
-%# 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 %>)
-
-
+
+ <% 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 ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) {
+
+
+<& /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 %>
@@ -265,13 +327,16 @@ function bill_now_changed (what) {
+% 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 %>
-% my $row = 0;
-% foreach (@description) {
+% foreach (@description) {
@@ -286,8 +351,9 @@ function bill_now_changed (what) {
>
-% $row++;
-% }
+% $row++;
+% }
+% }
@@ -296,7 +362,7 @@ function bill_now_changed (what) {
% my $label = $cust_pkg
% ? emt('Modify one-time charge')
% : emt('Add one-time charge');
-