summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history/refund.html
blob: e82df90dcd667d134aac9f04bdb0d14961e0c454 (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
41
42
43
44
45
46
47
<% $refund %> 
(<% "$payby$payinfo" %>)
<% "$view$email$delete" %>
<%init>

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

my $payby = $cust_refund->payby;
my $payinfo = $payby eq 'CARD'
                ? $cust_refund->paymask
                : $cust_refund->payinfo;
$payby = translate_payby_refund($payby,$payinfo);

my $refund = emt("Refund by [_1]",$cust_refund->otaker);
$refund = '<B><FONT COLOR="#FF0000">' 
    . emt("Unapplied Refund by [_1]",$cust_refund->otaker) 
    . '</FONT></B>' 
    if $cust_refund->unapplied > 0;

my $view =
  ' ('. include('/elements/popup_link.html',
                  'label'     => emt('view receipt'),
                  'action'    => "${p}view/cust_refund.html?link=popup;".
                                 'refundnum='. $cust_refund->refundnum,
                  'actionlabel' => emt('Payment Receipt'),
               ).
   ')';

my $email = $opt{'has_email_address'} ? 
  q! (<A HREF="javascript:void(0)" ONCLICK="areyousure_popup('Send email receipt for refund to customer?','!.
  "${p}view/cust_refund.html?link=email;refundnum=".
  $cust_refund->refundnum.
  q!','Email Refund Receipt')" TITLE="Send email receipt">email&nbsp;receipt</A>)!
  : '';

my $delete = '';
$delete = areyousure_link("${p}misc/delete-cust_refund.cgi?".$cust_refund->refundnum,
                           emt('Are you sure you want to delete this refund?'),
                           emt('Delete this refund from the database completely - not recommended'),
                           emt('delete')
                          ) 
  if $cust_refund->closed !~ /^Y/i
  && $opt{'deleterefunds'} 
  && $opt{'Delete refund'};

</%init>