Updated item code get func. (if plant exist)

This commit is contained in:
dhanabalan
2025-05-31 10:25:25 +05:30
parent 390740bbd0
commit 2b02e01cca

View File

@@ -187,7 +187,10 @@ class StickerMasterImporter extends Importer
if (!$plant) { if (!$plant) {
$warnMsg[] = "Plant not found"; $warnMsg[] = "Plant not found";
} }
$item = Item::where('code', $this->data['item'])->where('plant_id', $plant->id)->first(); $item = null;
if ($plant) {
$item = Item::where('code', $this->data['item'])->where('plant_id', $plant->id)->first();
}
if (!$item) { if (!$item) {
$warnMsg[] = "Item code not found"; $warnMsg[] = "Item code not found";
} }