Bug 12021 - SIP2 checkin should alert on transfer and use CT for return branch

This small patch corrects the SIP2 checkin response if branch transfer is needed.
It depends on bug 7981 and also removes an obsolete alert check in SIP2.

Test plan:
 - apply bug 7981
 - make sure syspref AutomaticItemReturn is false
 - check 'Return policy' in 'Default checkout, hold and return policy'
 - make a SIP2 checkout and checkin from a branch different than item's home branch.
 - verify that SIP2 response gives alert CV04 (=send to different branch)
 - also verify that response field CT gives correct branch according to 'Return policy'

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Followed test plan, works as expected
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit a98b5468ba)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Benjamin Rokseth 2014-04-01 14:07:59 +02:00 committed by Julian Maurice
parent 306a0fceb9
commit 2dbb6a6942
2 changed files with 4 additions and 12 deletions

View File

@ -80,19 +80,19 @@ sub do_checkin {
$self->alert_type('99');
}
if ($messages->{Wrongbranch}) {
$self->destination_loc($messages->{Wrongbranch}->{Rightbranch});
$self->{item}->destination_loc($messages->{Wrongbranch}->{Rightbranch});
$self->alert_type('04'); # send to other branch
}
if ($messages->{WrongTransfer}) {
$self->destination_loc($messages->{WrongTransfer});
$self->{item}->destination_loc($messages->{WrongTransfer});
$self->alert_type('04'); # send to other branch
}
if ($messages->{NeedsTransfer}) {
$self->destination_loc($iteminformation->{homebranch});
$self->{item}->destination_loc($messages->{NeedsTransfer});
$self->alert_type('04'); # send to other branch
}
if ($messages->{WasTransfered}) { # set into transit so tell unit
$self->destination_loc($iteminformation->{homebranch});
$self->{item}->destination_loc($iteminformation->{homebranch});
$self->alert_type('04'); # send to other branch
}
if ($messages->{ResFound}) {

View File

@ -654,14 +654,6 @@ sub handle_checkin {
$resp .= 'U';
}
# apparently we can't trust the returns from Checkin yet (because C4::Circulation::AddReturn is faulty)
# So we reproduce the alert logic here.
if ( not $status->alert ) {
if ( $item->destination_loc and $item->destination_loc ne $my_branch ) {
$status->alert(1);
$status->alert_type('04'); # no hold, just send it
}
}
$resp .= $status->alert ? 'Y' : 'N';
$resp .= timestamp;
$resp .= add_field( FID_INST_ID, $inst_id );