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 = [];
|
$warnMsg = [];
|
||||||
$plant = Plant::where('name', $this->data['plant'])->first();
|
$plant = Plant::where('name', $this->data['plant'])->first();
|
||||||
|
$line = null;
|
||||||
|
$block = null;
|
||||||
if (!$plant) {
|
if (!$plant) {
|
||||||
$warnMsg[] = "Plant not found";
|
$warnMsg[] = "Plant not found";
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
$line = Line::where('name', $this->data['line'])->where('plant_id', $plant->id)->first();
|
$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) {
|
if (!$line) {
|
||||||
$warnMsg[] = "Line not found";
|
$warnMsg[] = "Line not found";
|
||||||
}
|
}
|
||||||
//block_reference
|
|
||||||
$block = Block::where('name', $this->data['block_reference'])->where('plant_id', $plant->id)->first();
|
|
||||||
$shift = null;
|
$shift = null;
|
||||||
if (!$block) {
|
if (!$block) {
|
||||||
$warnMsg[] = "Block not found";
|
$warnMsg[] = "Block not found";
|
||||||
|
|||||||
Reference in New Issue
Block a user