ranjith-dev #478

Merged
jothi merged 2 commits from ranjith-dev into master 2026-03-13 09:25:06 +00:00
2 changed files with 62 additions and 37 deletions

View File

@@ -137,7 +137,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->danger() ->danger()
->title('Invalid QR Format') ->title('Invalid QR Format')
->body('Scan the valid QR code to proceed either SFG or FG!') ->body('Scan the valid QR code to proceed either FG or Non-FG!')
->seconds(3) ->seconds(3)
->send(); ->send();
@@ -357,7 +357,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Unknown Location') ->title('Unknown Location')
->body("Location '$location' not found for the type SFG.") ->body("Location '$location' not found for the type Non-FG.")
->danger() ->danger()
->persistent() ->persistent()
->actions([ ->actions([
@@ -416,7 +416,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Unknown Location') ->title('Unknown Location')
->body("Location '$location' not found for the type SFG against plant code '$plantCode'.") ->body("Location '$location' not found for the type Non-FG against plant code '$plantCode'.")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm_update') \Filament\Notifications\Actions\Action::make('confirm_update')
@@ -475,7 +475,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Item Not Found in Location') ->title('Item Not Found in Location')
->body("Item Code '$this->itemCode' is not available in location '$location' (Type: SFG) for Plant Code '$plantCode'.") ->body("Item Code '$this->itemCode' is not available in location '$location' (Type: Non-FG) for Plant Code '$plantCode'.")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm_update') \Filament\Notifications\Actions\Action::make('confirm_update')
@@ -626,7 +626,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Duplicate Serial Number') ->title('Duplicate Serial Number')
->body("Serial number '$this->sNo' has already been scanned in stock data master for the type SFG against plant code '$plantCode'.<br>Do you want to update in duplicate stock table?") ->body("Serial number '$this->sNo' has already been scanned in stock data master for the type Non-FG against plant code '$plantCode'.<br>Do you want to update in duplicate stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm') \Filament\Notifications\Actions\Action::make('confirm')
@@ -678,6 +678,7 @@ class CycleCount extends Page
$stock->update([ $stock->update([
'bin' => $bin, 'bin' => $bin,
'batch' => $this->batch, 'batch' => $this->batch,
// 'doc_no' =>$this->docNo,
'scanned_quantity' => $newScannedQty, 'scanned_quantity' => $newScannedQty,
'scanned_status' => $status, 'scanned_status' => $status,
]); ]);
@@ -914,7 +915,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Unknown Location') ->title('Unknown Location')
->body("location '$location' not found in stock data master for the type SFG.<br>Do you want to update in not in stock table?") ->body("location '$location' not found in stock data master for the type Non-FG.<br>Do you want to update in not in stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm') \Filament\Notifications\Actions\Action::make('confirm')
@@ -973,7 +974,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Unknown Location') ->title('Unknown Location')
->body("location '$location' not found in stock data master for the type SFG against plant code '$plantCode'.<br>Do you want to update in not in stock table?") ->body("location '$location' not found in stock data master for the type Non-FG against plant code '$plantCode'.<br>Do you want to update in not in stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm') \Filament\Notifications\Actions\Action::make('confirm')
@@ -1046,7 +1047,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Unknown Serial Number') ->title('Unknown Serial Number')
->body('Scanned serial number not found in stock data master for the type SFG.<br>Do you want to update in not in stock table?') ->body('Scanned serial number not found in stock data master for the type Non-FG.<br>Do you want to update in not in stock table?')
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm') \Filament\Notifications\Actions\Action::make('confirm')
@@ -1102,7 +1103,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Unknown Serial Number') ->title('Unknown Serial Number')
->body("Scanned serial number not found in stock data master for the type SFG against plant code '$plantCode'.<br>Do you want to update in not in stock table?") ->body("Scanned serial number not found in stock data master for the type Non-FG against plant code '$plantCode'.<br>Do you want to update in not in stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm_update') \Filament\Notifications\Actions\Action::make('confirm_update')
@@ -1156,7 +1157,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Invalid Location') ->title('Invalid Location')
->body("Serial number '$this->sNo' does not belong to location '$location' for the type SFG against plant code '$plantCode'.<br>Do you want to update in not in stock table?") ->body("Serial number '$this->sNo' does not belong to location '$location' for the type Non-FG against plant code '$plantCode'.<br>Do you want to update in not in stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm_update') \Filament\Notifications\Actions\Action::make('confirm_update')
@@ -1210,7 +1211,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Invalid Item Code') ->title('Invalid Item Code')
->body("Serial number '$this->sNo' does not belong to item code '$this->itemCode' for the type SFG against plant code '$plantCode'.<br>Do you want to update in not in stock table?") ->body("Serial number '$this->sNo' does not belong to item code '$this->itemCode' for the type Non-FG against plant code '$plantCode'.<br>Do you want to update in not in stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm_update') \Filament\Notifications\Actions\Action::make('confirm_update')
@@ -1266,7 +1267,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Invalid Batch') ->title('Invalid Batch')
->body("Serial number '$this->sNo' does not belong to batch '$this->batch' for the type SFG against plant code '$plantCode'.<br>Do you want to update in not in stock table?") ->body("Serial number '$this->sNo' does not belong to batch '$this->batch' for the type Non-FG against plant code '$plantCode'.<br>Do you want to update in not in stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm_update') \Filament\Notifications\Actions\Action::make('confirm_update')
@@ -1302,13 +1303,13 @@ class CycleCount extends Page
// Notification::make() // Notification::make()
// ->danger() // ->danger()
// ->title('Invalid Bin') // ->title('Invalid Bin')
// ->body("Serial number '$this->sNo' does not belong to bin '$bin' for the type SFG against plant code '$plantCode'.") // ->body("Serial number '$this->sNo' does not belong to bin '$bin' for the type Non-FG against plant code '$plantCode'.")
// ->seconds(3) // ->seconds(3)
// ->send(); // ->send();
// Notification::make() // Notification::make()
// ->title('Invalid Bin') // ->title('Invalid Bin')
// ->body("Serial number '$this->sNo' does not belong to bin '$bin' for the type SFG against plant code '$plantCode'.") // ->body("Serial number '$this->sNo' does not belong to bin '$bin' for the type Non-FG against plant code '$plantCode'.")
// ->danger() // ->danger()
// ->actions([ // ->actions([
// \Filament\Notifications\Actions\Action::make('confirm_update') // \Filament\Notifications\Actions\Action::make('confirm_update')
@@ -1347,7 +1348,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->warning() ->warning()
->title('Unknown Quantity') ->title('Unknown Quantity')
->body("Quantity is missing for serial number '$this->sNo' (Type: SFG) in Plant Code '$plantCode'. Please update it in Stock Data Master.") ->body("Quantity is missing for serial number '$this->sNo' (Type: Non-FG) in Plant Code '$plantCode'. Please update it in Stock Data Master.")
->seconds(3) ->seconds(3)
->send(); ->send();
@@ -1363,7 +1364,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->warning() ->warning()
->title('Invalid Quantity') ->title('Invalid Quantity')
->body("Quantity should be '1' against '$this->sNo' for the type SFG against plant code '$plantCode'!Please update quantity in stock data master.") ->body("Quantity should be '1' against '$this->sNo' for the type Non-FG against plant code '$plantCode'!Please update quantity in stock data master.")
->seconds(3) ->seconds(3)
->send(); ->send();
@@ -1383,7 +1384,7 @@ class CycleCount extends Page
Notification::make() Notification::make()
->title('Duplicate Serial Number') ->title('Duplicate Serial Number')
->body("Serial number '$this->sNo' has already been scanned in stock data master for the type SFG against plant code '$plantCode'.<br>Do you want to update in duplicate stock table?") ->body("Serial number '$this->sNo' has already been scanned in stock data master for the type Non-FG against plant code '$plantCode'.<br>Do you want to update in duplicate stock table?")
->danger() ->danger()
->actions([ ->actions([
\Filament\Notifications\Actions\Action::make('confirm') \Filament\Notifications\Actions\Action::make('confirm')
@@ -1574,7 +1575,7 @@ class CycleCount extends Page
\Filament\Notifications\Actions\Action::make('confirm') \Filament\Notifications\Actions\Action::make('confirm')
->label('Yes, Update') ->label('Yes, Update')
->button() ->button()
->dispatch('confirmSerialUpdate', [ ->dispatch('confirmSerialFGUpdate', [
'plantId' => $plantId, 'plantId' => $plantId,
'location' => $location, 'location' => $location,
'bin' => $bin, 'bin' => $bin,
@@ -1633,7 +1634,7 @@ class CycleCount extends Page
\Filament\Notifications\Actions\Action::make('confirm') \Filament\Notifications\Actions\Action::make('confirm')
->label('Yes, Update') ->label('Yes, Update')
->button() ->button()
->dispatch('confirmSerialUpdate', [ ->dispatch('confirmSerialFGUpdate', [
'plantId' => $plantId, 'plantId' => $plantId,
'location' => $location, 'location' => $location,
'bin' => $bin, 'bin' => $bin,

View File

@@ -728,6 +728,17 @@ class PdfController extends Controller
], 404); ], 404);
} }
if ($scrapQty == null || $scrapQty == '') {
$scrapQty = 0;
}
if ($rework == null || $rework == '' || ! $rework) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Rework value can't be empty!",
], 404);
}
$line = Line::where('name', $lineName)->first(); $line = Line::where('name', $lineName)->first();
if (! $line) { if (! $line) {
@@ -895,20 +906,6 @@ class PdfController extends Controller
$total = $alreadyReceived + $receivedQty; $total = $alreadyReceived + $receivedQty;
if ($total > $orderQty) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Received quantity should not exceed order quantity! Order Qty = {$orderQty}, Already Received Qty = {$alreadyReceived}, Trying to Insert Qty = {$receivedQty}",
], 404);
}
if ($rework == null || $rework == '' || ! $rework) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Rework value can't be empty!",
], 404);
}
if ($rework != 'Yes' && $rework != 'No') { if ($rework != 'Yes' && $rework != 'No') {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
@@ -949,6 +946,13 @@ class PdfController extends Controller
], 404); ], 404);
} }
if ($total > $orderQty) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Received quantity should not exceed order quantity! Order Qty = {$orderQty}, Already Received Qty = {$alreadyReceived}, Trying to Insert Qty = {$receivedQty}",
], 404);
}
$existingCoil = ProcessOrder::where('plant_id', $plantId) $existingCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) ->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId) ->where('line_id', $lineNamePlantId)
@@ -994,7 +998,7 @@ class PdfController extends Controller
]); ]);
} }
} else { } else {
if ($coilNo >= 1) { if ($coilNo > 1) {
$prevCoilNo = (string) ($coilNo - 1); $prevCoilNo = (string) ($coilNo - 1);
$existPrevCoil = ProcessOrder::where('plant_id', $plantId) $existPrevCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) ->where('process_order', $processOrder)
@@ -1004,7 +1008,7 @@ class PdfController extends Controller
if (! $existPrevCoil) { if (! $existPrevCoil) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Previouse coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!", 'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
], 404); ], 404);
} }
} }
@@ -1022,6 +1026,19 @@ class PdfController extends Controller
], 404); ], 404);
} }
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder)
->where('item_id', $itemId)
->where('coil_number', $coilNo)
->first();
if ($existPrevCoil->received_quantity < $receivedQty) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Rework received quantity should not exceed exist received quantity! Exist Received Qty = {$existPrevCoil->received_quantity}, Trying to Insert Qty = {$receivedQty}",
], 404);
}
$updated = ProcessOrder::where('plant_id', $plantId) $updated = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) ->where('process_order', $processOrder)
->where('line_id', $lineNamePlantId) ->where('line_id', $lineNamePlantId)
@@ -1070,7 +1087,7 @@ class PdfController extends Controller
], 404); ], 404);
} }
if ($coilNo >= 1) { if ($coilNo > 1) {
$prevCoilNo = (string) ($coilNo - 1); $prevCoilNo = (string) ($coilNo - 1);
$existPrevCoil = ProcessOrder::where('plant_id', $plantId) $existPrevCoil = ProcessOrder::where('plant_id', $plantId)
->where('process_order', $processOrder) ->where('process_order', $processOrder)
@@ -1080,11 +1097,18 @@ class PdfController extends Controller
if (! $existPrevCoil) { if (! $existPrevCoil) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Previouse coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!", 'status_description' => "Previous coil number '{$prevCoilNo}' not exist against plant code '{$plantCode}' and process order '{$processOrder}'!",
], 404); ], 404);
} }
} }
if ($total > $orderQty) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Received quantity should not exceed order quantity! Order Qty = {$orderQty}, Already Received Qty = {$alreadyReceived}, Trying to Insert Qty = {$receivedQty}",
], 404);
}
ProcessOrder::Create( ProcessOrder::Create(
[ [
'plant_id' => $plantId, 'plant_id' => $plantId,