Lines 607-609
function parse_callnumber ( html ) {
Link Here
|
607 |
return ""; |
607 |
return ""; |
608 |
} |
608 |
} |
609 |
} |
609 |
} |
610 |
- |
610 |
|
|
|
611 |
// see http://www.datatables.net/examples/advanced_init/footer_callback.html |
612 |
function footer_column_sum( api, column_numbers ) { |
613 |
// Remove the formatting to get integer data for summation |
614 |
var intVal = function ( i ) { |
615 |
if ( typeof i === 'number' ) { |
616 |
if ( isNaN(i) ) return 0; |
617 |
return i; |
618 |
} else if ( typeof i === 'string' ) { |
619 |
var value = i.replace(/[a-zA-Z ,.]/g, '')*1; |
620 |
if ( isNaN(value) ) return 0; |
621 |
return value; |
622 |
} |
623 |
return 0; |
624 |
}; |
625 |
|
626 |
|
627 |
for ( var indice = 0 ; indice < column_numbers.length ; indice++ ) { |
628 |
var column_number = column_numbers[indice]; |
629 |
|
630 |
var total = 0; |
631 |
var cells = api.column( column_number, { page: 'current' } ).nodes().to$().find("span.total_amount"); |
632 |
$(cells).each(function(){ |
633 |
total += intVal( $(this).html() ); |
634 |
}); |
635 |
total /= 100; // Hard-coded decimal precision |
636 |
|
637 |
// Update footer |
638 |
$( api.column( column_number ).footer() ).html(total.format_price()); |
639 |
}; |
640 |
} |
641 |
|