X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_bill_pay.cgi;h=532db6a6e2d43874bbafd71078f913b828dd7674;hb=8d534e61d74e561a15f0863a835cda4af639a9ea;hp=498d477cde581f07b0a249efb1a9f15e2f2f246b;hpb=3d484726954a5b91bf1f7f7068e7e15c22fade3e;p=freeside.git diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi index 498d477cd..532db6a6e 100755 --- a/httemplate/edit/cust_bill_pay.cgi +++ b/httemplate/edit/cust_bill_pay.cgi @@ -1,85 +1,14 @@ -<% header("Apply Payment", '') %> - -% if ( $cgi->param('error') ) { - Error: <% $cgi->param('error') %> -

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