1 | {% extends "base.html" %} |
---|
2 | {% load misc %} |
---|
3 | |
---|
4 | {% block title %}List reimbursement requests{% endblock %} |
---|
5 | {% block content %} |
---|
6 | |
---|
7 | <h2>List Reimbursement Requests</h2> |
---|
8 | |
---|
9 | {%if useronly%} |
---|
10 | <p>Displaying only vouchers related to you.</p> |
---|
11 | {%else%} |
---|
12 | <p>You have permission to list all vouchers.</p> |
---|
13 | {%endif%} |
---|
14 | |
---|
15 | <form method='get' action=''> |
---|
16 | <h3>Filter and Sort</h3> |
---|
17 | |
---|
18 | <table class='pretty-table'> |
---|
19 | <tr> |
---|
20 | <th>Approval Status</th> |
---|
21 | <td><select name='approval_status'> |
---|
22 | <option value='all'{%ifequal approval_status "all"%} selected='selected'{%endifequal%}>All</option> |
---|
23 | {% for id,label in approval_states %} |
---|
24 | <option value='{{id}}'{%ifequal approval_status id%} selected='selected'{%endifequal%}>{{label}}</option> |
---|
25 | {% endfor %} |
---|
26 | </select></td> |
---|
27 | </tr> |
---|
28 | <tr> |
---|
29 | <th>Order</th> |
---|
30 | <td><select name='order'> |
---|
31 | {% for name,label,cols in orders %} |
---|
32 | <option value='{{name}}'{%ifequal order name%} selected='selected'{%endifequal%}>{{label}}</option> |
---|
33 | {% endfor %} |
---|
34 | </select></td> |
---|
35 | </tr> |
---|
36 | <tr> |
---|
37 | <th colspan='2'><input type='submit' name='submit' value='Submit' /></th> |
---|
38 | </tr> |
---|
39 | </table> |
---|
40 | </form> |
---|
41 | |
---|
42 | <p><br /></p> |
---|
43 | |
---|
44 | <form method='post' action=''> |
---|
45 | <h3>Request List</h3> |
---|
46 | |
---|
47 | <table class='pretty-table' id='request-list'> |
---|
48 | <tr> |
---|
49 | <th>#</th> |
---|
50 | <th>Name</th> |
---|
51 | <th>Amount</th> |
---|
52 | <th>Check to</th> |
---|
53 | <th>Accounts</th> |
---|
54 | <th>Approval state (date)</th> |
---|
55 | </tr> |
---|
56 | {% for object in object_list %} |
---|
57 | <tr> |
---|
58 | <td> |
---|
59 | <input type='checkbox' name='select' value='{{object.pk}}'{%ifin object.pk selected_ids %} checked='checked'{%endifin%}></input> |
---|
60 | <a href='{% url review_request object.pk %}'>{{ object.pk }}</a> |
---|
61 | </td> |
---|
62 | <td> |
---|
63 | <a href='{% url review_request object.pk %}'>{{ object.name }}</a> |
---|
64 | {% if object.documentation %}<br />(has docs){%endif%} |
---|
65 | </td> |
---|
66 | <td> |
---|
67 | ${{ object.amount }} |
---|
68 | </td> |
---|
69 | <td> |
---|
70 | {{ object.check_to_first_name }} {{ object.check_to_last_name }}<br /> |
---|
71 | <a href='mailto:{{ object.check_to_email }}'>{{ object.check_to_email }}</a><br /> |
---|
72 | (Submitter {{ object.submitter }}) |
---|
73 | </td> |
---|
74 | <td> |
---|
75 | Term: {{ object.budget_term }}<br /> |
---|
76 | Budget: {{ object.budget_area|budgetarea_pathstr:3 }}<br /> |
---|
77 | GL: {{ object.expense_area|budgetarea_pathstr:2 }} |
---|
78 | </td> |
---|
79 | <td class='request-status-{{ object.approval_status|approval_status_class}}'> |
---|
80 | {{ object.approval_status|approval_status }} ({{ object.approval_time|date:"SHORT_DATETIME_FORMAT"}}) |
---|
81 | {% if object.voucher %} |
---|
82 | <br />[Voucher: {{object.voucher.pk}}] |
---|
83 | {% endif %} |
---|
84 | {% if object.rfp %} |
---|
85 | <br />[{{object.rfp}}] |
---|
86 | {% endif %} |
---|
87 | </td> |
---|
88 | </tr> |
---|
89 | {% endfor %} |
---|
90 | </table> |
---|
91 | |
---|
92 | <ul class='select-modifiers'> |
---|
93 | <li><a id='select-all' href='#'>Select All</a></li> |
---|
94 | <li><a id='select-none' href='#'>Select None</a></li> |
---|
95 | <li><a id='select-other' href='#'>Invert Selection</a></li> |
---|
96 | </ul> |
---|
97 | |
---|
98 | <script type='text/javascript'> |
---|
99 | $('#select-all').click(function(){ |
---|
100 | $('#request-list input:checkbox').attr('checked', 'checked'); |
---|
101 | return false; |
---|
102 | }); |
---|
103 | $('#select-none').click(function(){ |
---|
104 | $('#request-list input:checkbox').removeAttr('checked'); |
---|
105 | return false; |
---|
106 | }); |
---|
107 | $('#select-other').click(function(){ |
---|
108 | $('#request-list input:checkbox').each(function(){ |
---|
109 | this.checked = !this.checked; |
---|
110 | }); |
---|
111 | return false; |
---|
112 | }); |
---|
113 | </script> |
---|
114 | |
---|
115 | <h3>Bulk Actions</h3> |
---|
116 | |
---|
117 | <p> |
---|
118 | <select name='action'> |
---|
119 | <option value="none" selected="selected">-----------</option> |
---|
120 | {% for action in actions %} |
---|
121 | <option value='{{action.name}}'>{{action.label}}</option> |
---|
122 | {%endfor%} |
---|
123 | </select> |
---|
124 | <input type='submit' name='apply-action' value='Apply' /> |
---|
125 | </p> |
---|
126 | |
---|
127 | {%if action_message%} |
---|
128 | <p>{{action_message}}</p> |
---|
129 | {% if action_errors %} |
---|
130 | <p>Errors:</p> |
---|
131 | <table class='pretty-table'> |
---|
132 | <tr> |
---|
133 | <th>ID</th> |
---|
134 | <th>Message</th> |
---|
135 | {% for err in action_errors %} |
---|
136 | <tr><th>{{err.0.pk}}</th><td>{{err.1}}</td></tr> |
---|
137 | {%endfor%} |
---|
138 | </ul> |
---|
139 | {%endif%} |
---|
140 | {%endif%} |
---|
141 | </form> |
---|
142 | |
---|
143 | {% endblock %} |
---|