Bugzilla – Attachment 158321 Details for
Bug 34529
Offline circulation should be able to accept userid as well as cardnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34529: Offline circulation should be able to accept userid as well as cardnumber
Bug-34529-Offline-circulation-should-be-able-to-ac.patch (text/plain), 2.64 KB, created by
Kyle M Hall (khall)
on 2023-11-03 10:49:59 UTC
(
hide
)
Description:
Bug 34529: Offline circulation should be able to accept userid as well as cardnumber
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-11-03 10:49:59 UTC
Size:
2.64 KB
patch
obsolete
>From 3831eb544f4beb8e30cc0baf66aac1b691932dc8 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 14 Aug 2023 10:55:09 -0400 >Subject: [PATCH] Bug 34529: Offline circulation should be able to accept > userid as well as cardnumber > >Like everywhere else in Koha, offline circulation should be able to use userid as well as cardnumber to look up the patron for a transaction ( checkouts and fine payments ). > >Test Plan: >1) Apply this patch >2) Restart all the things! >3) Download the test.koc file attached to this bug >4) Verify you have an item with the barcode 39999000001396 > create it if needed >5) Set a patron's username to "hacevedo" >6) Upload and import the test.koc file into offline circ >7) Verify the item was checked out and the payment was made > >Signed-off-by: Philip Orr <philip.orr@lmscloud.de> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Circulation.pm | 4 +++- > offline_circ/list.pl | 8 +++++++- > 2 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index baab76fef6b..50123d37a13 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -4199,6 +4199,7 @@ sub ProcessOfflineIssue { > my $operation = shift; > > my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} } ); >+ $patron ||= Koha::Patrons->find( { userid => $operation->{cardnumber} } ); > > if ( $patron ) { > my $item = Koha::Items->find({ barcode => $operation->{barcode} }); >@@ -4232,7 +4233,8 @@ sub ProcessOfflineIssue { > sub ProcessOfflinePayment { > my $operation = shift; > >- my $patron = Koha::Patrons->find({ cardnumber => $operation->{cardnumber} }); >+ my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} } ); >+ $patron ||= Koha::Patrons->find( { userid => $operation->{cardnumber} } ); > > $patron->account->pay( > { >diff --git a/offline_circ/list.pl b/offline_circ/list.pl >index 252dc8594b8..2838a185309 100755 >--- a/offline_circ/list.pl >+++ b/offline_circ/list.pl >@@ -48,7 +48,13 @@ for (@$operations) { > $_->{'bibliotitle'} = $biblio->title; > $_->{'biblionumber'} = $biblio->biblionumber; > } >- my $patron = $_->{cardnumber} ? Koha::Patrons->find( { cardnumber => $_->{cardnumber} } ) : undef; >+ >+ my $patron = >+ $_->{cardnumber} >+ ? Koha::Patrons->find( { cardnumber => $_->{cardnumber} } ) >+ || Koha::Patrons->find( { userid => $_->{cardnumber} } ) >+ : undef; >+ > if ($patron) { > $_->{'borrowernumber'} = $patron->borrowernumber; > $_->{'borrower'} = ($patron->firstname ? $patron->firstname:'').' '.$patron->surname; >-- >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 34529
:
154403
|
154411
|
155969
|
155970
|
158140
|
158141
|
158321
|
158322
|
158323
|
158324
|
158380
|
158381
|
158382
|
158383