Einvoice features in version 10

I am trying to implement einvoice features in Erpnext version 10 via custom app.
Irn code generated successfully but Qrcode file saved with 0 bites & blank content.
I am following the below code:
qr_image = io.BytesIO()
url = qrcreate(qrcode, error=‘L’)
url.png(qr_image, scale=2, quiet_zone=1)
_file = frappe.get_doc({
“doctype”: “File”,
“file_name”: filename,
“attached_to_doctype”: doctype,
“attached_to_name”: docname,
“attached_to_field”: “qrcode_image”,
“is_private”: 1,
“content”: qr_image.getvalue()})
self.invoice.qrcode_image = _file.file_url
(copied the above code from erpnext erpnext/einvoice/utils.py)
_file. file_url return None and qr_image.getvalue() not getting save.


Hi Prashanta,
Did you manage to solve this? I’ve to implement the same in V11.


Yes, I have copy the code from Erpnext github repo and modify as per our requirements in my custom app.

I’ve create a separate doctype for generate IRN after submit of the tax invoice.

I have a related question. Since you know e invoicing is now mandatory for qualifying companies, I have successfully added and linked e invoicing service to my erpnext portal.
However the QR Code is really very big in size and looks out of the place. I use a custom print format for invoice and have placed IGN and QR code in my print format already. So the question being how I can resize the QR code and make it smaller in size.

<img src={{ doc.qrcode }} width=“160px” height=“155px” style=“float: left;”>

you can also add td width like

I just added this script to my custom format, but the QR code is not being fetched.

I am sorry for my novice questions, this is quite new to me.

doc.qrcode would be you attach image name i.e doc.qrcode_image

Thanks a ton for the help, now I am able to adjust the image size.
The only issue is I can either align it to left or right. I tried to change this (style=“float: left;”) attribute to centre/middle but in that case the QR is aligned on the left only.

Thanks again, you have been very helpful so far.