X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_bill_pay.cgi;h=f620fc57aaf2a0222690999b144d5e3a908cb3d5;hp=d90659724b1f0dac197f3dfc80a122fe9695d231;hb=c49cfd25a8f92c7a2f44b51d72506a21f6b8d09f;hpb=a4c96748eb6eab29a70f3a944c6520283a635c78 diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi index d90659724..f620fc57a 100755 --- a/httemplate/edit/cust_bill_pay.cgi +++ b/httemplate/edit/cust_bill_pay.cgi @@ -1,96 +1,13 @@ - -<% - -my($paynum, $amount, $invnum); -if ( $cgi->param('error') ) { - $paynum = $cgi->param('paynum'); - $amount = $cgi->param('amount'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $paynum = $1; - $amount = ''; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -print header("Apply Payment", ''); -print qq!Error: !, $cgi->param('error'), - "

" - if $cgi->param('error'); -print < -END - -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); -die "payment $paynum not found!" unless $cust_pay; - -my $unapplied = $cust_pay->unapplied; - -print "Payment # $paynum". - qq!!. - '
Date: '. time2str("%D", $cust_pay->_date). ''. - '
Amount: $'. $cust_pay->paid. ''. - "
Unapplied amount: \$$unapplied" - ; - -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_pay->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 < $unapplied - ? $cust_bill->owed - : $unapplied; - print < -#END -print "\n"; - -print qq!
Invoice #"; - -print qq!
Amount \$!; - -print < - -END - -print < - - -END - -%> +<& elements/ApplicationCommon.html, + 'form_action' => 'process/cust_bill_pay.cgi', + 'src_table' => 'cust_pay', + 'src_thing' => emt('payment'), + 'dst_table' => 'cust_bill', + 'dst_thing' => emt('invoice'), +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Apply payment'); + +