Skip to content

Commit

Permalink
BTHAB-185: Return if sale order is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
erawat committed Sep 21, 2023
1 parent 1c3b396 commit dfc0440
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Civicase/Service/CaseSaleOrderContribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ public function calculatePaymentStatus() {
* @throws \Civi\API\Exception\UnauthorizedException
*/
private function getContributions() {
if (empty($this->salesOrder) || empty($this->salesOrder['id'])) {
return [];
}

return Contribution::get(FALSE)
->addWhere('Opportunity_Details.Quotation', '=', $this->salesOrder['id'])
->execute()
Expand Down

0 comments on commit dfc0440

Please sign in to comment.