From 54c73b7ed85f88ef688f68ef8e1b0961dec14f0c Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 9 Dec 2005 16:58:40 +0000 Subject: [PATCH] fill in reason if empty when applying a credit to a refund --- httemplate/edit/process/cust_credit_bill.cgi | 5 +++-- httemplate/view/cust_main/payment_history.html | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi index 23e2e6ce5..28f892f62 100755 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ b/httemplate/edit/process/cust_credit_bill.cgi @@ -14,11 +14,12 @@ my $custnum = $cust_main->custnum; my $new; if ($cgi->param('invnum') =~ /^Refund$/) { $new = new FS::cust_refund ( { - 'reason' => $cust_credit->reason, + 'reason' => ( $cust_credit->reason || 'refund from credit' ), 'refund' => $cgi->param('amount'), 'payby' => 'BILL', #'_date' => $cgi->param('_date'), - 'payinfo' => 'Cash', + #'payinfo' => 'Cash', + 'payinfo' => 'Refund', 'crednum' => $crednum, } ); } else { diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 0eef2ad1c..ec99b8c54 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -229,11 +229,24 @@ foreach my $cust_pay_void ($cust_main->cust_pay_void) { $payby =~ s/^(CARD|COMP)$/$1 /; my $info = $payby ? " ($payby$payinfo)" : ''; + my $unvoid = ''; + if ( $cust_pay_void->closed !~ /^Y/i && $conf->exists('unvoid') ) { + $unvoid = qq! (unvoid)!; + } + push @history, { 'date' => $cust_pay_void->_date, 'desc' => "Payment $info voided ". time2str("%D", $cust_pay_void->void_date). - " by ". $cust_pay_void->otaker. '', + " by ". $cust_pay_void->otaker. ''. $unvoid, 'void_payment' => $cust_pay_void->paid, }; @@ -313,7 +326,10 @@ foreach my $cust_credit ($cust_main->cust_credit) { push @history, { 'date' => $cust_credit->_date, 'desc' => $pre. "Credit$post by ". $cust_credit->otaker. - ' ('. $cust_credit->reason. ')'. + ( $cust_credit->reason + ? ' ('. $cust_credit->reason. ')' + : '' + ). "$desc$apply$delete$unapply", 'credit' => $cust_credit->amount, }; -- 2.11.0