Updated import validation (get block_id if plant exist otherwise ignore)
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user