I am currently trying to setup one for a while now with no luck. Please would be kind enough to share your custom script for the barcode thing itself. Several test i have done seem not to be scanning.
I made something like this and added to the Item dashboard section. It uses the same JS library that frappe uses, lindell/JsBarcode to render EAN13 barcodes. To download the label, I used tsayen/dom-to-image. So apparently, generating images won’t work on Safari or IE.
I also added a menu item to generate valid EAN13 barcodes by hashing the item_code. I hope I’m not breaking any laws generating pseudo random EAN13 codes.
Hi all
The barcode looks great
I have a query
How do i generate a valid Barcode
Does a bar code scanner scan both Ean and Upc-a in India or is there any specific for the country
anybody can provide a step by step help to implement it
the above code shown is in a image format, cant copy that code
Please help
Regards
Krishnan Hemanth
Hi @michaeleino@krishnanhemanth plz find below code for barcode generate…that i share in image!!, now i m trying to another way generate barcode once it complete i will share… Thank u…
Settings → Custom Script → Item-Client
frappe.ui.form.on('Item','validate', function(frm) {
var cur_doc = frm.doc;
frappe.model.set_value(cur_doc.doctype, cur_doc.name, "custom_bar_code", cur_doc.item_code);
if (cur_doc.custom_barcode_gener === 0) {
if(cur_doc.custom_bar_code){
$(frm.fields_dict['custom_barcode_image'].wrapper).html('<svg id="code128"></svg>');
$.getScript("/assets/frappe/js/lib/JsBarcode.all.min.js", function( data, textStatus, jqxhr ) {
JsBarcode("#code128", cur_doc.custom_bar_code, {
height: 40,
width: 2,
fontSize: 11,
flat: true,
background: "#FFFFFF"
});
var svg = $('#code128').parent().html();
frappe.model.set_value(cur_doc.doctype, cur_doc.name, "custom_barcode_svg", svg);
frappe.model.set_value(cur_doc.doctype, cur_doc.name, "custom_barcode_gener", 1);
cur_frm.save();
});
} else
{
frappe.msgprint(__("Eles Please enter Barcode to to be printed"));
}
}
})