Bugzilla – Attachment 137622 Details for
Bug 12225
SIP does not respect the "no block" flag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12225: Re-implement no block flag for checkouts
Bug-12225-Re-implement-no-block-flag-for-checkouts.patch (text/plain), 4.48 KB, created by
Kyle M Hall (khall)
on 2022-07-12 11:51:37 UTC
(
hide
)
Description:
Bug 12225: Re-implement no block flag for checkouts
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-07-12 11:51:37 UTC
Size:
4.48 KB
patch
obsolete
>From edda983a3ce72944694d2e80a6c4e40277b485e7 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Tue, 12 Jul 2022 07:46:31 -0400 >Subject: [PATCH] Bug 12225: Re-implement no block flag for checkouts > >Test Plan ( assuming Koha Testing Docker or kohadevbox ): >1) Check out master >2) Start the SIP server ( edit the SIP config koha instutution to be > "CPL" instead of "kohalibrary" ) >3) Telnet to 6001 >4) Send 9300CNkoha|COkoha|CPCPL| >5) Send 11YY20220711 16350220250711 163502AOCPL|AA23529000035676|AB39999000001396|ACkoha|BON|BIN| >6) Note the due date for the checkout in Koha is not in the year 2025: > Henry Acevedo (23529000035676) checked out Philippics. by Cicero, Marcus Tullius. 39999000001396 >7) Apply this patch set >8) Restart all the things! >9) Check in the checkout >10) Repeat steps 3 through 5 >11) Note the due date is now in 2025! >--- > C4/SIP/ILS.pm | 4 ++-- > C4/SIP/ILS/Transaction/Checkout.pm | 22 +++++++++++++++++++++- > C4/SIP/Sip/MsgType.pm | 2 +- > 3 files changed, 24 insertions(+), 4 deletions(-) > >diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm >index e6c75671be8..ff9ee74067d 100644 >--- a/C4/SIP/ILS.pm >+++ b/C4/SIP/ILS.pm >@@ -121,7 +121,7 @@ sub offline_ok { > # the response. > # > sub checkout { >- my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack, $account ) = @_; >+ my ( $self, $patron_id, $item_id, $sc_renew, $fee_ack, $account, $no_block_due_date ) = @_; > my ( $patron, $item, $circ ); > $circ = C4::SIP::ILS::Transaction::Checkout->new(); > # BEGIN TRANSACTION >@@ -153,7 +153,7 @@ sub checkout { > $circ->screen_msg("Item checked out to another patron"); > } > else { >- $circ->do_checkout($account); >+ $circ->do_checkout($account, $no_block_due_date); > if ( $circ->ok ) { > > # If the item is already associated with this patron, then >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index b9fa51979e9..c1c1e18eeb4 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -17,7 +17,7 @@ use C4::SIP::ILS::Transaction; > use C4::Context; > use C4::Circulation qw( AddIssue GetIssuingCharges CanBookBeIssued ); > use C4::Members; >-use Koha::DateUtils; >+use Koha::DateUtils qw( dt_from_string ); > > use parent qw(C4::SIP::ILS::Transaction); > >@@ -41,6 +41,7 @@ sub new { > sub do_checkout { > my $self = shift; > my $account = shift; >+ my $no_block_due_date = shift; > siplog('LOG_DEBUG', "ILS::Transaction::Checkout performing checkout..."); > my $shelf = $self->{item}->hold_attached; > my $barcode = $self->{item}->id; >@@ -49,6 +50,18 @@ sub do_checkout { > my $prevcheckout_block_checkout = $account->{prevcheckout_block_checkout}; > my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, 0); > >+ if ( $no_block_due_date ) { >+ my $year = substr($no_block_due_date,0,4); >+ my $month = substr($no_block_due_date,4,2); >+ my $day = substr($no_block_due_date,6,2); >+ my $hour = substr($no_block_due_date,12,2); >+ my $minute = substr($no_block_due_date,14,2); >+ my $second = substr($no_block_due_date,16,2); >+ >+ my $iso = "$year-$month-$day $hour:$minute:$second"; >+ $no_block_due_date = dt_from_string( $iso, "iso" ); >+ } >+ > my $noerror=1; # If set to zero we block the issue > if (keys %{$issuingimpossible}) { > foreach (keys %{$issuingimpossible}) { >@@ -113,10 +126,17 @@ sub do_checkout { > $noerror = 0; > } > } >+ >+ if ( $no_block_due_date ) { >+ $overridden_duedate = $no_block_due_date; >+ $noerror = 1; >+ } >+ > unless ($noerror) { > $self->ok(0); > return $self; > } >+ > # can issue > my $issue = AddIssue( $patron->unblessed, $barcode, $overridden_duedate, 0 ); > $self->{due} = $self->duedatefromissue($issue, $itemnumber); >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 0de5f1faccd..74e7dfff248 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -532,7 +532,7 @@ sub handle_checkout { > # not a lot we can do about it > siplog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} ); > >- $status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); >+ $status = $ils->checkout( $patron_id, $item_id, $sc_renewal_policy, $fee_ack, $account, $nb_due_date ); > } else { > > # Does the transaction date really matter for items that are >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12225
:
37446
|
137578
|
137622
|
137655
|
137656
|
137683
|
137712
|
137713
|
139684
|
139685
|
139686
|
139691
|
139706
|
139707
|
139708
|
139709
|
139710