Barcode Printing on ERPNext

Hi, In order to generate barcodes based on qty, I have written a custom docType.
It takes Items as child table.

Custom print format for building Barcodes using https://github.com/lindell/JsBarcode.

barcode

But the problem is barcode is not showing on print.

2 Likes

Do you mean physical printer or PDF generation? How exactly are you trying to print this?

@rmeyer Phyiscal printer. I am using Chrome.

The ERPnext preview is perfect, Browser preview just before it takes printing command doesn’t show barcodes.

You need to check printer settings, i failed such issue on zebra zd888 but was using a different software it would print dark black in place of barcode.

Try to change printer settings

@fkardame Its nothing to with printer settings as its not showing barcode on print preview as well.

1 Like

We use https://github.com/metafloor/bwip-js - and host on our server. We use it to generate variable barcodes. You can use their public api. The advantage is that in print format you will pass a variable (custom html field; bcid is barcode type and variable portion to be modified is text=… in our case it is a variable URL) and then the api returns image - which works well with erpnext… you can test api as follows. Change bcid=code128 (?) and text= per example above…

https://bwipjs-api.metafloor.com/?bcid=qrcode&text=http%3A%2F%2Fgoo.gl%2F0bis&backgroundcolor=000000&scale=2

I am interested to know if / how you are structuring the barcode so that it can be imported in to ERPNext POS?

1 Like

Then you must be having a firewall which is not allowed the jscodes to be fetched.

as said by @zerodiscount host the js codes on local server and point it to the local file in the print format.

Yes we host it on offline pos too so we an print the offline_pos_name on the receipt

@fkardame - seems you have expertise in implementing ERPNext POS in retail. Is it possible to use a QR code type barcode that contains a URL (ERPNext API call) to post item and qty directly into POS at checkout? So this would allow customers to print a QR barcode sticker say at the vegetable aisle (QRCode would encode url to add item, qty and price?) - and then at checkout when scanned - it would enter into the POS cart - the item, qty and possibly price using the URL???

Any suggestions on how to implement item/ qty barcode for POS without storing that info in a doctype for each barcode ticket printed?

@avaiskhatri - you may have a CORS type issue - look into it…

Never worked on that, sounds like a good idea and also do-able but no idea how long it will take to customize and how much it will cost.

It all depends on how much the final user is ready to contribute and how much work it will reduce for the final end users.

You may need to add a “host_name” entry to site config. Like:

"host_name": "http://192.168.20.201"

It resolves image and pdf problems.

Adding host_name as “http://erp.example.com” did not worked. Same results. Print with empty spaces is coming.

Just click on Full page button and checked console.log it showing

jQuery is not defined

Which impliese frappe is not loading js libraries for print, on inspecting code there are not JS files being called.

Anyone who have used JS for print formats ??

@avaiskhatri have you got any solution. I am also facing same problem