Merge pull request 'Commented testing purpose logic' (#432) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s

Reviewed-on: #432
This commit was merged in pull request #432.
This commit is contained in:
2026-03-01 11:39:51 +00:00

View File

@@ -135,9 +135,9 @@ class ProcessOrderImporter extends Importer
} elseif ($processOrder && Str::contains($processOrder, '.')) {
$warnMsg[] = 'Invalid process order found!';
}
// if ($lineNam == null || $lineNam == '') {
// $warnMsg[] = "Line name can't be empty!";
// }
if ($lineNam == null || $lineNam == '') {
$warnMsg[] = "Line name can't be empty!";
}
if ($orderQuan == null || $orderQuan == '') {
$warnMsg[] = "Order quantity can't be empty!";
} elseif ($orderQuan == 0 || $orderQuan == '0') {
@@ -173,21 +173,21 @@ class ProcessOrderImporter extends Importer
$plantId = $plant->id;
}
$existing = ProcessOrder::where('plant_id', $plantId)->where('process_order', $processOrder)->first();
if ($existing) {
$existing = ProcessOrder::where('plant_id', $plantId)->where('process_order', $processOrder)->where('coil_number', $coilNo)->first();
if ($existing) {
$warnMsg[] = 'Process Order with coil number already exists!';
}
} else {
$warnMsg[] = 'New process order found!';
}
if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg));
}
// TESTING PURPOSE ONLY - TO CHECK DUPLICATE PROCESS ORDER WITH SAME COIL NUMBER FOR THE SAME PLANT
// $existing = ProcessOrder::where('plant_id', $plantId)->where('process_order', $processOrder)->first();
// if ($existing) {
// $existing = ProcessOrder::where('plant_id', $plantId)->where('process_order', $processOrder)->where('coil_number', $coilNo)->first();
// if ($existing) {
// $warnMsg[] = 'Process Order with coil number already exists!';
// } else {
// $warnMsg[] = 'Process order already exists!';
// }
// } else {
// $warnMsg[] = 'New process order found!';
// }
// if (! empty($warnMsg)) {
// throw new RowImportFailedException(implode(', ', $warnMsg));
// }
$itemCode = Item::where('code', $iCode)->first();
if (! $itemCode) {