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