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:
parent
4fb88deaa7
commit
a2ee6443b9
1 changed files with 10 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue