New Barcode Type info

@pratu16x7 sure i will …

i was thinking something like Select options, kind of:

Question is, how can i get values from Options in field definition?

1 Like

Excellent! That would be perfect for setting the type (you wouldn’t need the "type: ", just EAN13). Every control object has an options property that receives whatever you set in there. There’s width as well, but not height as far as I’ve seen. For all these JsBarcode properties you can’t map this cleanly, we’d have to think creatively.

that’s why i was thinking having kind of property: value, is not clean?

The options field is of type small text and not code, so it’s not standard to use it to parse complex strings like key value pairs, but it is possible. We’ve so far used it to parse single values or list of options at the most :slight_smile:

i see, if you consider the pair property: value as string:

format: "EAN13"
font: "OCR-B"

and convert \n into ,. At that point could be possible to set option into JSBarcode, like:

JsBarcode(svg, value).options({format: "EAN13", font: "OCR-B"})

Could be a solution?

Sure, as I mentioned, it is possible. Send in a PR for this, and if this is not the only use case, we’ll see if options can be a code field as well.

I’ll try to send a PR …can u just let me know how to get options inside ControlBarcode

So in ControlBarcode you can access it as this.options

Oh ok …stupid me … :grimacing: i’ll try to send a PR

:+1: Yippee!!!

Finally we are close to having a native barcode printing solution in ERPNext.
I look forward to having a chance to test this. I print several hundred barcode labels per day already and I really want to get rid of the clunky 3rd party printing software.

I am not a developer or coder, but if there is anything I can do to help you can count on my support! :grinning:

BKM

You can already test in develop branch …i’m going to send a PR to have more options …

Got it !!

Will set up a developer server this afternoon. I will populate it with a copy of my live data and test over the weekend.

Thanks!

BKM

1 Like

here it comes:

3 Likes

@pratu16x7 why barcode type field cannot be set as unique?

@pratu16x7 seems there is some problem when saving doc with Barcode Field, see gif at:

http://recordit.co/1FPyShatYN

Edit:

I’m still getting black square once doc is saved, any hint on how to fix it?

You need to enable the Ignore XSS Filter in the field to make sure the svg data is saved as is in db.

2 Likes

@pratu16x7 thx for the hint!

@pratu16x7 probably it’s needed to show Ignore XSS Filter in Customize Form if Field Type is Barcode or set it by default

Edit: it works! Thx

This is brilliant, Here’s a video showing how entire workflow is done just on barcodes without data entry.

1 Like