Bug 30140

Summary: Allow for autoMemberNum to generate cardnumbers with leading zeros
Product: Koha Reporter: Fernando Soares <fsoares>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: anke.bruns, gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Fernando Soares 2022-02-21 01:30:18 UTC
If you have autoMemberNum turned on it doesn't check the CardnumberLength system preference when generating a number.

Example:

- last cardNumber is '002150'.
- CardnumberLength set to '6'.
- autoMemberNum turned on.

When I create new patron and save it, then the new cardNumber generated by system via autoMemberNum will be '2151' and not '002151' as expected due CardnumberLength set to '6'.
Comment 1 Katrin Fischer 2022-02-21 08:10:20 UTC
Hi Fernando, 

CardnumberLength is supposed to be used for checking that entered cardnumbers are valid. It doesn't work the way you want to in adding the leading zeros. The autoMemberNum is just made to add 1 to the biggest cardnumbernumber in your system. At the moment it can't handle adding leading zeros, but I think that would have to be a separate pref or option.
Comment 2 Anke Bruns 2022-11-29 16:34:26 UTC
This would be a great enhancement!