Bug 38486: [24.05.x] For SIP allow noblock checkouts reguardless of normal patron checkout blocks
The purpose of no block checkouts in SIP is to indicate that the SIP machine has made an offline ( "store and forward" ) transaction.
The patron already has the item. As such, the item must be checked out to the patron or the library risks losing the item do to lack of tracking.
As such, no block checkouts should not be blocked under any circumstances.
The sub C4::SIP::ILS::Transaction::Checkout::do_checkout already honors this, but it is wrapped by
C4::SIP::ILS::checkout which has additional checks that do not.
Test Plan:
1) Apply the unit test patch
2) prove t/db_dependent/SIP/Transaction.t will fail
3) Apply the second patch
4) prove t/db_dependent/SIP/Transaction.t will pass!
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 56d2ccc3f7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
8e3a5dd83e
commit
ee3d76672a
|
|
@ -132,12 +132,36 @@ sub checkout {
|
|||
# BEGIN TRANSACTION
|
||||
$circ->patron( $patron = C4::SIP::ILS::Patron->new($patron_id) );
|
||||
$circ->item( $item = C4::SIP::ILS::Item->new($item_id) );
|
||||
|
||||
if ($fee_ack) {
|
||||
$circ->fee_ack($fee_ack);
|
||||
}
|
||||
|
||||
if ( !$patron ) {
|
||||
$circ->screen_msg("Invalid Patron");
|
||||
}
|
||||
elsif ( !$item ) {
|
||||
$circ->screen_msg("Invalid Item");
|
||||
}
|
||||
elsif ( $no_block_due_date ) {
|
||||
# A no block due date means we need check this item out to the patron
|
||||
# regardless if fines, restrictions or any other things that would
|
||||
# typically prevent a patron from checking out.
|
||||
# A no block transaction is used for send offline ( store and forward )
|
||||
# transaction to Koha. The patron already has possession of the item
|
||||
# so it should be checked out to the patron no matter what.
|
||||
$circ->do_checkout( $account, $no_block_due_date );
|
||||
|
||||
$item->{borrowernumber} = $patron_id;
|
||||
$item->{due_date} = $circ->{due};
|
||||
push( @{ $patron->{items} }, { barcode => $item_id } );
|
||||
$circ->desensitize( !$item->magnetic_media );
|
||||
|
||||
siplog(
|
||||
"LOG_DEBUG", "ILS::Checkout: patron %s has checked out %s via a no block checkout",
|
||||
$patron_id, join( ', ', map { $_->{barcode} } @{ $patron->{items} } )
|
||||
);
|
||||
}
|
||||
elsif ( !$patron->charge_ok ) {
|
||||
if ($patron->debarred) {
|
||||
$circ->screen_msg("Patron debarred");
|
||||
|
|
@ -169,7 +193,9 @@ sub checkout {
|
|||
$circ->screen_msg("Item type cannot be checked out at this checkout location");
|
||||
}
|
||||
else {
|
||||
$circ->do_checkout($account, $no_block_due_date);
|
||||
# No block checkouts were handled earlier so there is no need
|
||||
# to bass the no block due date here.
|
||||
$circ->do_checkout($account);
|
||||
if ( $circ->ok ) {
|
||||
|
||||
# If the item is already associated with this patron, then
|
||||
|
|
|
|||
Loading…
Reference in New Issue