X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_credit_bill.cgi;h=26c1126b1f1bd266350e794f037dbbaf229fb30b;hb=6af1b1bfa25e5ececef5e0dcd38b55917121cee2;hp=1a97e1312d6979d631826e30388f612952e551d3;hpb=eb9668a6f3181ee02cb335272c5ee4616e61fd09;p=freeside.git diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 1a97e1312..26c1126b1 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,6 +1,68 @@ - -<% +<% header("Apply Credit", '') %> +% if ( $cgi->param('error') ) { + Error: <% $cgi->param('error') %> +

+% } + +
+ +Credit #<% $crednum %> + + +
Date: <% time2str("%D", $cust_credit->_date) %> + +
Amount: $<% $cust_credit->amount %> + +
Unapplied amount: $<% $credited %> + +
Reason: <% $cust_credit->reason %> + + + +
Invoice # + +
Amount $ + +
+
+ +
+ + + +<%init> my($crednum, $amount, $invnum); if ( $cgi->param('error') ) { #$cust_credit_bill = new FS::cust_credit_bill ( { @@ -23,79 +85,16 @@ my $otaker = getotaker; my $p1 = popurl(1); -print header("Apply Credit", ''); -print qq!Error: !, $cgi->param('error'), - "

" - if $cgi->param('error'); -print < -END - my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); die "credit $crednum not found!" unless $cust_credit; my $credited = $cust_credit->credited; -print "Credit # $crednum". - qq!!. - '
Date: '. time2str("%D", $cust_credit->_date). ''. - '
Amount: $'. $cust_credit->amount. ''. - "
Unapplied amount: \$$credited". - '
Reason: '. $cust_credit->reason. '' - ; - -my @cust_bill = grep $_->owed != 0, +my @cust_bill = sort { $a->_date <=> $b->_date + or $a->invnum <=> $b->invnum + } + grep { $_->owed != 0 } qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); + -print < -function changed(what) { - cust_bill = what.options[what.selectedIndex].value; -END - -foreach my $cust_bill ( @cust_bill ) { - my $invnum = $cust_bill->invnum; - my $changeto = $cust_bill->owed < $cust_credit->credited - ? $cust_bill->owed - : $cust_credit->credited; - print < -END - -print qq!
Invoice #"; - -print qq!
Amount \$!; - -print < - -END - -print < - - -END -%>