summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history/voided_payment.html
blob: 2f038be41b3f26136d28f0663f34b5318f862167 (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
<DEL><% mt("Payment [_1] by [_2]", $info, $cust_pay_void->otaker ) |h %></DEL>
<I><% mt("voided [_1]", time2str($date_format, $cust_pay_void->void_date) ) |h %> 
% my $void_user = $cust_pay_void->void_access_user;
% if ($void_user) {
    by <% $void_user->username %></I>
% }
<% $unvoid %>
<%init>

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

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

my $curuser = $FS::CurrentUser::CurrentUser;

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 && $curuser->access_right('Unvoid') );

</%init>