diff --git a/Modules/Internal/Services/ExclusionService.php b/Modules/Internal/Services/ExclusionService.php index cd6e4782..984d631b 100644 --- a/Modules/Internal/Services/ExclusionService.php +++ b/Modules/Internal/Services/ExclusionService.php @@ -69,7 +69,6 @@ class ExclusionService ]); } if (!empty($excl_array[5])) { //plans - $exclusion->rules()->create([ 'name' => 'plan', 'values' => $excl_array[5] @@ -131,8 +130,8 @@ class ExclusionService if (!empty($excl_array[5])) { //plans $codePlan = explode(',', $excl_array[5]); collect($codePlan)->each(function ($codePlan) use ($corporate, $exclusion) { - $codePlan = Plan::where(['code' => $codePlan, 'corporate_id' => $corporate->id])->first(); - if (!$codePlan) { + $isCodeplan = Plan::where(['code' => $codePlan, 'corporate_id' => $corporate->id])->first(); + if (!$isCodeplan) { throw new ImportRowException(__('codePlan.NOT_FOUND'), 0, NULL, $codePlan); }