Skip to content

Commit

Permalink
BTHA-188: Avoid calculating opportunity detail for deleted contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
olayiwola-compucorp committed Aug 19, 2024
1 parent ad19a83 commit 171164c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Civicase/Service/CaseSalesOrderOpportunityCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ private function calculateOpportunityFinancialAmount($contributions) {
private function getContributions($caseId) {
$contributions = Contribution::get(FALSE)
->addSelect('*', 'Opportunity_Details.Quotation')
->addWhere('Opportunity_Details.Case_Opportunity', '=', $caseId);
->addWhere('Opportunity_Details.Case_Opportunity', '=', $caseId)
->addJoin('CaseSalesOrder AS case_sales_order', 'INNER', ['Opportunity_Details.Quotation', '=', 'case_sales_order.id']);

if ($this->deletingContributionId !== NULL) {
$contributions->addWhere('id', '!=', $this->deletingContributionId);
Expand Down

0 comments on commit 171164c

Please sign in to comment.