resolved bug in production plan importer #1181

Merged
jothi merged 1 commits from ranjith-dev into master 2026-10-06 05:41:42 +00:00

View File

@@ -132,24 +132,28 @@ class ProductionPlanImporter extends Importer
if(!$itemAgaPlant){
$warnMsg[] = 'Item not found against plant code';
}
else {
$line = $itemAgaPlant->line_id;
$line = $itemAgaPlant->line_id;
if(!$line){
$warnMsg[] = 'Line not mapped for that item code';
if (!$line) {
$warnMsg[] = 'Line not mapped for that item code';
}
}
$user = Filament::auth()->user();
$operatorName = $user->name;
if (Str::length($this->data['plan_quantity']) < 0 || ! is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) {
$warnMsg[] = 'Invalid plan quantity found';
if (!empty($this->data['plan_quantity'])) {
if (Str::length($this->data['plan_quantity']) < 0 || ! is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) {
$warnMsg[] = 'Invalid plan quantity found';
}
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
} else {
$productionPlan = ProductionPlan::where('plant_id', $plant->id)
->where('line_id', $line)
->where('item_id', $itemAgaPlant->id)