Added validation characteristics name invalid in pdf controller #1498

Merged
jothi merged 1 commits from ranjith-dev into master 2026-11-23 10:27:58 +00:00
Showing only changes of commit 5362d3bcb1 - Show all commits

View File

@@ -10,6 +10,7 @@ use App\Models\Machine;
use App\Models\Plant;
use App\Models\ProcessOrder;
use App\Models\ProductionCharacteristic;
use App\Models\ProductCharacteristicsMaster;
use App\Models\ProductionQuantity;
use App\Models\Shift;
use App\Models\User;
@@ -258,6 +259,18 @@ class PdfController extends Controller
$errorMessage = "Row " . ($index + 1) . ": Status must be either Ok or NotOk.";
break;
}
// Validate characteristic against product_characteristics_master
$characteristicExists = ProductCharacteristicsMaster::where('plant_id', $plantId)
->where('line_id', $lineId)
->where('item_id', $itemId)
->where('name', $characteristicsName)
->first();
if (!$characteristicExists) {
$errorMessage = "Row " . ($index + 1) . ": Characteristic '{$characteristicsName}' not found for plant '{$plantName}', line '{$lineName}' and item code '{$itemCode}'.";
break;
}
}
if ($errorMessage != '') {