diff --git a/app/Filament/Imports/ProductionPlanImporter.php b/app/Filament/Imports/ProductionPlanImporter.php index eb35bfb0..b0ac574a 100644 --- a/app/Filament/Imports/ProductionPlanImporter.php +++ b/app/Filament/Imports/ProductionPlanImporter.php @@ -167,7 +167,6 @@ class ProductionPlanImporter extends Importer $workingDays = $previousRecord?->working_days ?? null; $productionPlan1 = ProductionPlan::where('plant_id', $plant->id) - ->where('line_id', $line) ->where('item_id', $itemAgaPlant->id) ->whereYear('created_at', $recordDate->year) ->whereMonth('created_at', $recordDate->month) @@ -175,6 +174,7 @@ class ProductionPlanImporter extends Importer if ($productionPlan1) { $productionPlan1->update([ + 'line_id' => $line, 'plan_quantity' => $this->data['plan_quantity'], 'working_days' => $workingDays, 'operator_id' => $operatorName, @@ -193,18 +193,6 @@ class ProductionPlanImporter extends Importer ]); } - // ProductionPlan::updateOrCreate([ - // 'plant_id' => $plant->id, - // 'line_id' => $line, - // 'item_id' => $itemAgaPlant->id, - // // 'shift_id' => $shift->id, - // 'plan_quantity' => $this->data['plan_quantity'], - // 'working_days' => $workingDays, - // 'created_at' =>now(), - // 'updated_at' => now(), - // 'operator_id' => $operatorName, - // ]); - return null; }