RT#38533: One click re-send refund,payment receipt, invoice
[freeside.git] / httemplate / view / cust_main / payment_history / refund.html
1 <% $refund %> 
2 (<% "$payby$payinfo" %>)
3 <% "$view$email$delete" %>
4 <%init>
5
6 my( $cust_refund, %opt ) = @_;
7
8 my $payby = $cust_refund->payby;
9 my $payinfo = $payby eq 'CARD'
10                 ? $cust_refund->paymask
11                 : $cust_refund->payinfo;
12 $payby = translate_payby_refund($payby,$payinfo);
13
14 my $refund = emt("Refund by [_1]",$cust_refund->otaker);
15 $refund = '<B><FONT COLOR="#FF0000">' 
16     . emt("Unapplied Refund by [_1]",$cust_refund->otaker) 
17     . '</FONT></B>' 
18     if $cust_refund->unapplied > 0;
19
20 my $view =
21   ' ('. include('/elements/popup_link.html',
22                   'label'     => emt('view receipt'),
23                   'action'    => "${p}view/cust_refund.html?link=popup;".
24                                  'refundnum='. $cust_refund->refundnum,
25                   'actionlabel' => emt('Payment Receipt'),
26                ).
27    ')';
28
29 my $email = $opt{'has_email_address'} ? 
30   q! (<A HREF="javascript:void(0)" ONCLICK="areyousure_popup('Send email receipt for refund to customer?','!.
31   "${p}view/cust_refund.html?link=email;refundnum=".
32   $cust_refund->refundnum.
33   q!','Email Refund Receipt')" TITLE="Send email receipt">email&nbsp;receipt</A>)!
34   : '';
35
36 my $delete = '';
37 $delete = areyousure_link("${p}misc/delete-cust_refund.cgi?".$cust_refund->refundnum,
38                            emt('Are you sure you want to delete this refund?'),
39                            emt('Delete this refund from the database completely - not recommended'),
40                            emt('delete')
41                           ) 
42   if $cust_refund->closed !~ /^Y/i
43   && $opt{'deleterefunds'} 
44   && $opt{'Delete refund'};
45
46 </%init>
47