Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CRM): Sales Pipeline Analytics Report and Opportunity Summary by Sales Stage Report #26639

Merged
merged 33 commits into from
Sep 7, 2021

Conversation

mohammedyusufshaikh
Copy link
Contributor

@mohammedyusufshaikh mohammedyusufshaikh commented Jul 26, 2021

Sales Pipeline Analytics

The following report will provide a count of opportunities or amounts that will be earned by the opportunities on a monthly or quarterly basis and also provides filters to funnel the data. This report is a forecast based on the Expected Closing Date and Opportunity Amount / Count.

Source of Truth: Opportunity doctype
Columns: Based on Frequency (Monthly -> Months, Quarterly -> Quarters)
Filters:

  1. Pipeline By
  2. Owner (Assigned To)
  3. Sales Stage (master)
  4. From and To Date
  5. Company
  6. Assigned To
  7. Status (Multiselect): exclude Lost/Closed in selection
  8. Data based on: (cell values will either be Number/Amount)
    • Number: Number of opportunities who have Expected Closing Date falling in that quarter/month.
    • Amount: The total opportunity amount at that stage. (fetch from Opportunity Amount field).
  9. Opportunity Source/Type

Screenshot 2021-07-26 at 4 14 48 PM

Opportunity Summary by Sales Stage

A report to show a summary of opportunities by Sales Stages.

Source of Truth: Opportunity doctype
Columns: Sales Stages (master)
Filters:

  1. Company
  2. Based On
  3. Opportunity Owner (Assigned To)
  4. Opportunity Source (master)
  5. Opportunity Type (master)
  6. From Date and To Date (opportunity creation date)
  7. Data based on: (cell values will either be Number/Amount)
    • Number: Number of opportunities at that stage.
    • Amount: The total opportunity amount at that stage. (fetched from Opportunity Amount field).
  8. Status (Multiselect): Open, Quotation, Converted, Replied
  9. Opportunity Source
  10. Opportunity Type

image

no-docs (Docs will be added once versioning for v14 is done in the wiki documentation app)

@ruchamahabal ruchamahabal changed the title feat: Sales Pipeline Analytics Report feat(CRM): Sales Pipeline Analytics Report and Opportunity Summary by Sales Stage Report Aug 4, 2021

if self.filters.get("data_based_on") == "Number":
for data in self.query_result:
for count in range(0,8):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for i, value in enumerate(values):

@anupamvs anupamvs added the fix-sider-issues Check and fix issues listed by Sider label Aug 4, 2021
@ruchamahabal ruchamahabal marked this pull request as ready for review August 4, 2021 08:13
@stale
Copy link

stale bot commented Aug 19, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within a week 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.

@stale stale bot added the inactive label Aug 19, 2021
@ruchamahabal
Copy link
Member

Keep Alive

@stale stale bot removed the inactive label Aug 19, 2021
@anupamvs anupamvs added the CI-failing Unit tests or patch tests are failing. label Aug 23, 2021
@coveralls
Copy link

coveralls commented Aug 27, 2021

Coverage Status

Coverage increased (+0.1%) to 51.646% when pulling 6a1ae7e on mohammedyusufshaikh:sales_report into 88c9fe3 on frappe:develop.

@ruchamahabal ruchamahabal removed CI-failing Unit tests or patch tests are failing. fix-sider-issues Check and fix issues listed by Sider labels Aug 31, 2021
ruchamahabal
ruchamahabal previously approved these changes Sep 7, 2021
@ruchamahabal ruchamahabal merged commit d795e55 into frappe:develop Sep 7, 2021
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
… Sales Stage Report (frappe#26639)

* feat: Sales Pipeline Analytics Report

* fix: sider Issues and added tests

* fix: Semgrep Issue

* feat: Opportunity Summary by Sales Stage Report

* fix: add some checks and tests

* fix: sider issues and test

* fix: additional checks for error handling and minor changes

* fix: remove unused conditions

* fix: Changes mentioned on PR

* fix: currency conversions and other changes

* fix: remove unused imports

* fix: correction for failing test case

* fix: recorrected failing test case

* fix: sider issues and resolve test case errors

* fix: rewrite query using query builder

* fix: test case changes

* fix: sider fixes and other changes

* fix: clear data before running test

* fix: test case fixed

* refactor: code formatting

- smaller functions

- variable and function naming

* refactor: improve code formatting

* fix: linter issues

* fix: linter issues

* fix: change indentation to tabs

* fix: linter issues

* fix: naming, code formatting

* fix: quarterly values not showing up in Sales Pipeline Analytics

* fix: typo in tests

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>

self.convert_to_base_currency()

dataframe = pandas.DataFrame.from_records(self.query_result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mohammedyusufshaikh @ruchamahabal lets stop using this module.

It's a crutch to use pandas (millions of lines of dependency) for something that can be done in 5-10 line for loop 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants