Commented testing purpose logic #432

Merged
jothi merged 1 commits from ranjith-dev into master 2026-03-01 11:39:52 +00:00

View File

@@ -135,9 +135,9 @@ class ProcessOrderImporter extends Importer
} elseif ($processOrder && Str::contains($processOrder, '.')) { } elseif ($processOrder && Str::contains($processOrder, '.')) {
$warnMsg[] = 'Invalid process order found!'; $warnMsg[] = 'Invalid process order found!';
} }
// if ($lineNam == null || $lineNam == '') { if ($lineNam == null || $lineNam == '') {
// $warnMsg[] = "Line name can't be empty!"; $warnMsg[] = "Line name can't be empty!";
// } }
if ($orderQuan == null || $orderQuan == '') { if ($orderQuan == null || $orderQuan == '') {
$warnMsg[] = "Order quantity can't be empty!"; $warnMsg[] = "Order quantity can't be empty!";
} elseif ($orderQuan == 0 || $orderQuan == '0') { } elseif ($orderQuan == 0 || $orderQuan == '0') {
@@ -173,21 +173,21 @@ class ProcessOrderImporter extends Importer
$plantId = $plant->id; $plantId = $plant->id;
} }
$existing = ProcessOrder::where('plant_id', $plantId)->where('process_order', $processOrder)->first(); // 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) { // if ($existing) {
$existing = ProcessOrder::where('plant_id', $plantId)->where('process_order', $processOrder)->where('coil_number', $coilNo)->first(); // $existing = ProcessOrder::where('plant_id', $plantId)->where('process_order', $processOrder)->where('coil_number', $coilNo)->first();
// if ($existing) {
if ($existing) { // $warnMsg[] = 'Process Order with coil number already exists!';
$warnMsg[] = 'Process Order with coil number already exists!'; // } else {
} // $warnMsg[] = 'Process order already exists!';
} else { // }
$warnMsg[] = 'New process order found!'; // } else {
} // $warnMsg[] = 'New process order found!';
// }
if (! empty($warnMsg)) { // if (! empty($warnMsg)) {
throw new RowImportFailedException(implode(', ', $warnMsg)); // throw new RowImportFailedException(implode(', ', $warnMsg));
} // }
$itemCode = Item::where('code', $iCode)->first(); $itemCode = Item::where('code', $iCode)->first();
if (! $itemCode) { if (! $itemCode) {