Changes to add classified reasons for payment void
[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>voided 
3 % my $void_user = $cust_pay_void->void_access_user;
4 % if ($void_user) {
5     by <% $void_user->username %>
6 % }
7 % my $reason = $cust_pay_void->reason;
8 % if ($reason) {
9      (<% $reason |h %>)
10 % }
11 <% mt("on [_1]", time2str($date_format, $cust_pay_void->void_date) ) |h %> 
12 </I>
13 <% $unvoid %>
14 <%init>
15
16 my( $cust_pay_void, %opt ) = @_;
17
18 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
19
20 my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
21 $payby = translate_payby($payby,$payinfo);
22 my $info = $payby ? "($payby$payinfo)" : '';
23
24 if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
25   my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay_void->pkgnum } );
26   $info .= ' for '. $cust_pkg->pkg_label_long;
27 }
28
29 my $unvoid = '';
30 my $unvoidmsg = $cust_pay_void->payby =~ /^(CARD|CHEK)$/
31                 ? ' ('.emt('do not send anything to the payment gateway') .')'
32                 : '';
33 $unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->paynum,
34                             emt('Are you sure you want to unvoid this payment?'),
35                             emt('Unvoid this payment from the database') . $unvoidmsg,
36                             emt('unvoid')
37                          )
38   if $cust_pay_void->closed !~ /^Y/i && $opt{'Unvoid payments'};
39
40 </%init>