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 225-231
Link Here
|
225 |
return json.data; |
226 |
return json.data; |
226 |
} |
227 |
} |
227 |
}, |
228 |
}, |
228 |
embed: ['extended_attributes', 'checkouts+count'], |
229 |
embed: ['extended_attributes', 'checkouts+count', 'overdues+count', 'account_balance'], |
229 |
"drawCallback": function( settings ) { |
230 |
"drawCallback": function( settings ) { |
230 |
var api = this.api(); |
231 |
var api = this.api(); |
231 |
var data = api.data(); |
232 |
var data = api.data(); |
Lines 385-393
Link Here
|
385 |
"searchable": false, |
386 |
"searchable": false, |
386 |
"orderable": false, |
387 |
"orderable": false, |
387 |
"render": function( data, type, row, meta ) { |
388 |
"render": function( data, type, row, meta ) { |
388 |
return escape_str(row.checkouts_count); |
389 |
if ( row.overdues_count ) { |
|
|
390 |
return "<span class='overdue'><strong>"+row.overdues_count + "</strong></span>"; |
391 |
} else { |
392 |
return "0 / " + row.checkouts_count; |
393 |
} |
389 |
} |
394 |
} |
390 |
} |
395 |
} |
|
|
396 |
[% CASE 'account_balance' %] |
397 |
{ |
398 |
"data": "", |
399 |
"searchable": false, |
400 |
"orderable": false, |
401 |
"render": function( data, type, row, meta ) { |
402 |
let r = "<span style='text-align: right; display: block;'><a href=\"/cgi-bin/koha/members/boraccount.pl?borrowernumber="+row.patron_id+"\">"; |
403 |
let balance_str = row.account_balance || 0; |
404 |
balance_str = balance_str.escapeHtml().format_price(); |
405 |
if ( row.account_balance < 0 ) { |
406 |
// FIXME Format price here |
407 |
r += "<span class='credit'>" + balance_str + "</span>"; |
408 |
} else if ( row.account_balance > 0 ) { |
409 |
r += "<span class='debit'><strong>" + balance_str + "</strong></span>" |
410 |
} else { |
411 |
r += balance_str; |
412 |
} |
413 |
r += "</a></span>"; |
414 |
return r; |
415 |
} |
416 |
} |
417 |
|
391 |
[% CASE 'action' %] |
418 |
[% CASE 'action' %] |
392 |
{ |
419 |
{ |
393 |
"data": function( row, type, val, meta ) { |
420 |
"data": function( row, type, val, meta ) { |
394 |
- |
|
|