@@ -, +, @@ field in CR instead of collection code --- C4/SIP/ILS/Item.pm | 4 ++++ C4/SIP/Sip/MsgType.pm | 25 ++++++++++++++++++------- etc/SIPconfig.xml | 1 + 3 files changed, 23 insertions(+), 7 deletions(-) --- a/C4/SIP/ILS/Item.pm +++ a/C4/SIP/ILS/Item.pm @@ -89,6 +89,8 @@ sub new { $self->{permanent_location} = $item->homebranch; $self->{collection_code} = $item->ccode; $self->{call_number} = $item->itemcallnumber; + $self->{'shelving_location'} = $item->location; + $self->{'permanent_shelving_location'} = $item->permanent_location; $self->{object} = $item; @@ -135,6 +137,8 @@ my %fields = ( barcode => 0, onloan => 0, collection_code => 0, + shelving_location => 0, + permanent_shelving_location => 0, call_number => 0, enumchron => 0, location => 0, --- a/C4/SIP/Sip/MsgType.pm +++ a/C4/SIP/Sip/MsgType.pm @@ -691,13 +691,18 @@ sub handle_checkin { $resp .= add_field( FID_PATRON_ID, $patron->id, $server ); } if ($item) { -$resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type, $server ); -$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); -$resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code, $server ); -$resp .= maybe_add( FID_CALL_NUMBER, $item->call_number, $server ); -$resp .= maybe_add( FID_HOLD_PATRON_ID, $item->hold_patron_bcode, $server ); -$resp .= add_field( FID_DESTINATION_LOCATION, $item->destination_loc, $server ) if ( $item->destination_loc || $server->{account}->{ct_always_send} ); -$resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name( $server->{account}->{da_field_template} ), $server ); + $resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type, $server ); + $resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); + $resp .= maybe_add( FID_CALL_NUMBER, $item->call_number, $server ); + $resp .= maybe_add( FID_HOLD_PATRON_ID, $item->hold_patron_bcode, $server ); + $resp .= add_field( FID_DESTINATION_LOCATION, $item->destination_loc, $server ) if ( $item->destination_loc || $server->{account}->{ct_always_send} ); + $resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name( $server->{account}->{da_field_template} ), $server ); + + if ( my $CR = $server->{account}->{cr_item_field} ) { + $resp .= maybe_add( FID_COLLECTION_CODE, $item->{$CR}, $server ); + } else { + $resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code, $server ); + } if ( $status->hold and $status->hold->{branchcode} ne $item->destination_loc ) { warn 'SIP hold mismatch: $status->hold->{branchcode}=' . $status->hold->{branchcode} . '; $item->destination_loc=' . $item->destination_loc; @@ -1214,6 +1219,12 @@ 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 { + $resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code, $server ); + } + if ( ( $i = $item->fee ) != 0 ) { $resp .= add_field( FID_CURRENCY, $item->fee_currency, $server ); $resp .= add_field( FID_FEE_AMT, $i, $server ); --- a/etc/SIPconfig.xml +++ a/etc/SIPconfig.xml @@ -55,6 +55,7 @@ ct_always_send="1" cv_triggers_alert="1" allow_empty_passwords="1" + cr_item_field="shelving_location" ae_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" --