X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_credit_bill.cgi;h=e3627ff379fe28c6bc47da23e26c3b8f4f70890b;hp=409ea3c254e98a2e0c39235055e3abf8404d93c7;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=2c757d7db4cb6a7b9655de13206fcc84fb7ce61f diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 409ea3c25..e3627ff37 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,99 +1,14 @@ -<% - -my($crednum, $amount, $invnum); -if ( $cgi->param('error') ) { - #$cust_credit_bill = new FS::cust_credit_bill ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') - #} ); - $crednum = $cgi->param('crednum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $crednum = $1; - $amount = ''; - #$refund = 'yes'; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -%><%= header("Apply Credit", '') %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -

-<% } %> - -
- -<% -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -die "credit $crednum not found!" unless $cust_credit; - -my $credited = $cust_credit->credited; +<% include('elements/ApplicationCommon.html', + 'form_action' => 'process/cust_credit_bill.cgi', + 'src_table' => 'cust_credit', + 'src_thing' => 'credit', + 'dst_table' => 'cust_bill', + 'dst_thing' => 'invoice', + ) %> +<%init> -Credit #<%= $crednum %> - - -
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 } ); - -%> - - - -
Invoice # - -
Amount $ - -
-
- -
+die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Apply credit'); - - +