Bug 22990: Add CSRF protection to boraccount, pay and suggestion
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / accountline-details.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [%- USE Price -%]
4 [%- USE KohaDates -%]
5 [%- USE AuthorisedValues -%]
6 [%- USE Branches -%]
7 [% SET footerjs = 1 %]
8 [% PROCESS 'accounts.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Details of [% IF type == 'credit' %]credit[% ELSE %]debit[% END %] &rsaquo; [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo; Patrons &rsaquo; Koha</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 </head>
13
14 <body id="pat_accountline_details" class="pat">
15 [% WRAPPER 'header.inc' %]
16     [% INCLUDE 'patron-search-header.inc' %]
17 [% END %]
18
19 [% WRAPPER 'sub-header.inc' %]
20     [% WRAPPER breadcrumbs %]
21         [% WRAPPER breadcrumb_item %]
22             <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
23         [% END %]
24         [% WRAPPER breadcrumb_item %]
25             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
26         [% END %]
27         [% IF accountline %]
28             [% WRAPPER breadcrumb_item %]
29                 [% IF accountline.credit_type_code || accountline.debit_type_code %]
30                     <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]">Account</a>
31                 [% END %]
32             [% END %]
33         [% END %]
34         [% WRAPPER breadcrumb_item bc_active= 1 %]
35             [% IF accountline %]
36                 [% IF accountline.credit_type_code %]
37                     Details of credit ([% accountline.id | html %])
38                 [% ELSIF accountline.debit_type_code %]
39                     Details of debit ([% accountline.id | html %])
40                 [% END %]
41             [% ELSE %]
42                 Account for [% INCLUDE 'patron-title.inc' %]
43             [% END %]
44         [% END %]
45     [% END #/ WRAPPER breadcrumbs %]
46 [% END #/ WRAPPER sub-header.inc %]
47
48 <div class="main container-fluid">
49     <div class="row">
50         <div class="col-sm-10 col-sm-push-2">
51             <main>
52
53             [% INCLUDE 'members-toolbar.inc' borrowernumber=patron.borrowernumber %]
54
55             <h1>Transaction details</h1>
56
57             [% IF accountline %]
58
59                 <div class="page-section">
60                     [% af_values = accountline.additional_field_values %]
61                     [% IF accountline.credit_type_code %]
62                         <h2>Details of credit</h2>
63                     [% ELSIF accountline.debit_type_code %]
64                         <h2>Details of debit</h2>
65                     [% END %]
66
67                     <table id="table_account_fines">
68                         <thead>
69                             <tr>
70                                 <th>Date</th>
71                                 <th>Description</th>
72                                 <th>Barcode</th>
73                                 <th>Due date</th>
74                                 <th>Return date</th>
75                                 <th>Note</th>
76                                 [% FOREACH value IN af_values %]
77                                     <th>[% value.field.name | html %]</th>
78                                 [% END %]
79                                 <th>Amount</th>
80                                 <th>Outstanding</th>
81                             </tr>
82                         </thead>
83
84                         <tbody>
85                             <tr>
86                                 <td>
87                                     [% accountline.date | $KohaDates %]
88                                 </td>
89                                 <td>
90                                     [%- PROCESS account_type_description account=accountline -%]
91                                     [%- IF accountline.payment_type -%]
92                                         , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', accountline.payment_type) | html %]
93                                     [%- END =%]
94                                     [%- IF accountline.description -%]
95                                         , [% accountline.description | html %]
96                                     [%- END -%]
97
98                                     &nbsp;
99                                     [% IF ( accountline.itemnumber ) %]
100                                         [% SET biblio = accountline.item.biblio %]
101                                         <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% accountline.itemnumber | uri %]">[% biblio.title | html %]</a>
102                                     [% END %]
103                                 </td>
104
105                                 <td>
106                                     [% IF ( accountline.itemnumber ) %]
107                                         <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% accountline.item.biblionumber | uri %]&amp;itemnumber=[% accountline.itemnumber | uri %]#item[% accountline.itemnumber | uri %]">[% accountline.item.barcode | html %]</a>
108                                     [% END %]
109                                 </td>
110
111                                 <td>
112                                     [% IF ( accountline.issue_id ) %]
113                                         [% accountline.checkout.date_due | $KohaDates as_due_date => 1 %]
114                                     [% END %]
115                                 </td>
116
117                                 <td>
118                                     [% IF ( accountline.issue_id ) %]
119                                         [% accountline.checkout.returndate | $KohaDates with_hours => 1 %]
120                                     [% END %]
121                                 </td>
122
123                                 <td>
124                                     [% accountline.note | html_line_break %]
125                                 </td>
126
127                                 [% FOREACH value IN af_values %]
128                                     <td>
129                                         [% IF value.field.authorised_value_category %]
130                                             [% AuthorisedValues.GetByCode( value.field.authorised_value_category, value.value ) | html %]
131                                         [% ELSE %]
132                                             [% value.value | html %]
133                                         [% END %]
134                                     </td>
135                                 [% END %]
136
137                                 <td>
138                                     [% accountline.amount | $Price %]
139                                 </td>
140
141                                 <td>
142                                     [% accountline.amountoutstanding | $Price %]
143                                 </td>
144                             </tr>
145                         </tbody>
146                     </table>
147                 </div> <!-- /.page-section -->
148
149                 <div class="page-section">
150                     <h3>History</h3>
151
152                     <table class="accountline-offsets-table" id="accountline-debits-table">
153                         <thead>
154                             <tr>
155                                 <th rowspan="2">Date</th>
156                                 <th colspan="2">Change</th>
157                                 <th rowspan="2">Action</th>
158                                 <th colspan="4">Related transaction</th>
159                             </tr>
160                             <tr>
161                                 <th>Increase</th>
162                                 <th>Decrease</th>
163                                 <th>Type</th>
164                                 <th>Amount</th>
165                                 <th>Librarian</th>
166                                 <th>Note</th>
167                             </tr>
168                         </thead>
169
170                         <tbody>
171                             [% FOREACH ao IN account_offsets %]
172                                     [% IF ao.credit_id == accountline.accountlines_id %]
173                                         [% SET offset_accountline = ao.debit %]
174                                     [% ELSIF ao.debit_id == accountline.accountlines_id %]
175                                         [% SET offset_accountline = ao.credit %]
176                                     [% END %]
177
178                                     [%- BLOCK ao_description -%]
179                                         [%- SWITCH ao.type -%]
180                                             [%- CASE 'CREATE'           -%]<span>Created</span>
181                                             [%- CASE 'OVERDUE_INCREASE' -%]<span>Increase</span>
182                                             [%- CASE 'OVERDUE_DECREASE' -%]<span>Decrease</span>
183                                             [%- CASE 'APPLY'            -%]<span>Applied</span>
184                                             [%- CASE 'VOID'             -%]<span>Reversed</span>
185                                         [%- END -%]
186                                     [%- END -%]
187
188                                     <tr>
189                                         <td>[% ao.created_on | $KohaDates with_hours => 1%]</td>
190                                         <td>[%- IF ao.amount > 0 -%][% ao.amount | $Price %][% END %]</td>
191                                         <td>[%- IF ao.amount < 0 -%][% ao.amount | $Price %][% END %]</td>
192                                         <td>
193                                             [% PROCESS ao_description ao=ao %]
194                                         </td>
195                                         [%- IF offset_accountline -%]
196                                         <td>
197                                             [% PROCESS account_type_description account=offset_accountline %] (<a href="accountline-details.pl?accountlines_id=[% offset_accountline.id | uri %]">[% offset_accountline.id | html %]</a>)
198                                         </td>
199                                         <td>
200                                             [% offset_accountline.amount | $Price %]
201                                         </td>
202                                         <td>
203                                             [% IF offset_accountline.manager_id %]
204                                             <a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | uri %]">
205                                                 [% IF offset_accountline.manager.firstname %]
206                                                     [% offset_accountline.manager.firstname | html %] [% offest_accountline.manager.surname | html %]
207                                                 [% ELSE %]
208                                                     [% offset_accountline.manager.surname | html %]
209                                                 [% END %]
210                                             </a>
211                                             [% END %]
212                                         </td>
213                                         [%- ELSE -%]
214                                         <td></td>
215                                         <td></td>
216                                         <td></td>
217                                         [%- END -%]
218                                         <td>[% offset_accountline.note | html %]</td>
219                                     </tr>
220                             [% END %]
221                         </tbody>
222                     </table>
223                 </div> <!-- /.page-section -->
224             [% ELSE %]
225                 <div class="dialog message">
226                     Account not found
227                 </div>
228             [% END %]
229
230             </main>
231         </div> <!-- /.col-sm-10.col-sm-push-2 -->
232
233         <div class="col-sm-2 col-sm-pull-10">
234             <aside>
235                 [% INCLUDE 'circ-menu.inc' %]
236             </aside>
237         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
238     </div> <!-- /.row -->
239
240
241 [% MACRO jsinclude BLOCK %]
242     [% INCLUDE 'str/members-menu.inc' %]
243     [% Asset.js("js/members-menu.js") | $raw %]
244 [% END %]
245
246 [% INCLUDE 'intranet-bottom.inc' %]