X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=58c1b0a82785c929c934e229d566afe7fe17d83d;hb=9bac210768d909662b03bc2a6552b92b6651cddf;hp=1d9647f2fa14fb8ac3c7ab1d220b701b05d7e597;hpb=2d57d71025519495dd1cdfca3799a6652c674637;p=freeside.git
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index 1d9647f2f..58c1b0a82 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -100,24 +100,114 @@ function bill_now_changed (what) {
onSubmit = "document.QuickChargeForm.submit.disabled=true; return validate_quick_charge();"
>
-
+
+
+
+% if ( $cust_pkg ) { #modify one-time charge
+
+
+% 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') ) {
+<& $field,
+ label => 'Quantity',
+ field => 'quantity',
+ value => $cust_pkg->quantity
+&>
+% }
+
+<& /elements/tr-select-pkg_class.html, 'curr_value' => $classnum &>
+
+% # crudely estimate whether any agent commission credits might exist
+% my @events = grep { $_->part_event->action =~ /credit/ }
+% $cust_pkg->cust_event;
+% if ( scalar @events ) {
+ |
+
+<% emt('Adjust commission credits if necessary') %>
+ |
+
+% }
+
+% #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 ( $billed ) {
+ <& /elements/tr-fixed-date.html,
+ 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,
+ }
+ &>
+% }
+
+% unless ($billed) {
- <% mt('Amount') |h %> |
-
- <% $money_char %>
- |
+ <% mt('Tax exempt') |h %> |
+ param('setuptax') ? 'CHECKED' : '' %>> |
-% if ( $conf->exists('invoice-unitprice') ) {
+<& /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 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 %> |
@@ -128,67 +218,71 @@ function bill_now_changed (what) {
onKeyPress = "return enable_quick_charge(event)">
|
-% }
+% }
-<& /elements/tr-select-pkg_class.html, 'curr_value' => $cgi->param('classnum') &>
+<& /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')),
- 'empty_value' => $default_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)$/ ) {
+% if ( ! $quotationnum && $cust_main->payby =~ /^(CARD|CHEK)$/ ) {
% my $what = lc(FS::payby->shortname($cust_main->payby));
<% mt("Disable automatic $what charge") |h %> |
@@ -207,6 +301,8 @@ function bill_now_changed (what) {
<& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') &>
+% } # if !$cust_pkg
+
<% mt('Description') |h %> |
@@ -227,11 +323,7 @@ function bill_now_changed (what) {
|
% my $row = 0;
-% if ( $cgi->param('error') || $cgi->param('magic') ) {
-% my $param = $cgi->Vars;
-%
-% for ( $row = 0; exists($param->{"description$row"}); $row++ ) {
-
+% foreach (@description) {
|
@@ -239,21 +331,25 @@ function bill_now_changed (what) {
NAME = "description<% $row %>"
SIZE = "60"
MAXLENGTH = "65"
- VALUE = "<% $param->{"description$row"} |h %>"
+ VALUE = "<% $_ |h %>"
rownum = "<% $row %>"
onKeyPress = "return enable_quick_charge(event)"
onKeyUp = "return possiblyAddRow(event)"
>
|
-% }
+% $row++;
% }