Barcode use for work orders

Hello all,

I tried checking whether we can print and use bar codes for work orders and job cards?

is this function available in ERPNEXT? inputs will be useful.

thanks in advance

@NCP : hi, would eagerly waiting for this reply?

Appreciate your suggestion.

barcodes are for items . can you explain more ?

When we release production order, Job cards will be created for every operation in ERPNEXT. so what am expecting in ERPNEXT is, the moment it generates job card, Bar code should be generated and assigned to each job card.

so when an operator completes activity , he scan using bar code machine( CODE 128) and completes work. so from the management perspective it becomes very easy to trace how many work orders are opne /closed/WIP through dashboard. Or else manually generating excel report is not viable.

Hi:

You can create a print format for work orders / job cards …
Insert an HTML field with this content:

<svg class="barcode"
				jsbarcode-margin="0"
				jsbarcode-margintop="0"
				jsbarcode-marginbottom="1"
				jsbarcode-height="25"
				jsbarcode-width="1"
				jsbarcode-fontsize="12"
				jsbarcode-flat="true"
				jsbarcode-value="{{doc.name}}"/></br>

<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/JsBarcode.all.min.js"></script>

<script>
JsBarcode(".barcode").init();
</script>

It will be showed on your print format this way:

Other way could be by customizing Work Order Doctype and adding a barcode field, and creating client script to assign work order id to this field on document saving. I think print format approach is faster and cleaner :slight_smile:

Hope this helps.

@avc : thanks for sharing information. since am very new to ERPNEXT (Not a tech guy :slight_smile: )

“where do i find HTML field” to insert along with above mentioned content?

Please mention few steps so that i can work it out myself in easy manner.

2nd question is - Once route card gets printed with bar code, how do we scan it ? each operation wise? or complete work order wise?

thanks
Prasad

Hi:

It’s really easy.

  1. Create a new print format for Work Order doctype (search Print Format on awesome bar).

  2. Then, use Edit Format, and configure your print layout as desired …

  3. Drag Custom HTML on your layout, and edit it with code:

<svg class="barcode"
				jsbarcode-margin="0"
				jsbarcode-margintop="0"
				jsbarcode-marginbottom="1"
				jsbarcode-height="25"
				jsbarcode-width="1"
				jsbarcode-fontsize="12"
				jsbarcode-flat="true"
				jsbarcode-value="{{doc.name}}"/></br>

<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.0/dist/JsBarcode.all.min.js"></script>

<script>
JsBarcode(".barcode").init();
</script>
  1. Save the print format.

  2. Open your work order and print it. Select your print format (if you configure it as default, this step is not needed …)

More information here:
https://docs.erpnext.com/docs/v14/user/manual/en/setting-up/print/print-format

And here:

About your 2nd question … well, it will really depends on your manufacturing strategy . Job card is related to work order operations ( 1 WO contains X JobCards), so maybe you can create print format based on job card instead work order. User can scan barcode to locate te job card on listview and add time, etc … Maybe you are looking for a simpler interface for workers, you will need customization.

Enjoy!
Hope this helps.

3 Likes

hey @avc

I thought JSbarcode won’t work with erpnext, blocked by wkhtmltopdf … and only works when we choose “full page mode” print mode.

I have been planning for a month now to print barcode labels for items, and I was unable to get it done in print format, up to the point I have to download the item list templates in excel and try to fetch data from excel using javascript in an external browser using sheetjs. Then I also ran into trouble that I don’t even know where to fix.

I was wondering if you can, and if it is possible to, select in item list which barcodes labels we would like to print.

Thanks!

Hi:

Barcode is not shown on preview (just appears a blank space …). But printing is working fine (v14 at least)

I don’t know any standard method to select items before label printing. Actually, maybe is not easy to think about this as standard process. Label printing could be useful in a wide range of scenarios: label for id on stock, for pricing/retail, with number series or batches, on material receipt, … In each case, approach should be different, and data source would be different too (Item, Item Price, Material Receipt, Batch, etc …) Anyway, customization will be needed for your each case.

There are a lot of threads talking about it on this forum … this is an interesting one:

Hope this helps.

yeah u are correct, i just tried and it does show the barcode in print despite blank in preview in erpnext. weird.

I also look at the thread, but I can’t see instructions on how to print multiple erpnext items barcode labels. I can only print 1 by 1 by manually entering into each item…

Do we need to customize a form to make it happen?

I read there is this loop

{%- for item in doc.items -%}
{% set item_barcode = frappe.get_doc("Item Barcode", {"parent": item.item_code, "idx": 1,}) %}
{% set item_details = frappe.get_doc("Item", item.item_code) %}
{% for i in range((item.qty) |round|int ) %}

Do you know what it means?

thanks

Great thanks for your time and suggestion. let me check and update