Bug 12778 - Regression: Item lost status doesn't show in list of checkouts
[koha.git] / svc / checkouts
index 9dc4881..7901d8d 100755 (executable)
@@ -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;
@@ -86,6 +86,9 @@ my $sql = '
         firstname,
         cardnumber,
 
+        itemlost,
+        damaged,
+
         DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today
     FROM issues
         LEFT JOIN items USING ( itemnumber )
@@ -175,6 +178,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},