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

BTHAB-186: Add case's opportunity details #977

Merged

Conversation

erawat
Copy link
Member

@erawat erawat commented Sep 21, 2023

This PR adds a new custom group, Case Opportunity" that contains a list of:

Total Quoted Amount,
Total Invoiced Amount,
Total Payment Amount,
Invoiced Status,
Payment Status,

Above amounts and statuses will be calculated and updated when:

  • New quotation is created
  • Existing quotation is updated
  • Contribution is created
  • Payment is created.

This PR also handles a contribution deletion, so the Case Opportunity Details will also be calculated and updated contribution(s) is deleted. This also covers the update of quotation's invoicing, payment amount and statuses.

Before

Didn't exist.

After

screenshot-btha localhost_9011-2023 09 22-13_04_37

Technical Details

To update quotation statuses and opportunity details, I employed the CiviCRM Pre-hook. This allowed us to retrieve the quotation ID from the contribution record before deleting it. Subsequently, we could use this ID to calculate new amounts and statuses for both the quotation and the case

The renaming is to align with other objects and provides more meaningful
@erawat erawat force-pushed the BTHAB-186-diplay-opportunity-financial-details branch from 751ab75 to 4a7ad7a Compare September 22, 2023 08:21
@erawat erawat force-pushed the BTHAB-186-diplay-opportunity-financial-details branch from bc73ac4 to 9795425 Compare September 22, 2023 12:25
@erawat erawat changed the title BTHAB-186: Rename service class to align with other objects and more … BTHAB-186: Add case's opportunity details Sep 22, 2023
Update case opportunity statuses, and total amounts when:
* Create or update sales order contribution
* Create or update sales order
* Create a payment
@erawat erawat force-pushed the BTHAB-186-diplay-opportunity-financial-details branch from 9795425 to 00cf2f1 Compare September 22, 2023 12:27
@erawat erawat marked this pull request as ready for review September 22, 2023 12:59
@erawat erawat merged commit 56cbd51 into BTHAB-3-workstream Sep 22, 2023
2 checks passed
@erawat erawat deleted the BTHAB-186-diplay-opportunity-financial-details branch September 22, 2023 13:57
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.

2 participants