diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm index 906f4364f8..b2063a48bc 100644 --- a/C4/SIP/ILS/Item.pm +++ b/C4/SIP/ILS/Item.pm @@ -280,6 +280,9 @@ sub sip_circulation_status { elsif ( $self->{location} eq 'CART' ) { return '09'; # waiting to be re-shelved } + elsif ( $self->{damaged} ) { + return '01'; # damaged + } elsif ( $self->{notforloan} < 0 ) { return '02'; # on order } diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index 583fb06b47..37b34c0304 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -1207,11 +1207,16 @@ sub handle_item_information { } else { # Valid Item ID, send the good stuff - $resp .= $item->sip_circulation_status; + my $circulation_status = $item->sip_circulation_status; + $resp .= $circulation_status; $resp .= $item->sip_security_marker; $resp .= $item->sip_fee_type; $resp .= timestamp; + if ( $circulation_status eq '01' ) { + $resp .= maybe_add( FID_SCREEN_MSG, "Item is damaged", $server ); + } + $resp .= add_field( FID_ITEM_ID, $item->id, $server ); $resp .= add_field( FID_TITLE_ID, $item->title_id, $server ); @@ -1220,6 +1225,7 @@ sub handle_item_information { $resp .= maybe_add( FID_CURRENT_LOCN, $item->current_location, $server ); $resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); + if ( my $CR = $server->{account}->{cr_item_field} ) { $resp .= maybe_add( FID_COLLECTION_CODE, $item->{$CR}, $server ); } else {