Bug 27908: Add support for circulation status 1 ( other ) for damaged items

Some libraries would like to transmit if an item is damaged via the
circulation status field. There is no specific code for a damaged item,
so we should use value 1 (other) along with an AF screen message to
describe the reason for the the circulation status of 1.

Test Plan:
1) Apply these patches
2) prove t/db_dependent/SIP/Transaction.t

Signed-off-by: Christopher Kellermeyer - Altadena Library District <ckellermeyer@altadenalibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Kyle M Hall 2021-03-10 10:45:18 -05:00 committed by Jonathan Druart
parent e4b1bb5b27
commit 5b17567f2b
2 changed files with 10 additions and 1 deletions

View File

@ -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
}

View File

@ -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 {