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