---
title: "User Manual: EFD Z Report Functionality in CSF TZ for ERPNext"
space: "Wiki"
url: "https://support.aakvatech.com/wiki/user-manual-efd-z-report-functionality-in-erpnext"
updated: "2026-07-22"
---

<p>This user manual provides step-by-step guidance for using the EFD Z Report DocType in CSF TZ for ERPNext, based on the stored Python logic. It covers features such as creating a report, fetching sales invoices, validation, submission, and cancellation.</p>
<hr>
<h3 id="-1-overview-"><strong>1. Overview</strong></h3>
<p>The EFD Z Report module is designed to:</p>
<ul>
<li>Retrieve and link sales invoices to a fiscal Z report.</li>
<li>Validate data consistency between sales invoices and manually entered totals.</li>
<li>Ensure compliance with fiscal reporting standards.</li>
</ul>
<hr>
<h3 id="-2-key-features-"><strong>2. Key Features</strong></h3>
<ol>
<li><p><strong>Validation Checks</strong>:</p>
<ul>
<li>Ensures no submission is made without linked sales invoices.</li>
<li>Confirms data integrity and allowable differences for turnover, VAT, and other fields.</li>
</ul>
</li>
<li><p><strong>Sales Invoice Retrieval</strong>:</p>
<ul>
<li>Fetches sales invoices based on the fiscal device and Z report date/time.</li>
</ul>
</li>
<li><p><strong>Submission Logic</strong>:</p>
<ul>
<li>Links sales invoices to the Z report upon submission.</li>
<li>Performs validation to prevent submission if discrepancies exist.</li>
</ul>
</li>
<li><p><strong>Cancellation Logic</strong>:</p>
<ul>
<li>Unlinks sales invoices if the Z report is cancelled.</li>
</ul>
</li>
</ol>
<hr>
<h3 id="-3-step-by-step-instructions-"><strong>3. Step-by-Step Instructions</strong></h3>
<h4 id="-3-1-creating-an-efd-z-report-"><strong>3.1. Creating an EFD Z Report</strong></h4>
<ol>
<li>Navigate to the <strong>EFD Z Report</strong> module.</li>
<li>Click <strong>New</strong> to create a new report.</li>
<li><p>Fill in the required fields:</p>
<ul>
<li><strong>Electronic Fiscal Device</strong>: Link to the fiscal device used.</li>
<li><strong>Z No</strong>: Unique identifier for the Z Report.</li>
<li><strong>Z Report Date Time</strong>: Specify the date and time of the Z report.</li>
<li><strong>Receipts Issued</strong>: Number of receipts issued during the period.</li>
</ul>
</li>
<li><p>Click <strong>Save</strong>.</p>
</li>
</ol>
<hr>
<h4 id="-3-2-fetching-sales-invoices-"><strong>3.2. Fetching Sales Invoices</strong></h4>
<ol>
<li>After saving the report, click the <strong>Get Invoices</strong> button.</li>
<li><p>The system will fetch sales invoices based on:</p>
<ul>
<li>Fiscal device and date/time.</li>
<li>Exclusions for already linked or returned invoices.</li>
</ul>
</li>
<li><p>Review the invoices populated in the <strong>EFD Z Report Invoices</strong> table.</p>
</li>
</ol>
<hr>
<h4 id="-3-3-validating-the-report-"><strong>3.3. Validating the Report</strong></h4>
<ol>
<li><p>Ensure that the following match within the allowable difference:</p>
<ul>
<li><strong>Total Turnover</strong> matches <strong>Total Turnover (Ticked)</strong>.</li>
<li><strong>Total Excluding VAT</strong> matches <strong>Total Excluding VAT (Ticked)</strong>.</li>
<li><strong>Total VAT</strong> matches <strong>Total VAT (Ticked)</strong>.</li>
<li><strong>Total Turnover Exempted / Sp. Relief</strong> matches <strong>Total Turnover Exempted / Sp. Relief (Ticked)</strong>.</li>
</ul>
</li>
<li><p>Confirm that the number of ticked invoices matches the <strong>Receipts Issued</strong> field.</p>
</li>
</ol>
<hr>
<h4 id="-3-4-submitting-the-report-"><strong>3.4. Submitting the Report</strong></h4>
<ol>
<li>Once validations pass, click <strong>Submit</strong>.</li>
<li>During submission:<ul>
<li>The system checks for discrepancies.</li>
<li>Links the Z Report to the associated sales invoices.</li>
</ul>
</li>
<li>If any sales invoice is already linked to another Z Report, an error will be displayed.</li>
</ol>
<hr>
<h4 id="-3-5-cancelling-the-report-"><strong>3.5. Cancelling the Report</strong></h4>
<ol>
<li>To cancel a submitted report:<ul>
<li>Open the Z Report.</li>
<li>Click <strong>Cancel</strong>.</li>
</ul>
</li>
<li>The system will:<ul>
<li>Unlink the Z Report from all associated sales invoices.</li>
<li>Save the unlinked invoices.</li>
</ul>
</li>
</ol>
<hr>
<h3 id="-4-error-messages-and-troubleshooting-"><strong>4. Error Messages and Troubleshooting</strong></h3>
<ul>
<li><p><strong>&quot;No Sales Invoice Found in the Table&quot;</strong>:</p>
<ul>
<li>Ensure the <strong>Get Invoices</strong> button has been clicked, and invoices are populated.</li>
</ul>
</li>
<li><p><strong>&quot;Sales Invoice Amount is not equal to Money Entered&quot;</strong>:</p>
<ul>
<li>Review turnover fields for mismatches and adjust data within allowable differences.</li>
</ul>
</li>
<li><p><strong>&quot;The Number of Sales Invoice (Include is checked) in the table is not equal to Receipts Issued&quot;</strong>:</p>
<ul>
<li>Ensure the ticked invoices count matches the number entered in <strong>Receipts Issued</strong>.</li>
</ul>
</li>
<li><p><strong>&quot;The Sales Invoice {Invoice} is linked to EFD Z Report {Report}&quot;</strong>:</p>
<ul>
<li>Check if the invoice is already linked to another Z Report and unlink it if necessary.</li>
</ul>
</li>
</ul>
<hr>
<h3 id="-5-key-functional-details-"><strong>5. Key Functional Details</strong></h3>
<ol>
<li><p><strong>Fetching Sales Invoices</strong>:</p>
<ul>
<li>Filters sales invoices that are not yet linked to a Z Report and meet the fiscal device and date/time criteria.</li>
<li>Special calculations handle invoices with exempted or special relief VAT.</li>
</ul>
</li>
<li><p><strong>Validation Logic</strong>:</p>
<ul>
<li>Checks for:<ul>
<li>Consistency in totals (Turnover, VAT, and others).</li>
<li>Allowable differences defined in the report.</li>
<li>Correct number of linked invoices.</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>Submission Logic</strong>:</p>
<ul>
<li>Links invoices and saves the Z Report.</li>
<li>Removes unselected invoices from the list.</li>
</ul>
</li>
<li><p><strong>Cancellation Logic</strong>:</p>
<ul>
<li>Clears the <strong>EFD Z Report</strong> field in linked invoices upon cancellation.</li>
</ul>
</li>
</ol>
<hr>
<h3 id="-6-advanced-use-cases-"><strong>6. Advanced Use Cases</strong></h3>
<ol>
<li><p><strong>Handling Allowable Differences</strong>:</p>
<ul>
<li>The <strong>Allowable Difference</strong> field defines acceptable discrepancies during validation.</li>
<li>Adjust this value if minor discrepancies are expected.</li>
</ul>
</li>
<li><p><strong>Unlinking Specific Invoices</strong>:</p>
<ul>
<li>Untick the <strong>Include</strong> checkbox for invoices you want to exclude before submission.</li>
</ul>
</li>
</ol>
<hr>
<h3 id="-7-conclusion-"><strong>7. Conclusion</strong></h3>
<p>By following this manual, users can effectively manage fiscal Z Reports in ERPNext using the custom logic provided. The system ensures compliance, consistency, and efficient handling of sales invoices linked to fiscal devices. For further assistance, contact your ERPNext administrator.</p>
