Topic: Numeric BarCode restriction / Valid Alphanumeric filter
A recent commit restricts BarCodes to be generated only if the stock_id is an integer.
This was done since the Barcode generation routine generated errors on malformed input as a stop-gap arrangement since the auto generation of Barcode stock_id was restricted to a random / sequential available number.
The file /reporting/includes/barcodes.php manages Barcode generation and is taken from the TCPDF Library.
In the said library above, each type of barcode is properly generated with the appropriate methods listing the valid ASCII codes and size range / limits along with check-digit computations and verification where enabled.
Clearly, the stock_id and item_code fields are VARCHAR in the FA DB and several BarCode formats support alphanumeric characters (CODE128, Codabar, etc) and some even symbols too.
The need now is to hammer out a function to validate the stock_id before allowing the generation of the barcode in pure PHP without external dependancies so that errors don't get generated while doing so during generation.
Blindly suppressing all errors during Barcode generation and leaving it blank when not possible to generate on for whatever reason is a simplistic but effective choice for many.