updated in production plan importer #1233
@@ -167,7 +167,6 @@ class ProductionPlanImporter extends Importer
|
|||||||
$workingDays = $previousRecord?->working_days ?? null;
|
$workingDays = $previousRecord?->working_days ?? null;
|
||||||
|
|
||||||
$productionPlan1 = ProductionPlan::where('plant_id', $plant->id)
|
$productionPlan1 = ProductionPlan::where('plant_id', $plant->id)
|
||||||
->where('line_id', $line)
|
|
||||||
->where('item_id', $itemAgaPlant->id)
|
->where('item_id', $itemAgaPlant->id)
|
||||||
->whereYear('created_at', $recordDate->year)
|
->whereYear('created_at', $recordDate->year)
|
||||||
->whereMonth('created_at', $recordDate->month)
|
->whereMonth('created_at', $recordDate->month)
|
||||||
@@ -175,6 +174,7 @@ class ProductionPlanImporter extends Importer
|
|||||||
|
|
||||||
if ($productionPlan1) {
|
if ($productionPlan1) {
|
||||||
$productionPlan1->update([
|
$productionPlan1->update([
|
||||||
|
'line_id' => $line,
|
||||||
'plan_quantity' => $this->data['plan_quantity'],
|
'plan_quantity' => $this->data['plan_quantity'],
|
||||||
'working_days' => $workingDays,
|
'working_days' => $workingDays,
|
||||||
'operator_id' => $operatorName,
|
'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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user