Print Format & QR Code Compliance
Print Format & QR Code Compliance
One of the key KRA requirements is that every tax invoice issued to a customer must carry:
- The Control Unit (CU) Serial Number
- The CU Invoice Number
- A QR Code that encodes the invoice's KRA-verified details
The TIMS Tevin Integration handles all of this automatically.
How the QR Code Gets on the Invoice
- Invoice is submitted -> Tevin API is called
- Tevin returns the CU Number and a signed URL/data string
- The app generates a QR code from this response
- The QR code image is attached to the Sales Invoice record in ERPNext
- The invoice Print Format is designed to display this QR code in the mandated position (typically bottom-right of the invoice)
Configuring Your Print Format
If you are using a custom print format, ensure the Jinja2 template includes the fields for the CU number and QR code. A minimal example:
<!-- CU Number Display -->
{% if doc.custom_cu_number %}
<div class="cu-details">
<p><strong>CU Number:</strong> {{ doc.custom_cu_number }}</p>
</div>
{% endif %}
<!-- QR Code -->
{% if doc.custom_qr_code %}
<div class="qr-code">
<img src="{{ doc.custom_qr_code }}" alt="KRA QR Code" style="width:100px; height:100px;" />
</div>
{% endif %}
Note: The exact custom field names (
custom_cu_number,custom_qr_code) may vary depending on your ERPNext version and how the app registers them. Check the Sales Invoice form view after a successful submission to confirm the field names being populated.
Verifying QR Code Validity
A customer or KRA auditor can scan the QR code using any QR scanner to retrieve the invoice details as registered in TIMS. This is your proof of compliance for every transaction.