X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_credit_bill.cgi;h=3748202a56598952a869c45f3caa6b5d896e686a;hp=a0073494945a5cf272fba278d0fa90935d02d043;hb=1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39;hpb=ea0d3938b57a079ce4aa6db0cae316e3ac6da654 diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index a00734949..3748202a5 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,21 +1,7 @@ + <% -# - -use strict; -use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $amount $reason $cust_credit ); -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); -use FS::cust_credit; -use FS::cust_bill; - - -$cgi = new CGI; -cgisuidsetup($cgi); +my($crednum, $amount, $invnum); if ( $cgi->param('error') ) { #$cust_credit_bill = new FS::cust_credit_bill ( { # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') @@ -25,7 +11,7 @@ if ( $cgi->param('error') ) { #$refund = $cgi->param('refund'); $invnum = $cgi->param('invnum'); } else { - ($query) = $cgi->keywords; + my($query) = $cgi->keywords; $query =~ /^(\d+)$/; $crednum = $1; $amount = ''; @@ -33,9 +19,9 @@ if ( $cgi->param('error') ) { $invnum = ''; } -$otaker = getotaker; +my $otaker = getotaker; -$p1 = popurl(1); +my $p1 = popurl(1); print header("Apply Credit", ''); print qq!Error: !, $cgi->param('error'), @@ -45,7 +31,8 @@ print < END -die unless $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +die "credit $crednum not found!" unless $cust_credit; my $credited = $cust_credit->credited;