Bug 20251: (bug 19280 follow-up) FIX SIP checkout
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 28 Feb 2018 15:57:25 +0000 (12:57 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 15 Mar 2018 08:17:10 +0000 (08:17 +0000)
Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/SIP/ILS/Patron.pm
C4/SIP/ILS/Transaction/Checkout.pm

index 17034c0..1a90b77 100644 (file)
@@ -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;
index eabe1cd..23cdec9 100644 (file)
@@ -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