Hey guys,
I recently started using ERPNext for my software business, and so far it works great for us. That’s why I wanted to contribute back and share with you my first custom app.
It’s basically a simple app that provides an HTTP endpoint for generating EPC-QRCodes as PNG images, which can be embedded, e.g., in custom print formats of sales invoices. The customer can scan the QRCode with a banking app that auto-fills all payment fields to make this process less error-prone. Here is an example:
First, I tried different implementations and tinkered with custom print formats and client/server scripts, because I wanted to avoid implementing and setting up a custom app. But none of those solutions worked perfectly. You can’t e.g. render SVGs or use images with data-URIs as source, because they won’t show up in the PDF print of your invoice. Also, relying on third-party APIs on the web for such tasks might not be optimal for privacy reasons, as you have to send over invoice and payment data. So at the end, I came up with a simple app that adds this feature directly to ERPNext.
After installation, the HTTP endpoint is available at /api/method/epcqrcode.generator.get_code
. You can use it in a custom HTML print format like this:
<div style="margin-top: 10px;">
<img width="110" height="110" src="/api/method/epcqrcode.generator.get_code?name=Your+Company&reference={{ doc.name }}&iban=AT026000000001349870&amount={{ doc.grand_total }}&scale=4&border=0">
<p>Zahlen mit QR-Code</p>
</div>
You can find more information on the Github repo.
Looking forward to getting your feedback on my first custom app
Cheers,
Florian