my $resval;
($resval, $patronid) = checkpw($dbh, $patronlogin, $patronpw);
}
-my $borrower = Koha::Patrons->find( { cardnumber => $patronid } )->unblessed;
+
+my $borrower;
+if ( $patronid ) {
+ $borrower = Koha::Patrons->find( { cardnumber => $patronid } );
+ $borrower = $borrower->unblessed if $borrower;
+}
my $currencySymbol = "";
if ( my $active_currency = Koha::Acquisition::Currencies->get_active ) {
}
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
my ($doreturn) = AddReturn( $barcode, $branch );
- #warn "returnbook: " . $doreturn;
- $borrower = Koha::Patrons->find( { cardnumber => $patronid } )->unblessed;
}
-elsif ( $op eq "checkout" ) {
+elsif ( $borrower and $op eq "checkout" ) {
my $impossible = {};
my $needconfirm = {};
( $impossible, $needconfirm ) = CanBookBeIssued(
}
} # $op
-if ($borrower->{cardnumber}) {
+if ($borrower) {
# warn "issuer's branchcode: " . $issuer->{branchcode};
# warn "user's branchcode: " . $borrower->{branchcode};
my $borrowername = sprintf "%s %s", ($borrower->{firstname} || ''), ($borrower->{surname} || '');