frappe / erpnext

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

Gross Profit Report error #35942

Open nakul80 opened 1 year ago

nakul80 commented 1 year ago

Information about bug

Using the Gross Profit report grouped by invoices shows incorrect gross profit average figure in the 'total' row. Also when changing the grouping to item code, it again gives another average figure which is also wrong.

Module

accounts

Version

ERPNext: v14.28.0 (HEAD) Frappe Framework: v14.40.1 (HEAD) India Compliance: v14.10.2 (HEAD)

Installation method

None

Relevant log output / Stack trace / Full Error Message.

No response

nakul80 commented 1 year ago

I think I figured out the error. In each grouping the figure changes except in monthly when it gives the right figure.

So, it takes the average of the gross profit% column rather than calculate using the totals. That has to be fixed as its a fundamental error in giving averages which have got to be on the totals (i.e. weighted).

nakul80 commented 1 year ago

Hoping for a resolution to this fundamental issue.