Bug 35356: Show SMS labels only when data exists
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / moremember-print.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% USE KohaDates %]
5 [% USE Price %]
6 [% USE ItemTypes %]
7 [% USE TablesSettings %]
8 [% PROCESS 'member-display-address-style.inc' %]
9 [% PROCESS 'i18n.inc' %]
10 [% SET footerjs = 1 %]
11 [% PROCESS 'accounts.inc' %]
12 [% INCLUDE 'doc-head-open.inc' %]
13     <title>[% FILTER collapse %]
14         [% t("Summary for") | html %] [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo;
15         [% t("Patrons") | html %] &rsaquo;
16         [% t("Koha") | html %]
17     [% END %]</title>
18     [% INCLUDE 'doc-head-close.inc' %]
19 </head>
20
21 <body id="pat_moremember-print" class="pat">
22     <div id="main">
23         <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% patron.cardnumber | uri %]">Account summary: [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo;</a></h3>
24
25         <ul>
26             [% PROCESS 'display-address-style' %]
27             <li>[% IF ( patron.phone ) %][% patron.phone | html %][% ELSE %](no phone number on file)[% END %]</li>
28             <li>[% IF ( patron.email ) %][% patron.email | html %][% ELSE %](no primary email on file)[% END %]</li>
29             [% IF ( patron.emailpro ) %]
30                 <li>[% patron.emailpro | html %]</li>
31             [% END %]
32             <li>Registration date: [% patron.dateenrolled | $KohaDates %]</li>
33             <li>Expiration date: [% patron.dateexpiry | $KohaDates %]</li>
34             <li>Library: [% Branches.GetName( patron.branchcode ) | html %]</li>
35             <li>Category: [% patron.category.description | html %]</li>
36         </ul>
37
38         [% IF ( issues ) %]
39             <table id="print-summary-checkouts">
40                 <caption>Items checked out</caption>
41                 <thead>
42                     <tr>
43                         <th>Title</th>
44                         <th>Author</th>
45                         <th>Call number</th>
46                         <th>Item type</th>
47                         <th>Date due</th>
48                         <th>Barcode</th>
49                         <th>Inventory number</th>
50                         <th>Charge</th>
51                         <th>Price</th>
52                         <th>Status</th>
53                     </tr>
54                 </thead>
55                 <tbody>
56                     [% FOREACH issue IN issues %]
57                         <tr>
58                             <td>
59                                 [% INCLUDE 'biblio-title.inc' biblio=issue link = 0 %]
60                             </td>
61                             <td>[% issue.author | html %]</td>
62                             <td>[% issue.itemcallnumber | html %]</td>
63                             <td>[% ItemTypes.GetDescription( issue.itype ) | html %]</td>
64                             <td>[% issue.date_due | $KohaDates as_due_date => 1 %]</td>
65                             <td>[% issue.barcode | html %]</td>
66                             <td>[% issue.stocknumber | html %]</td>
67                             [% IF ( issue.charge <= 0 ) %]
68                                 <td class="credit">
69                             [% ELSE %]
70                                 <td class="debit">
71                             [% END %]
72                                 [% issue.charge | $Price %]
73                             </td>
74                             [% IF ( issue.replacementprice <= 0 ) %]
75                                 <td class="credit">
76                             [% ELSE %]
77                                 <td class="debit">
78                             [% END %]
79                                 [% issue.replacementprice | $Price %]
80                             </td>
81                             <td>[% IF ( issue.overdue ) %]Overdue![% ELSE %]&nbsp;[% END %]</td>
82                         </tr>
83                     [% END %]
84                 </tbody>
85                  <tfoot>
86                     <tr>
87                         <td></td>
88                         <td></td>
89                         <td></td>
90                         <td></td>
91                         <td></td>
92                         <td></td>
93                         <td style="text-align: right; font-weight:bold;">Totals:</td>
94                         [% IF ( totaldue <= 0 ) %]
95                             <td class="credit">
96                         [% ELSE %]
97                             <td class="debit">
98                         [% END %]
99                             [% totaldue | $Price %]
100                         </td>
101                         [% IF ( totalprice <= 0 ) %]
102                             <td class="credit">
103                         [% ELSE %]
104                             <td class="debit">
105                         [% END %]
106                             [% totalprice | $Price %]
107                         </td>
108                         <td></td>
109                     </tr>
110                 </tfoot>
111             </table>
112         [% END %]
113
114     [% IF ( reserves ) %]
115         <table id="print-summary-holds">
116             <caption>Pending holds</caption>
117             <thead>
118                 <tr>
119                     <th>Title</th>
120                     <th>Author</th>
121                     <th>Placed on</th>
122                     <th>Expires on</th>
123                     <th>Pick up location</th>
124                 </tr>
125             </thead>
126             <tbody>
127                 [% FOREACH reserve IN reserves %]
128                     <tr>
129                         <td>[% reserve.title | html %]</td>
130                         <td>[% reserve.author | html %]</td>
131                         <td>[% reserve.reservedate | $KohaDates %]</td>
132                         <td>[% reserve.expirationdate | $KohaDates %]</td>
133                         <td>[% reserve.waiting_at | html %]</td>
134                     </tr>
135                 [% END %]
136             </tbody>
137         </table>
138     [% END %]
139     [% IF accounts && totaldue != 0 %]
140         <table id="print-summary-fines">
141             <caption>Account fines and payments</caption>
142             <thead>
143               <tr>
144                   <th>Date</th>
145                   <th>Description of charges</th>
146                   <th>Note</th>
147                   <th>Amount</th>
148                   <th>Outstanding</th>
149                 </tr>
150             </thead>
151             <tbody>
152                 [% FOREACH account IN accounts %]
153                     <tr>
154                         <td>[% account.date | $KohaDates %]</td>
155                         <td>
156                             [% PROCESS account_type_description account=account %]
157                             [%- IF account.payment_type %]
158                                 , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %]
159                             [% END %]
160                             [%- IF account.description %]
161                                 , [% account.description | html %]
162                             [% END %]
163                             &nbsp;
164                             [% IF ( account.itemnumber AND account.debit_type_code != 'OVERDUE' ) %]
165                                 <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&amp;itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>
166                             [% END %]
167                         </td>
168                         <td>
169                             [% account.note | html_line_break %]
170                         </td>
171                         [% IF ( account.amount <= 0 ) %]
172                             <td class="credit">
173                         [% ELSE %]
174                             <td class="debit">
175                         [% END %]
176                             [% account.amount | $Price %]
177                         </td>
178                         [% IF ( account.amountoutstanding <= 0 ) %]
179                             <td class="credit">
180                         [% ELSE %]
181                             <td class="debit">
182                         [% END %]
183                             [% account.amountoutstanding | $Price %]
184                         </td>
185                     </tr>
186                 [% END %]
187             </tbody>
188             <tfoot>
189                 <tr>
190                     <td></td>
191                     <td></td>
192                     <td ></td>
193                     [% IF ( totaldue < 0 ) %]
194                         <td class="credit">
195                     [% ELSE %]
196                         <td class="debit">
197                     [% END %]
198                         Total due:
199                     </td>
200                     [% IF ( totaldue < 0 ) %]
201                         <td class="credit">
202                     [% ELSE %]
203                         <td class="debit">
204                     [% END %]
205                         [% totaldue | $Price %]
206                     </td>
207                 </tr>
208             </tfoot>
209         </table>
210     [% END %]
211
212 [% MACRO jsinclude BLOCK %]
213     [% INCLUDE 'slip-print.inc' #printThenClose %]
214     [% INCLUDE 'datatables.inc' %]
215     [% INCLUDE 'columns_settings.inc' %]
216     <script>
217         var checkouts_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-checkouts', 'json' ) | $raw %];
218         var holds_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-holds', 'json' ) | $raw %];
219         var fines_columns = [% TablesSettings.GetTableSettings( 'circ', 'print_summary', 'print-summary-fines', 'json' ) | $raw %];
220
221         function moveColumnsButton( tableId ){
222             /* Hide the export button */
223             $("#" + tableId + "_wrapper").find("button.export_controls").remove();
224             /* We don't show the table controls toolbar here, so the columns settings button looks better as part of the caption */
225             $("#" + tableId).find("caption").append( $("#" + tableId + "_wrapper").find("button.columns_controls") );
226         }
227
228         $(document).ready(function() {
229
230             KohaTable("print-summary-checkouts", {
231                 "dom": "Bt",
232                 "paging": false,
233                 "bAutoWidth": false,
234                 initComplete: function( settings) {
235                     moveColumnsButton( settings.nTable.id );
236                 }
237             }, checkouts_columns);
238
239             KohaTable("print-summary-holds", {
240                 "dom": "Bt",
241                 "paging": false,
242                 "bAutoWidth": false,
243                 initComplete: function( settings) {
244                     moveColumnsButton( settings.nTable.id );
245                 }
246             }, holds_columns);
247
248             KohaTable("print-summary-fines", {
249                 "dom": "Bt",
250                 "paging": false,
251                 "bAutoWidth": false,
252                 initComplete: function( settings) {
253                     moveColumnsButton( settings.nTable.id );
254                 }
255             }, fines_columns);
256
257         });
258     </script>
259 [% END %]
260
261 [% INCLUDE 'intranet-bottom.inc' %]