Optimize "Customer has a referring customer" condition, RT#74452
[freeside.git] / httemplate / search / report_cust_credit.html
1 <& /elements/header.html, mt($title) &>
2
3 <FORM ACTION="cust_credit.html" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
5 <INPUT TYPE="hidden" NAME="unapplied" VALUE="<% $unapplied %>">
6
7 <TABLE>
8
9   <& /elements/tr-select-user.html,
10                 'label'       => emt('Credits by employee: '),
11                 'access_user' => $access_user,
12   &>
13
14   <& /elements/tr-select-agent.html,
15                  'curr_value'    => scalar( $cgi->param('agentnum') ),
16                  'label'         => emt('for agent: '),
17                  'disable_empty' => 0,
18   &>
19
20   <& /elements/tr-input-beginning_ending.html &>
21
22   <& /elements/tr-input-lessthan_greaterthan.html,
23                 'label' => emt('Amount'),
24                 'field' => 'amount',
25   &>
26
27   <& /elements/tr-checkbox.html,
28        'label' => emt('Show Voided Credits').':',
29        'field' => 'show_voided_credits',
30        'value' => '1',
31   &>
32
33
34 </TABLE>
35
36 <BR>
37 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
38
39 </FORM>
40
41 <& /elements/footer.html &>
42
43 <%init>
44
45 die "access denied"
46   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
47
48 my $access_user = $FS::CurrentUser::CurrentUser->access_users_hashref('table' => 'cust_credit');
49
50 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
51
52 my $title = $cgi->param('unapplied') ?
53               'Unapplied credit report' : 'Credit report';
54
55 </%init>