Commented testing purpose logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 21s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 3m1s
Laravel Larastan / larastan (pull_request) Failing after 3m21s

This commit is contained in:
dhanabalan
2026-03-01 17:09:22 +05:30
parent e03f01c20a
commit 3d3e85be0d

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) {