Bug 3704: SIP Checkin of not checked out item returns error without reason

Checking in an available item returns an error (which is correct) without
giving a reason for the failure as screen_msg (aka AF field in SIP2 is empty).

Based on code suggested by Patrick Langer <patrick.langer@easycheck.org>

Signed-off-by: Ulrich Kleiber <ulrich.kleiber@bsz-bw.de>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Katrin Fischer 2011-09-02 16:21:23 +02:00 committed by Chris Cormack
parent 4fb88deaa7
commit a2ee6443b9

View file

@ -190,12 +190,16 @@ sub checkin {
# It's ok to check it in if it exists, and if it was checked out
$circ->ok($item && $item->{patron});
if ($circ->ok) {
$circ->patron($patron = new ILS::Patron $item->{patron});
delete $item->{patron};
delete $item->{due_date};
$patron->{items} = [ grep {$_ ne $item_id} @{$patron->{items}} ];
}
if (!defined($item->{patron})) {
$circ->screen_msg("Item not checked out");
} else {
if ($circ->ok) {
$circ->patron($patron = new ILS::Patron $item->{patron});
delete $item->{patron};
delete $item->{due_date};
$patron->{items} = [ grep {$_ ne $item_id} @{$patron->{items}} ];
}
}
# END TRANSACTION
return $circ;