From 184541269307726d7b457ff8beb9637adcd5016b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 28 Feb 2018 12:57:25 -0300 Subject: [PATCH] Bug 20251: (bug 19280 follow-up) FIX SIP checkout Signed-off-by: Colin Campbell Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- C4/SIP/ILS/Patron.pm | 2 -- C4/SIP/ILS/Transaction/Checkout.pm | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm index 17034c0d0f..1a90b77505 100644 --- a/C4/SIP/ILS/Patron.pm +++ b/C4/SIP/ILS/Patron.pm @@ -67,7 +67,6 @@ sub new { { no warnings; # any of these $kp->{fields} being concat'd could be undef %ilspatron = ( - getmemberdetails_object => $kp, name => $kp->{firstname} . " " . $kp->{surname}, id => $kp->{cardnumber}, # to SIP, the id is the BARCODE, not userid password => $pw, @@ -164,7 +163,6 @@ my %fields = ( recall_overdue => 0, # for patron_status[12] too_many_billed => 0, # for patron_status[13] inet => 0, # EnvisionWare extension - getmemberdetails_object => 0, ); our $AUTOLOAD; diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm index eabe1cde89..23cdec92c4 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/C4/SIP/ILS/Transaction/Checkout.pm @@ -54,9 +54,10 @@ sub do_checkout { my $patron_barcode = $self->{patron}->id; my $overridden_duedate; # usually passed as undef to AddIssue $debug and warn "do_checkout: patron (" . $patron_barcode . ")"; - my $borrower = $self->{patron}->getmemberdetails_object(); + my $patron = Koha::Patrons->find( { cardnumber => $patron_barcode } ); + my $borrower = $patron->unblessed; $debug and warn "do_checkout borrower: . " . Dumper $borrower; - my ($issuingimpossible, $needsconfirmation) = _can_we_issue($borrower, $barcode, + my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, C4::Context->preference("AllowItemsOnHoldCheckout") ); @@ -149,10 +150,10 @@ sub do_checkout { } sub _can_we_issue { - my ( $borrower, $barcode, $pref ) = @_; + my ( $patron, $barcode, $pref ) = @_; my ( $issuingimpossible, $needsconfirmation, $alerts ) = - CanBookBeIssued( $borrower, $barcode, undef, 0, $pref ); + CanBookBeIssued( $patron, $barcode, undef, 0, $pref ); for my $href ( $issuingimpossible, $needsconfirmation ) { # some data is returned using lc keys we only -- 2.39.5