Lines 106-111
Link Here
|
106 |
[% CASE 'borrowernotes' %]<th>Notes</th> |
106 |
[% CASE 'borrowernotes' %]<th>Notes</th> |
107 |
[% CASE 'phone' %]<th>Phone</th> |
107 |
[% CASE 'phone' %]<th>Phone</th> |
108 |
[% CASE 'checkouts' %]<th>Checkouts</th> |
108 |
[% CASE 'checkouts' %]<th>Checkouts</th> |
|
|
109 |
[% CASE 'account_balance' %]<th>Fines</th> |
109 |
[% CASE 'action' %]<th> </th> |
110 |
[% CASE 'action' %]<th> </th> |
110 |
[% END %] |
111 |
[% END %] |
111 |
[% END %] |
112 |
[% END %] |
Lines 385-399
Link Here
|
385 |
return escape_str(data); |
386 |
return escape_str(data); |
386 |
} |
387 |
} |
387 |
} |
388 |
} |
388 |
[% CASE 'checkouts' %][% embed.push('checkouts+count') %] |
389 |
[% CASE 'checkouts' %][% embed.push('checkouts+count', 'overdues+count') %] |
389 |
{ |
390 |
{ |
390 |
"data": "", |
391 |
"data": "", |
391 |
"searchable": false, |
392 |
"searchable": false, |
392 |
"orderable": false, |
393 |
"orderable": false, |
393 |
"render": function( data, type, row, meta ) { |
394 |
"render": function( data, type, row, meta ) { |
394 |
return escape_str(row.checkouts_count); |
395 |
if ( row.overdues_count ) { |
|
|
396 |
return "<span class='overdue'><strong>"+row.overdues_count + "</strong></span>"; |
397 |
} else { |
398 |
return "0 / " + row.checkouts_count; |
399 |
} |
395 |
} |
400 |
} |
396 |
} |
401 |
} |
|
|
402 |
[% CASE 'account_balance' %][% embed.push('account_balance') %] |
403 |
{ |
404 |
"data": "", |
405 |
"searchable": false, |
406 |
"orderable": false, |
407 |
"render": function( data, type, row, meta ) { |
408 |
let r = "<span style='text-align: right; display: block;'><a href=\"/cgi-bin/koha/members/boraccount.pl?borrowernumber="+row.patron_id+"\">"; |
409 |
let balance_str = row.account_balance || 0; |
410 |
balance_str = balance_str.escapeHtml().format_price(); |
411 |
if ( row.account_balance < 0 ) { |
412 |
// FIXME Format price here |
413 |
r += "<span class='credit'>" + balance_str + "</span>"; |
414 |
} else if ( row.account_balance > 0 ) { |
415 |
r += "<span class='debit'><strong>" + balance_str + "</strong></span>" |
416 |
} else { |
417 |
r += balance_str; |
418 |
} |
419 |
r += "</a></span>"; |
420 |
return r; |
421 |
} |
422 |
} |
423 |
|
397 |
[% CASE 'action' %] |
424 |
[% CASE 'action' %] |
398 |
{ |
425 |
{ |
399 |
"data": function( row, type, val, meta ) { |
426 |
"data": function( row, type, val, meta ) { |
400 |
- |
|
|