erpnext
erpnext copied to clipboard
feat: significant enhancements to sales analytics report to support charts
The Sales Analytics report currently only shows charts if the data rows are selected in the datatable in the browser. This means it is incompatible with dashboard charts which expect the data to be delivered server-side.
The data is also arranged in the wrong orientation for dashboard charts which expect the X axis labels to be in the data vertically, but are horizontal in this report, which means you cannot use the report data output either.
All added features:
-
An extra 'Curves' filter which defaults to 'Select' to support old behaviour, but has the following additional modes to support dashboard charts (generated server-side):
- All - shows all data rows on the chart
- Non-Zeros - shows only non-zero data rows
- Total Only - shows a single curve which is the total of the data rows
-
A special 'All' document mode (shown below) which shows all Sales cycle documents in Customer, Value and Total Only mode, over the time period
-
Quotations supported
-
Sales Invoice (by due date) supported
-
Payment Entry supported
-
The Fiscal Year dynamic from/to filter can be overridden by setting two user defaults in JS:
// used by sales_analytics report to give a custom time period in charts
const wk = frappe.datetime.week_start();
frappe.defaults.set_user_default_local('sales_start_date', frappe.datetime.add_months(wk,-2));
frappe.defaults.set_user_default_local('sales_end_date', frappe.datetime.add_months(wk,1));
One known issue: Payment entries do not 'know about' the taxes (the other reports show net amounts), so will always be more than the other document values.
fixes #40751
version-15-hotfix (not compatible with version-14-hotfix due to missing erpnext.utils.get_fiscal_year)
I'm not able to sign up to the documentation website to modify:
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.
This would be extremely useful for us if it were implemented!
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.
This has three endorsements, please merge.
This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.
Last chance before I remove this branch. It is available here:
https://github.com/CaseSolvedUK/erpnext
I support merge this, then I will add another new feature.
@deepeshgarg007 @ruthra-kumar ?