When a Sales Invoice is created or submitted in ERPNext, the system first evaluates its eligibility for eTIMS compliance in the background. This pre-check ensures that every invoice is assessed early in the workflow to determine whether it can participate in the compliance process.
Eligibility is determined based on:
- Active eTims Settings configuration for the Company
- Customer registration status
- Item registration status
- Overall compliance readiness of the transaction
If the invoice is not eligible, the system adds warning messages indicating the missing requirements. The invoice can still be processed within ERPNext, but it will not proceed to eTIMS submission until the issues are resolved.
Verification URL and QR Code Generation (Pre-Submission)
Once an invoice is deemed eligible, the system immediately generates a unique verification URL and QR code, even before submission to eTIMS.
This ensures that every eligible invoice is issued with a scannable and traceable reference from the moment it is created.
The verification URL:
- Is embedded in the invoice QR code for customer use
- Provides real-time invoice status tracking
- Serves as a persistent reference throughout the invoice lifecycle
Key Behavior
- The URL is active immediately upon invoice eligibility
- When scanned, it dynamically checks the current submission status
- If the invoice has been submitted, it redirects to the official eTIMS record
- If not yet submitted, it displays the current processing or pending state
This ensures that customers always receive a compliant, verifiable invoice regardless of submission timing.
Submission Handling
After eligibility is confirmed:
- The system checks the Auto Submission setting in eTims Settings
- If enabled, the invoice is automatically queued for submission upon posting
- If disabled, the invoice remains in ERPNext and can be manually submitted using eTims Actions
Both Sales Invoices and Sales Invoice Returns (Credit Notes) follow the same workflow.
Asynchronous Processing
All eTIMS submissions run asynchronously to ensure smooth ERPNext performance. This enables:
- Non-blocking invoice submission workflows
- Background processing of compliance requests
- Efficient handling of high transaction volumes
- Reliable queue-based processing for both auto and manual submissions
eTIMS Response Handling
Once a transaction is successfully processed, eTIMS returns SCU-specific details such as the SCU invoice number and SCU URL. This data is stored within ERPNext and used for compliant printing and reporting.
In addition, an eTIMS Ledger record is automatically created for each successful submission. This ledger acts as the central audit trail for all communication between ERPNext and KRA eTIMS and is linked directly to the originating Sales Invoice or Credit Note, ensuring full traceability of both standard eTIMS responses and SCU-level invoice data.
Failure Handling
If submission fails:
- The Sales Invoice remains available in ERPNext
- Error details are recorded against the transaction
- Users can review the issue and retry submission or manually submit using eTims Actions
This ensures no transaction is lost and all compliance failures remain fully traceable and recoverable.