Lines 1-9
Link Here
|
1 |
[% USE Koha %] |
1 |
[% USE Koha %] |
2 |
[% USE KohaDates %] |
2 |
[% USE KohaDates %] |
|
|
3 |
[% USE Currency %] |
3 |
|
4 |
|
4 |
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges |
5 |
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges |
5 |
[% INCLUDE 'doc-head-close.inc' %] |
6 |
[% INCLUDE 'doc-head-close.inc' %] |
6 |
[% BLOCK cssinclude %][% END %] |
7 |
[% BLOCK cssinclude %][% END %] |
|
|
8 |
|
9 |
[% INCLUDE 'browser-strings.inc' %] |
10 |
|
7 |
</head> |
11 |
</head> |
8 |
<body id="opac-account" class="scrollto"> |
12 |
<body id="opac-account" class="scrollto"> |
9 |
[% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %] |
13 |
[% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %] |
Lines 12-18
Link Here
|
12 |
<div class="main"> |
16 |
<div class="main"> |
13 |
<ul class="breadcrumb"> |
17 |
<ul class="breadcrumb"> |
14 |
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> |
18 |
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> |
15 |
<li>[% FOREACH BORROWER_INF IN BORROWER_INFO %]<a href="/cgi-bin/koha/opac-user.pl">[% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]</a>[% END %] <span class="divider">›</span></li> |
19 |
<li><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]</a> <span class="divider">›</span></li> |
16 |
<li><a href="#">Your fines and charges</a></li> |
20 |
<li><a href="#">Your fines and charges</a></li> |
17 |
</ul> |
21 |
</ul> |
18 |
|
22 |
|
Lines 26-86
Link Here
|
26 |
<div class="span10"> |
30 |
<div class="span10"> |
27 |
<div id="useraccount" class="maincontent"> |
31 |
<div id="useraccount" class="maincontent"> |
28 |
<h3>Fines and charges</h3> |
32 |
<h3>Fines and charges</h3> |
|
|
33 |
[% IF credits || debits %] |
34 |
|
35 |
<p> |
36 |
<h3>Account balance: [% borrower.account_balance | $Currency %]</h3> |
37 |
</p> |
38 |
|
39 |
<div> |
40 |
<div id="account-debits"> |
41 |
<a id="account-debits-switcher" href="#" onclick="return false">View payments</a> |
42 |
<table cellpadding="0" cellspacing="0" border="0" class="display" id="debits-table"> |
43 |
<thead> |
44 |
<tr> |
45 |
<th colspan="99">Fees</th> |
46 |
</tr> |
47 |
<tr> |
48 |
<th></th> |
49 |
<th>ID</th> |
50 |
<th>Description</th> |
51 |
<th>Type</th> |
52 |
<th>Amount</th> |
53 |
<th>Outstanding</th> |
54 |
<th>Created on</th> |
55 |
<th>Updated on</th> |
56 |
</tr> |
57 |
</thead> |
58 |
<tbody></tbody> |
59 |
</table> |
60 |
</div> |
29 |
|
61 |
|
30 |
[% IF ( ACCOUNT_LINES ) %] |
62 |
<div id="account-credits"> |
31 |
<table class="table table-bordered table-striped"> |
63 |
<a id="account-credits-switcher" href="#" onclick="return false">View fees</a> |
32 |
<thead> |
64 |
<table cellpadding="0" cellspacing="0" border="0" class="display" id="credits-table"> |
33 |
<tr> |
65 |
<thead> |
34 |
<th>Date</th> |
66 |
<tr> |
35 |
<th>Description</th> |
67 |
<th colspan="99">Payments</th> |
36 |
<th>Fine amount</th> |
68 |
</tr> |
37 |
<th>Amount outstanding</th> |
69 |
<tr> |
38 |
</tr> |
70 |
<th></th> |
39 |
</thead> |
71 |
<th>ID</th> |
40 |
|
72 |
<th>Notes</th> |
41 |
<tfoot> |
73 |
<th>Type</th> |
42 |
<tr> |
74 |
<th>Amount</th> |
43 |
<th class="sum" colspan="3">Total due</th> |
75 |
<th>Remaining</th> |
44 |
<td class="sum">[% total %]</td> |
76 |
<th>Created on</th> |
45 |
</tr> |
77 |
<th>Updated on</th> |
46 |
</tfoot> |
78 |
</tr> |
47 |
|
79 |
</thead> |
48 |
<tbody> |
80 |
<tbody></tbody> |
49 |
[% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %] |
81 |
</table> |
50 |
[% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] |
82 |
</div> |
51 |
<td>[% ACCOUNT_LINE.date | $KohaDates %]</td> |
83 |
</div> |
52 |
<td> |
|
|
53 |
[% SWITCH ACCOUNT_LINE.accounttype %] |
54 |
[% CASE 'Pay' %]Payment, thanks |
55 |
[% CASE 'Pay00' %]Payment, thanks (cash via SIP2) |
56 |
[% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) |
57 |
[% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) |
58 |
[% CASE 'N' %]New card |
59 |
[% CASE 'F' %]Fine |
60 |
[% CASE 'A' %]Account management fee |
61 |
[% CASE 'M' %]Sundry |
62 |
[% CASE 'L' %]Lost item |
63 |
[% CASE 'W' %]Writeoff |
64 |
[% CASE 'FU' %]Accruing fine |
65 |
[% CASE 'Rent' %]Rental fee |
66 |
[% CASE 'FOR' %]Forgiven |
67 |
[% CASE 'LR' %]Lost item fee refund |
68 |
[% CASE 'PAY' %]Payment |
69 |
[% CASE 'WO' %]Writeoff |
70 |
[% CASE 'C' %]Credit |
71 |
[% CASE 'CR' %]Credit |
72 |
[% CASE %][% ACCOUNT_LINE.accounttype %] |
73 |
[%- END -%] |
74 |
[%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %] |
75 |
[% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %] |
76 |
</td> |
77 |
[% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td> |
78 |
[% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td> |
79 |
</tr> |
80 |
[% END %] |
81 |
</tbody> |
82 |
|
83 |
</table> |
84 |
[% ELSE %] |
84 |
[% ELSE %] |
85 |
<h4>You have no fines or charges</h4> |
85 |
<h4>You have no fines or charges</h4> |
86 |
[% END %] |
86 |
[% END %] |
Lines 91-94
Link Here
|
91 |
</div> <!-- / .main --> |
91 |
</div> <!-- / .main --> |
92 |
|
92 |
|
93 |
[% INCLUDE 'opac-bottom.inc' %] |
93 |
[% INCLUDE 'opac-bottom.inc' %] |
|
|
94 |
|
95 |
[% INCLUDE 'datatables.inc' %] |
96 |
|
97 |
<script type="text/javascript"> |
98 |
//<![CDATA[ |
99 |
$(document).ready(function() { |
100 |
$('#account-credits').hide(); |
101 |
$('#account-debits-switcher').click(function() { |
102 |
$('#account-debits').slideUp(); |
103 |
$('#account-credits').slideDown(); |
104 |
}); |
105 |
$('#account-credits-switcher').click(function() { |
106 |
$('#account-credits').slideUp(); |
107 |
$('#account-debits').slideDown(); |
108 |
}); |
109 |
|
110 |
var anOpen = []; |
111 |
var sImageUrl = "[% interface %]/[% theme %]/images/"; |
112 |
|
113 |
var debitsTable = $('#debits-table').dataTable( { |
114 |
"bProcessing": true, |
115 |
"aoColumns": [ |
116 |
{ |
117 |
"mDataProp": null, |
118 |
"sClass": "control center", |
119 |
"sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">' |
120 |
}, |
121 |
{ "mDataProp": "debit_id" }, |
122 |
{ "mDataProp": "description" }, |
123 |
{ |
124 |
"mDataProp": "type", |
125 |
"fnRender": function ( o, val ) { |
126 |
return STRINGS['DebitTypes'][val] || val; |
127 |
}, |
128 |
}, |
129 |
{ "mDataProp": "amount_original" }, |
130 |
{ "mDataProp": "amount_outstanding" }, |
131 |
{ "mDataProp": "created_on" }, |
132 |
{ "mDataProp": "updated_on" } |
133 |
], |
134 |
"aaData": [ |
135 |
[% FOREACH d IN debits %] |
136 |
{ |
137 |
[% PROCESS format_data data=d highlight='debit' %] |
138 |
|
139 |
// Data for related item if there is one linked |
140 |
"title": "[% d.item.biblio.title || d.deleted_item.biblio.title || d.deleted_item.deleted_biblio.title %]", |
141 |
"biblionumber": "[% d.item.biblio.biblionumber || d.deleted_item.biblio.biblionumber %]", |
142 |
"barcode": "[% d.item.barcode || d.deleted_item.barcode %]", |
143 |
"itemnumber": "[% d.item.itemnumber %]", //This way itemnumber will be undef if deleted |
144 |
|
145 |
|
146 |
// Data for related issue if there is one linked |
147 |
[% IF d.issue %] |
148 |
[% SET table = 'issue' %] |
149 |
[% ELSIF d.old_issue %] |
150 |
[% SET table = 'old_issue' %] |
151 |
[% END %] |
152 |
|
153 |
[% IF table %] |
154 |
"issue": { |
155 |
[% PROCESS format_data data=d.$table %] |
156 |
}, |
157 |
[% END %] |
158 |
|
159 |
|
160 |
"account_offsets": [ |
161 |
[% FOREACH ao IN d.account_offsets %] |
162 |
{ |
163 |
[% PROCESS format_data data=ao highlight='offset'%] |
164 |
|
165 |
"credit": { |
166 |
[% PROCESS format_data data=ao.credit highlight='credit' %] |
167 |
} |
168 |
}, |
169 |
[% END %] |
170 |
] |
171 |
|
172 |
}, |
173 |
[% END %] |
174 |
] |
175 |
} ); |
176 |
|
177 |
$('#debits-table td.control').live( 'click', function () { |
178 |
var nTr = this.parentNode; |
179 |
var i = $.inArray( nTr, anOpen ); |
180 |
|
181 |
if ( i === -1 ) { |
182 |
$('img', this).attr( 'src', sImageUrl+"details_close.png" ); |
183 |
var nDetailsRow = debitsTable.fnOpen( nTr, fnFormatDebitDetails(debitsTable, nTr), 'details' ); |
184 |
$('div.innerDetails', nDetailsRow).slideDown(); |
185 |
anOpen.push( nTr ); |
186 |
} |
187 |
else { |
188 |
$('img', this).attr( 'src', sImageUrl+"details_open.png" ); |
189 |
$('div.innerDetails', $(nTr).next()[0]).slideUp( function () { |
190 |
debitsTable.fnClose( nTr ); |
191 |
anOpen.splice( i, 1 ); |
192 |
} ); |
193 |
} |
194 |
} ); |
195 |
|
196 |
var creditsTable = $('#credits-table').dataTable( { |
197 |
"bProcessing": true, |
198 |
"aoColumns": [ |
199 |
{ |
200 |
"mDataProp": null, |
201 |
"sClass": "control center", |
202 |
"sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">' |
203 |
}, |
204 |
{ "mDataProp": "credit_id" }, |
205 |
{ "mDataProp": "notes" }, |
206 |
{ "mDataProp": "type" }, |
207 |
{ "mDataProp": "amount_paid" }, |
208 |
{ "mDataProp": "amount_remaining" }, |
209 |
{ "mDataProp": "created_on" }, |
210 |
{ "mDataProp": "updated_on" } |
211 |
], |
212 |
"aaData": [ |
213 |
[% FOREACH c IN credits %] |
214 |
{ |
215 |
[% PROCESS format_data data=c highlight='credit' %] |
216 |
|
217 |
"account_offsets": [ |
218 |
[% FOREACH ao IN c.account_offsets %] |
219 |
{ |
220 |
[% PROCESS format_data data=ao highlight='offset' %] |
221 |
|
222 |
"debit": { |
223 |
[% PROCESS format_data data=ao.debit highlight='debit' %] |
224 |
} |
225 |
}, |
226 |
[% END %] |
227 |
] |
228 |
|
229 |
}, |
230 |
[% END %] |
231 |
] |
232 |
} ); |
233 |
|
234 |
$('#credits-table td.control').live( 'click', function () { |
235 |
var nTr = this.parentNode; |
236 |
var i = $.inArray( nTr, anOpen ); |
237 |
|
238 |
if ( i === -1 ) { |
239 |
$('img', this).attr( 'src', sImageUrl+"details_close.png" ); |
240 |
var nDetailsRow = creditsTable.fnOpen( nTr, fnFormatCreditDetails(creditsTable, nTr), 'details' ); |
241 |
$('div.innerDetails', nDetailsRow).slideDown(); |
242 |
anOpen.push( nTr ); |
243 |
} |
244 |
else { |
245 |
$('img', this).attr( 'src', sImageUrl+"details_open.png" ); |
246 |
$('div.innerDetails', $(nTr).next()[0]).slideUp( function () { |
247 |
creditsTable.fnClose( nTr ); |
248 |
anOpen.splice( i, 1 ); |
249 |
} ); |
250 |
} |
251 |
} ); |
252 |
|
253 |
} ); |
254 |
|
255 |
function fnFormatDebitDetails( debitsTable, nTr ) { |
256 |
var oData = debitsTable.fnGetData( nTr ); |
257 |
|
258 |
var sOut = "<div class='innerDetails' style='display:none;'>"; |
259 |
|
260 |
var account_offsets = oData.account_offsets; |
261 |
|
262 |
sOut += "<ul>"; |
263 |
if ( oData.title ) { |
264 |
sOut += "<li>" + _("Title: "); |
265 |
if ( oData.biblionumber ) { |
266 |
sOut += "<a href='/cgi-bin/koha/opac-detail.pl?biblionumber=" + oData.biblionumber + "'>"; |
267 |
} |
268 |
|
269 |
sOut += oData.title; |
270 |
|
271 |
if ( oData.biblionumber ) { |
272 |
sOut += "</a>"; |
273 |
} |
274 |
|
275 |
sOut += "</li>"; |
276 |
} |
277 |
|
278 |
if ( oData.barcode ) { |
279 |
sOut += "<li>" + _("Barcode: ") + oData.barcode + "</li>"; |
280 |
} |
281 |
|
282 |
if ( oData.notes ) { |
283 |
sOut += "<li>" + _("Notes: ") + oData.notes + "</li>"; |
284 |
} |
285 |
|
286 |
sOut += "</ul>"; |
287 |
|
288 |
if ( account_offsets.length ) { |
289 |
sOut += |
290 |
"<div class='innerDetails'>" + |
291 |
"<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" + |
292 |
"<thead>" + |
293 |
"<tr><th colspan='99'>" + _("Payments applied") + "</th></tr>" + |
294 |
"<tr>" + |
295 |
"<th>" + _("ID") + "</th>" + |
296 |
"<th>" + _("Created on") + "</th>" + |
297 |
"<th>" + _("Payment amount") + "</th>" + |
298 |
"<th>" + _("Applied amount") + "</th>" + |
299 |
"<th>" + _("Type") + "</th>" + |
300 |
"<th>" + _("Notes") + "</th>" + |
301 |
"</tr>" + |
302 |
"</thead>" + |
303 |
"<tbody>"; |
304 |
|
305 |
for ( var i = 0; i < account_offsets.length; i++ ) { |
306 |
ao = account_offsets[i]; |
307 |
sOut += |
308 |
"<tr>" + |
309 |
"<td>" + ao.credit_id + "</td>" + |
310 |
"<td>" + ao.created_on + "</td>" + |
311 |
"<td>" + ao.credit.amount_paid + "</td>" + |
312 |
"<td>" + ao.amount + "</td>" + |
313 |
"<td>" + ao.credit.type + "</td>" + |
314 |
"<td>" + ao.credit.notes + "</td>" + |
315 |
"</tr>"; |
316 |
} |
317 |
|
318 |
sOut += |
319 |
"</tbody>"+ |
320 |
"</table>"; |
321 |
} |
322 |
|
323 |
sOut += |
324 |
"</div>"; |
325 |
|
326 |
return sOut; |
327 |
} |
328 |
|
329 |
function fnFormatCreditDetails( creditsTable, nTr ) { |
330 |
var oData = creditsTable.fnGetData( nTr ); |
331 |
|
332 |
var sOut = "<div class='innerDetails' style='display:none;'>"; |
333 |
|
334 |
var account_offsets = oData.account_offsets; |
335 |
|
336 |
if ( account_offsets.length ) { |
337 |
sOut += |
338 |
"<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" + |
339 |
"<thead>" + |
340 |
"<tr><th colspan='99'>" + _("Fees paid") + "</th></tr>" + |
341 |
"<tr>" + |
342 |
"<th>" + _("ID") + "</th>" + |
343 |
"<th>" + _("Description") + "</th>" + |
344 |
"<th>" + _("Type") + "</th>" + |
345 |
"<th>" + _("Amount") + "</th>" + |
346 |
"<th>" + _("Remaining") + "</th>" + |
347 |
"<th>" + _("Created on") + "</th>" + |
348 |
"<th>" + _("Updated on") + "</th>" + |
349 |
"<th>" + _("Notes") + "</th>" + |
350 |
"</tr>" + |
351 |
"</thead>" + |
352 |
"<tbody>"; |
353 |
|
354 |
for ( var i = 0; i < account_offsets.length; i++ ) { |
355 |
ao = account_offsets[i]; |
356 |
sOut += |
357 |
"<tr>" + |
358 |
"<td>" + ao.debit.debit_id + "</td>" + |
359 |
"<td>" + ao.debit.description + "</td>" + |
360 |
"<td>" + ao.debit.type + "</td>" + |
361 |
"<td>" + ao.debit.amount_original + "</td>" + |
362 |
"<td>" + ao.debit.amount_outstanding + "</td>" + |
363 |
"<td>" + ao.debit.created_on + "</td>" + |
364 |
"<td>" + ao.debit.updated_on + "</td>" + |
365 |
"<td>" + ao.debit.notes + "</td>" + |
366 |
"</tr>"; |
367 |
} |
368 |
|
369 |
sOut += |
370 |
"</tbody>"+ |
371 |
"</table>"; |
372 |
} |
373 |
|
374 |
sOut += |
375 |
"</div>"; |
376 |
|
377 |
return sOut; |
378 |
} |
379 |
|
380 |
//]]> |
381 |
</script> |
382 |
|
94 |
[% BLOCK jsinclude %][% END %] |
383 |
[% BLOCK jsinclude %][% END %] |
|
|
384 |
|
385 |
[% BLOCK format_data %] |
386 |
[% FOREACH key IN data.result_source.columns %] |
387 |
[% IF key.match('^amount') %] |
388 |
"[% key %]": "[% data.$key FILTER $Currency %]", |
389 |
[% ELSIF key.match('_on$') %] |
390 |
"[% key %]": "[% data.$key | $KohaDates %]", |
391 |
[% ELSE %] |
392 |
"[% key %]": "[% data.$key %]", |
393 |
[% END %] |
394 |
[% END %] |
395 |
[% END %] |