Updated import validation (get block_id if plant exist otherwise ignore)

This commit is contained in:
dhanabalan
2025-05-10 11:28:18 +05:30
parent 0ea9d49ead
commit 0b82f33837

View File

@@ -89,15 +89,19 @@ class ProductionPlanImporter extends Importer
{
$warnMsg = [];
$plant = Plant::where('name', $this->data['plant'])->first();
$line = null;
$block = null;
if (!$plant) {
$warnMsg[] = "Plant not found";
}
else {
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
//block_reference
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
}
if (!$line) {
$warnMsg[] = "Line not found";
}
//block_reference
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
$shift = null;
if (!$block) {
$warnMsg[] = "Block not found";