Bug 15765 - Request to replace borrowernumber list by cardnumber
Summary: Request to replace borrowernumber list by cardnumber
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: 3.22
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-09 12:22 UTC by Heinrich Hartl
Modified: 2023-01-25 19:29 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Attempt to add a non-existent borrower number (61.73 KB, image/png)
2016-02-10 18:01 UTC, Chris Nighswonger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Hartl 2016-02-09 12:22:55 UTC
Change request: 
Substitute patron barcodes for patron numbers

Patron card creator is working with something called a batch. A batch is a list of patron numbers where patron number is the koha internal index of a patron. Unfortunately the patron number is to my knowledge a patron property that is not known elsewhere. E.g. it is not shown when displaying patron details. But even in the patron search part of patron card creator that number is not shown. In the patron search we see e.g. name and barcode of the patron.
Patron barcodes are familiar and found in many reports, in patron import and in patron displays.

I suggest to replace the list of patron numbers by a list of patron barcodes. 

Patron barcodes are also unique identifers of patrons, an unambigous index into the borrowers table.  An entered barcode not necessarily identifies an existing patron. However an entered patron number  is not more reliable since a patron may have been deleted or may not be existent.
Comment 1 Katrin Fischer 2016-02-09 20:35:15 UTC
Patron cardnumbers can be changed - that's the reason Koha uses the borrowernumber internally. The borrower number (I think that is meant by patron number?) is displayed on the details tab of the patron account, probably labelled as "Benutzernummer".

Maybe instead of replacing, we could make it also possible to use cardnumbers for adding to a batch? And also display the cardnumber in the table?

Similar to how the items batch tools accept both - the barcode and the internal itemnumber.
Comment 2 Heinrich Hartl 2016-02-10 09:19:03 UTC
Keep it simple is my only argument against adding a column. I tried to make clear that a borrower number entered is not yet validated (existing borrower?). For this reason borrower numbers are no better than barcodes, both need validation. I am not against adding the column but I think replacing is better. 
The not very likely change of a borrower barcode (here i may be wrong ... there could be situations when systematic changes of barcodes are done but in that situation would we reuse an old batch?) is the only situation where an entry in a batch would remain valid if the batch is kept as a borrower number list.
Comment 3 Katrin Fischer 2016-02-10 09:24:43 UTC
We could just add the column for display - not in the database. The borrowernumber will be used to look up the information, like it does for the name already.

In the database we should consistently use the borrowernumber for linking between tables, as it's the primary key. You can also use FK constraints to automatically delete a patron from the batches, when the patron record is deleted (not sure if that is the case currently, I haven't checked).
Comment 4 Chris Nighswonger 2016-02-10 18:01:34 UTC
Created attachment 47862 [details]
Attempt to add a non-existent borrower number
Comment 5 Chris Nighswonger 2016-02-10 18:01:54 UTC
(In reply to Heinrich Hartl from comment #2)
> I tried to make
> clear that a borrower number entered is not yet validated (existing
> borrower?). For this reason borrower numbers are no better than barcodes,
> both need validation.

Maybe I'm misunderstanding what you mean by "not validated" in the context above. But the way in which borrowers are added to a batch is by selecting them from patron search results. Because of this, one cannot add a "non-existent" borrower number to a batch.

If you attempt to add an "invalid" borrower number via cgi call such as this:

cgi-bin/koha/patroncards/edit-batch.pl?borrower_number=10000&batch_id=738&op=add

The script will return an error like the one on the attached screen shot.

However, adding the patron barcode to the batch display should be straightforward.
Comment 6 Heinrich Hartl 2016-02-13 09:15:59 UTC
Thank you Chris for your comments, they made me look at my proposal again.

I did some testing: 
I tried to enter an invalid borrowernumber. It was silently ignored when pushing the ADD button. Since something I normally would like to be achieved failed, I would prefer to get a warning message.
After the batch was set up I deleted a patron (both with tool batch deletion and also with patro/more/delete). In both cases the patron was also removed from the batch list.
+++ The required input validation is in place :-)

I scanned through the patron reports. There I found an almost balanced result: cardnumber is used only slightly more frequently than borrower number. It seem to be a personal preference, finding myself clearly on the cardnumber side.

To accomodate both preferences I agree with Katrin: why not have both in the table.

Please have a look at patroncards/add_user_search.pl table:
Card / Name / Category / Library / Expires / Notes / Add
where Card holds cardnumber (which barcode string), Name holds surname, firstname(cardnumber), ...  
and compare it with patroncards/edit-batch.pl table: 
Borrower Name / Borrower number / Action / Select
Where Borrower Name again is surname, firstname and Action is Delete | Export

add_user_search displays barcodes string twice. 
add_user_search panal could be improved by more clearly indicating which fields are searched for the entered search string. I would like very much if a select column together with "select all" and "add selected" buttons were added!

If the contents of the add_user_search table are judged satisfactory why not display consistent and rich information when displaying edit-batch.pl table?
Comment 7 Michael Hafen 2023-01-25 19:29:44 UTC
Re: the "select all" and "add selected".  I have an enhancement bug to add sort1 and sort2 to add_user_search.pl which also adds those buttons.
See Bug 28726