Has anybody built a custom app to replace the ERPNext barcode scanner?
Many of the labels I scan have multiple barcodes, and it’s impossible to use the camera-based barcode scanner that ERPNext provides because I can’t accurately enough scan the barcode I need.
I need a way to override the ERPNext barcode scanner and use a different Javascript barcode scanning library.
Basically I don’t need to change what the ERPNext barcode scanner actually does, but the javascript-based barcode scanner that ships with ERPNext doesn’t work for me at all.
For instance, Ubiquiti hardware ships with a small label that has 3 different barcodes on it, and they are printed very small, so I can’t get the barcode I need to scan in the window by itself.
I believe there are javascript libraries that can scan multiple barcodes and allow the user to select which barcode is actually copied/read.
Yes it should be possible, maybe with a client script but for sure with an app. You would disable frappe scanner, replace with your own, scan, then pass the retrieved string into the same barcode field.
I am by no means an expert - this is an option as a high level overview:
Remove the scan button element from the barcode field
Add your own scan button element in it’s place
Trigger a modal on click with frappe.ui.Dialog
The model loads your version of the scanner with the library of your choice
handle any other user inputs within the modal
On modal completion, push the retrieved string into the barcode field. With something like:
frm.set_value('scan_barcode', decodedTextFromYourScanner)
.then(() => {
// optional: refresh the field or trigger any downstream logic
frm.refresh_field('scan_barcode');
});
Why not go the easier option of buying a barcode scanner that can read multiple barcodes and return the only the data you need.
I’ve used Zebra scanners to read GS1 data matrix info and configured it to report back only the info I was interested in, and in the order I wanted it to be presented, even including tabs to the next field before entering the data.
Other manufacturers have similar options, Zebra is the only one I have first actually used
Because I’d rather not give my guys another device to have to carry around and maintain…
Many on my employees have to scan barcodes, but relatively infrequently. For example the field sales team may only have to scan barcodes a couple times a month, but when they do they might have a couple dozen barcodes to scan.
In that scenario, it doesn’t make sense to make them worry about carrying around a dedicated device just to scan barcodes.