frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.73k stars 7.3k forks source link

Rounding issue in Total Tax Calculation #41350

Open HUMENTH opened 6 months ago

HUMENTH commented 6 months ago

Information about bug

The rounding method is not functioning correctly in the "Sales Taxes and Charges" section of the Sales Order.

Steps to reproduce the issue:

  1. Ensure the currency precision and rounding method are set as shown in the screenshot provided. image

  2. Create a Sales Order and add items, quantity, and rates as illustrated in the screenshot. image

  3. In the "Sales Taxes and Charges" table, select 'On Net Total' for type, 'Output Tax IGST' for Account Head, and set the rate to 18%. Save the order. image

  4. Review the calculated tax amount. It is expected to be 1,55,284.46, but it displays 1,55,284.45 instead.

When manually selecting the Item Tax Template for each line item, the correct IGST amount with two decimal places is displayed, but sum of total taxes is not correct with two decimal places.

IGST Amount for Line Item 1: image

IGST Amount for Line Item 2: image

IGST Amount for Line Item 3: image

IGST Amount for Line Item 4: image

IGST Amount for Line Item 5: image

IGST Amount for Line Item 6: image

IGST Amount for Line Item 7: image

Current Result: Total tax (IGST Amount) is 1,55,284.45.

Expected Result: Total tax (IGST Amount) should be 1,55,284.46.

Module

selling

Version

Frappe: v15.25.0 ERPNext: v15.22.2 India Compliance: v15.7.4

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

sahalMoidu commented 6 months ago

This seems the way the sum is taken.

  1. Sum of rounded amount
  2. Round of summed amount

Currently the output looks like it is option 2.

image

IMO each line's Tax amount should be rounded as I face similar issue in Saudi VAT. The official documentation also dictates to round seperately

image