ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Barcode Label Printing


#1

Need to make a custom print format to print barcode labels from purchase receipt/Material receipt document.
Example: Purchase receipt have 10 item and each item is 1 quantity. then the print format printable areas should loop and make 10 labels with each item row detail.

I am able to pull the item row data in one printable area only. Would like someone to help me understand the page break and loop function in jinja.


#2

refer this http://jinja.pocoo.org/docs/2.10/templates/#for


#3

Yes dear, Reading that only right now.

Thanks


#4

I was able to achieve the page break for loop next I want to know how to multiple the print quantity.
Example:
item A - 1 Qty
Item B - 2 Qty
Item C - 5 Qty

So loop should display ItemA 1 time, Item B 2 Times and Item C 5 times.
Any idea?


#5

Hello,
I have written custom script to get the above function.
It works in erpnext print button and displays the

{%- for row in doc.items -%}
{%- for qty in range(row.qty) -%}
{{ row. item_code }}
{{row.item_name }}
{{ row.get_formatted(“amount”) }}
{%- endfor -%}
{%- endfor -%}

The print shows {{body}}

it happens as I have put 2 For statement to make loop.

Anyone have any idea on this?


#6

Finally got it working.
Below labels are printed from erpnext purchase receipt document.


Below is sales invoice with its number in barcode format.
This is also done in pos invoice. Barcode at the end of the receipt.


#7

#8

Are these printed as images or sent to the printer as barcode?


#9

Reply from @fkardame

The barcode are sent directly to the printer using print format and not as image.

Using jinja(for pulling items and quantity in row) html(for text and alignments), js(for barcode using SVG) and css (for print media size - can decide the barcode label size ) we are using 1.5inch width *1inch
Created a “barcode label” print format in purchase receipt and material receipt.
So after submission they can just print and select barcode label and print the barcodes in zebra printer from the browser. But not too forget to remove the margin as default and replace is by none and also disable header and footer from print setting in the browser or else it will print the url also.
Hope this will help users in retail business.


Print Barcode labels