X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=da9ac6e66f9ae4bf7c2285071677390e83626848;hb=c7c96355331687b6fd44bfe541b402bd0664481d;hp=1d9647f2fa14fb8ac3c7ab1d220b701b05d7e597;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index 1d9647f2f..da9ac6e66 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -104,6 +104,62 @@ function bill_now_changed (what) {
+% if ( $cust_pkg ) {
+
+
+% my $field = '/elements/tr-input-text.html';
+% # don't allow changing these after the fact
+% $field = '/elements/tr-fixed.html' if $billed;
+<& $field,
+ label => 'Amount',
+ field => 'amount',
+ value => sprintf('%.2f',$part_pkg->option('setup_fee')),
+ 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,
+ }
+ &>
+% }
+% } else { # new one-time charge
+
<% mt('Amount') |h %> |
@@ -117,7 +173,7 @@ function bill_now_changed (what) {
|
-% if ( $conf->exists('invoice-unitprice') ) {
+% if ( $conf->exists('invoice-unitprice') ) {
<% mt('Quantity') |h %> |
@@ -128,9 +184,9 @@ 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 %> |
@@ -144,9 +200,9 @@ function bill_now_changed (what) {
>
<% 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 ),
+ 'curr_value' => scalar($cgi->param('invoice_terms')),
+ 'disabled' => ( $cgi->param('bill_now') ? 0 : 1 ),
+ 'agentnum' => $cust_main->agentnum,
&>
@@ -207,6 +263,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 +285,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 +293,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++;
% }