diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 1755d6cdf4..79ed290fc7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -151,19 +151,29 @@ $(document).ready(function() { } else { return "" + PREVIOUS_CHECKOUTS + ""; } - } - }, - { - "mDataProp": "date_due", - "bVisible": false, - }, - { - "iDataSort": 1, // Sort on hidden unformatted date due column - "mDataProp": function( oObj ) { - if ( oObj.date_due_overdue ) { - return "" + oObj.date_due_formatted + ""; - } else { - return oObj.date_due_formatted; + }, + { + "mDataProp": "date_due", + "bVisible": false, + }, + { + "iDataSort": 1, // Sort on hidden unformatted date due column + "mDataProp": function( oObj ) { + var due = oObj.date_due_formatted; + + if ( oObj.date_due_overdue ) { + due = "" + due + ""; + } + + if ( oObj.lost ) { + due += "" + oObj.lost + ""; + } + + if ( oObj.damaged ) { + due += "" + oObj.damaged + ""; + } + + return due; } } }, diff --git a/svc/checkouts b/svc/checkouts index f56bdffb83..e56ef619e2 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -25,8 +25,8 @@ use JSON qw(to_json); use C4::Auth qw(check_cookie_auth); use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue ); -use C4::Circulation - qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); +use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate); +use C4::Koha qw(GetAuthorisedValueByCode); use C4::Context; use Koha::DateUtils; @@ -83,6 +83,9 @@ my $sql = ' firstname, cardnumber, + itemlost, + damaged, + DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today FROM issues LEFT JOIN items USING ( itemnumber ) @@ -170,6 +173,8 @@ while ( my $c = $sth->fetchrow_hashref() ) { GetMarcBiblio( $c->{biblionumber} ), GetFrameworkCode( $c->{biblionumber} ) ), + lost => $c->{itemlost} ? GetAuthorisedValueByCode( 'LOST', $c->{itemlost} ) : undef, + damaged => $c->{damaged} ? GetAuthorisedValueByCode( 'DAMAGED', $c->{damaged} ) : undef, borrower => { surname => $c->{surname}, firstname => $c->{firstname},