summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history/voided_payment.html
blob: e295f9b3b93ec85dc697f396ac9487289eef543a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<DEL><% mt("Payment [_1] by [_2]", $info, $cust_pay_void->otaker ) |h %></DEL>
<I>voided 
% my $void_user = $cust_pay_void->void_access_user;
% if ($void_user) {
    by <% $void_user->username %>
% }
% my $reason = $cust_pay_void->reason;
% if ($reason) {
     (<% $reason |h %>)
% }
<% mt("on [_1]", time2str($date_format, $cust_pay_void->void_date) ) |h %> 
</I>
<% $unvoid %>
<%init>

my( $cust_pay_void, %opt ) = @_;

my $date_format = $opt{'date_format'} || '%m/%d/%Y';

my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
$payby = translate_payby($payby,$payinfo);
my $info = $payby ? "($payby$payinfo)" : '';

if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
  my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay_void->pkgnum } );
  $info .= ' for '. $cust_pkg->pkg_label_long;
}

my $unvoid = '';
my $unvoidmsg = $cust_pay_void->payby =~ /^(CARD|CHEK)$/
                ? ' ('.emt('do not send anything to the payment gateway') .')'
                : '';
$unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->paynum,
                            emt('Are you sure you want to unvoid this payment?'),
                            emt('Unvoid this payment from the database') . $unvoidmsg,
                            emt('unvoid')
                         )
  if $cust_pay_void->closed !~ /^Y/i && $opt{'Unvoid payments'};

</%init>