Two things are happening. First, the SELECT does not account for a branchcode greater than 2 chars. This is fixed by just selecting the final four digits representing the incremental suffix from the barcode field. Second, the incremental suffix (4 digits) is not rolling back over to zero when reaching 9999. This pattern probably needs help. It should allow for cataloging of 10000 items per month as is. I would not recommend doing barcode numbering this way, but need to support it since it is in use in at least one library.
Pull request sent. Patch here: http://git.koha-community.org/gitweb/?p=wip/koha-fbc.git;a=commit;h=67a09248aff57d6016ad260e46adbdd54d4dcbcf
Created attachment 3655 [details] [review] patch (find on second comment) commit on git.koha-community.org 9 Sep 2010
Pushed, please test
*** Bug 6093 has been marked as a duplicate of this bug. ***