From d7977d0a346e3e5975c44a75b915bb437be66f4f Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 5 Jun 2008 05:06:36 +0000 Subject: payment and credit applications have separate "apply to refund" choices now, and no auto-refund choice in the invoice dropdown. RT#3545 --- httemplate/edit/cust_credit_bill.cgi | 95 +++--------------------------------- 1 file changed, 8 insertions(+), 87 deletions(-) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 59a74b279..e3627ff37 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,93 +1,14 @@ -<% include('/elements/header-popup.html', 'Apply Credit') %> - -<% include('/elements/error.html') %> - -
- -Credit #<% $crednum %> - - -
Date: <% time2str("%D", $cust_credit->_date) %> - -
Amount: $<% $cust_credit->amount %> - -
Unapplied amount: $<% $credited %> - -
Reason: <% $cust_credit->reason %> - - - -
Invoice # - -
Amount $ - -
-
- -
- - - +<% 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> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Apply credit'); -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); - -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -die "credit $crednum not found!" unless $cust_credit; - -my $credited = $cust_credit->credited; - -my @cust_bill = sort { $a->_date <=> $b->_date - or $a->invnum <=> $b->invnum - } - grep { $_->owed != 0 } - qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); - -- cgit v1.2.1