summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/payment_history/refund.html
blob: 4a48fea1e3288847bf44e5ab284984943e98319f (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
48
49
50
<% $pre %>Refund<% $post %>
(<% $payby. $payinfo %>)
by <% $cust_refund->otaker %><% $view %><% $delete %>
<%init>

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

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

my $payby = $cust_refund->payby;
my $payinfo = $payby eq 'CARD'
                ? $cust_refund->paymask
                : $cust_refund->payinfo;

$payby =~ s/^BILL$/Check #/ if $payinfo;
$payby =~ s/^BILL$/Check/;
$payby =~ s/^CHEK$/Electronic check /;
$payby =~ s/^(CARD|COMP)$/$1 /;

my($pre, $post) = ('', '');
if ( $cust_refund->unapplied > 0 ) {
  $pre = '<B><FONT COLOR="#FF0000">Unapplied ';
  $post = '</FONT></B>';
}

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


my $delete = '';
if ( $cust_refund->closed !~ /^Y/i
     && $opt{'deleterefunds'}
     && $curuser->access_right('Delete refund')
   )
{
  $delete = qq! (<A HREF="javascript:areyousure('!.
            qq!${p}misc/delete-cust_refund.cgi?!. $cust_refund->refundnum.
            qq!', 'Are you sure you want to delete this refund?')"!.
            qq! TITLE="Delete this refund from the database completely - not recommended"!.
            qq!>delete</A>)!;
}

</%init>