X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_credit_bill.cgi;h=13bad185208dbfaad5e05971612f09107c8caa04;hp=c4cd34eab89be8e7ec9499f3d78fe6b27145ac72;hb=fbcb45dfe5a1bce7981fe4527176b9fdf2ec54b7;hpb=33204e66fb11e9e551b95e8656d088506745e361 diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index c4cd34eab..13bad1852 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,11 +1,12 @@ <% -# +# use strict; -use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $_date $amount $reason $cust_credit ); +use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $amount $reason $cust_credit ); use Date::Format; use CGI; use CGI::Carp qw(fatalsToBrowser); +use Date::Format; use FS::UID qw(cgisuidsetup getotaker); use FS::CGI qw(header popurl); use FS::Record qw(qsearch fields); @@ -32,7 +33,6 @@ if ( $cgi->param('error') ) { #$refund = 'yes'; $invnum = ''; } -$_date = time; $otaker = getotaker; @@ -44,31 +44,65 @@ print qq!Error: !, $cgi->param('error'), if $cgi->param('error'); print < -
 END
 
 die unless $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } );
 
-print qq!Credit #!, $crednum, qq!!;
+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, + qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); + +print < +function changed(what) { + cust_bill = what.options[what.selectedIndex].value; +END -print qq!\nInvoice # "; -print qq!\nDate: !, time2str("%D",$_date), qq!!; +print < +END -print qq!\nAmount \$!; +print qq!
Invoice #"; -#print qq! Also post refund!; +print qq!
Amount \$!; print <
-
+ END print <