Merge pull request 'Added validation characteristics name invalid in pdf controller' (#1498) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #1498
This commit was merged in pull request #1498.
This commit is contained in:
2026-11-23 10:27:57 +00:00

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 != '') {