Updated plant code instead of plant name on import
This commit is contained in:
@@ -41,10 +41,10 @@ class LocatorImporter extends Importer
|
|||||||
->rules(['required']),
|
->rules(['required']),
|
||||||
ImportColumn::make('plant')
|
ImportColumn::make('plant')
|
||||||
->requiredMapping()
|
->requiredMapping()
|
||||||
->relationship(resolveUsing: 'name')
|
->relationship(resolveUsing: 'code')
|
||||||
->exampleHeader('Plant')
|
->exampleHeader('Plant Code')
|
||||||
->example(['Ransar Industries-I'])
|
->example(['1000'])
|
||||||
->label('Plant')
|
->label('Plant Code')
|
||||||
->rules(['required']),
|
->rules(['required']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ class LocatorImporter extends Importer
|
|||||||
public function resolveRecord(): ?Locator
|
public function resolveRecord(): ?Locator
|
||||||
{
|
{
|
||||||
$warnMsg = [];
|
$warnMsg = [];
|
||||||
$plant = Plant::where('name', $this->data['plant'])->first();
|
$plant = Plant::where('code', $this->data['plant'])->first();
|
||||||
$locator = $this->data['locator_number'];
|
$locator = $this->data['locator_number'];
|
||||||
// $locatorQuantity = $this->data['locator_quantity'];
|
// $locatorQuantity = $this->data['locator_quantity'];
|
||||||
$palletQuantity = 0;
|
$palletQuantity = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user