Commented testing purpose logic #432
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user