diff --git a/main.sv-auto-dispatch.php b/main.sv-auto-dispatch.php index f62c094..59ce528 100644 --- a/main.sv-auto-dispatch.php +++ b/main.sv-auto-dispatch.php @@ -17,9 +17,10 @@ public static function GetDescription() */ public function ComputeMetric($oObject) { - $oSet = new DBObjectSet( DBObjectSearch::FromOQL("SELECT DispatchRule AS DR + $oSet = new DBObjectSet( DBObjectSearch::FromOQL_AllData("SELECT DispatchRule AS DR JOIN lnkCustomerContractToService AS L1 ON L1.dispatch_id = DR.id -WHERE L1.service_id = :this->service_id"), [], ['this' => $oObject], null, 1); +JOIN CustomerContract AS CC ON L1.customercontract_id = CC.id +WHERE L1.service_id = :this->service_id AND CC.org_id = :this->org_id"), [], ['this' => $oObject], null, 1); $oDispatchRule = $oSet->Fetch(); if ($oDispatchRule) diff --git a/module.sv-auto-dispatch.php b/module.sv-auto-dispatch.php index 1e984e1..b172a68 100755 --- a/module.sv-auto-dispatch.php +++ b/module.sv-auto-dispatch.php @@ -5,7 +5,7 @@ SetupWebPage::AddModule( __FILE__, // Path to the current file, all other file names are relative to the directory containing this file - 'sv-auto-dispatch/1.0.0', + 'sv-auto-dispatch/1.0.1', array( // Identification //