RT #25498 adding reason to voided payments and voided invoices on payment history
[freeside.git] / httemplate / view / cust_main / payment_history / voided_payment.html
1 <DEL><% mt("Payment [_1] by [_2]", $info, $cust_pay_void->otaker ) |h %></DEL>
2 <I><% mt("voided ([_1]) [_2]", $cust_pay_void->reason, time2str($date_format, $cust_pay_void->void_date) ) |h %> 
3 % my $void_user = $cust_pay_void->void_access_user;
4 % if ($void_user) {
5     by <% $void_user->username %></I>
6 % }
7 <% $unvoid %>
8 <%init>
9
10 my( $cust_pay_void, %opt ) = @_;
11
12 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
13
14 my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
15 $payby = translate_payby($payby,$payinfo);
16 my $info = $payby ? "($payby$payinfo)" : '';
17
18 if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
19   my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay_void->pkgnum } );
20   $info .= ' for '. $cust_pkg->pkg_label_long;
21 }
22
23 my $unvoid = '';
24 my $unvoidmsg = $cust_pay_void->payby =~ /^(CARD|CHEK)$/
25                 ? ' ('.emt('do not send anything to the payment gateway') .')'
26                 : '';
27 $unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->paynum,
28                             emt('Are you sure you want to unvoid this payment?'),
29                             emt('Unvoid this payment from the database') . $unvoidmsg,
30                             emt('unvoid')
31                          )
32   if $cust_pay_void->closed !~ /^Y/i && $opt{'Unvoid payments'};
33
34 </%init>