X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fquick-charge.html;h=0db15433794061c1fe8039ba002ca0cae3755c3d;hb=0dfd49189b0ea878e99f1590a2939e55ab02c89c;hp=466091dfac97173e6faa0625d7cf32ff317943dc;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125;p=freeside.git
diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html
index 466091dfa..0db154337 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 %> |
@@ -206,6 +262,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 %> |
@@ -226,11 +284,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) {
|
@@ -238,21 +292,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++;
% }