Compare commits
25 Commits
31f96dd11e
...
ranjith-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
499fa0b2dd | ||
|
|
27b5ad2cfe | ||
|
|
4c7bed8c63 | ||
|
|
253d319587 | ||
|
|
ead2edc63b | ||
|
|
18f23ce097 | ||
|
|
198b901671 | ||
|
|
3192e32d5d | ||
|
|
61be13c367 | ||
|
|
3d139c005a | ||
|
|
4325f2695f | ||
|
|
8eeb23e2aa | ||
|
|
73611a417b | ||
|
|
37df670eab | ||
|
|
58b801b8e2 | ||
|
|
5aa2e7a871 | ||
|
|
97fb46883f | ||
|
|
e20892cc83 | ||
|
|
658db00ac8 | ||
|
|
ec8bfc8296 | ||
|
|
6dff4fb77e | ||
|
|
41d158877e | ||
|
|
0b5b0b8dd4 | ||
|
|
9c582b73a5 | ||
|
|
a67386f7a0 |
@@ -36,6 +36,8 @@ class ProcessOrderExporter extends Exporter
|
||||
->label('COIL NUMBER'),
|
||||
ExportColumn::make('order_quantity')
|
||||
->label('ORDER QUANTITY'),
|
||||
ExportColumn::make('updated_order_quantity')
|
||||
->label('UPDATED ORDER QUANTITY'),
|
||||
ExportColumn::make('received_quantity')
|
||||
->label('RECEIVED QUANTITY'),
|
||||
ExportColumn::make('sfg_number')
|
||||
|
||||
@@ -14,6 +14,7 @@ class StockDataMasterExporter extends Exporter
|
||||
public static function getColumns(): array
|
||||
{
|
||||
static $rowNumber = 0;
|
||||
|
||||
return [
|
||||
ExportColumn::make('no')
|
||||
->label('NO')
|
||||
@@ -29,7 +30,7 @@ class StockDataMasterExporter extends Exporter
|
||||
->label('TYPE')
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
'0' => 'FG',
|
||||
'1' => 'SFG',
|
||||
'1' => 'NON-FG',
|
||||
default => '-',
|
||||
}),
|
||||
ExportColumn::make('location')
|
||||
@@ -60,8 +61,61 @@ class StockDataMasterExporter extends Exporter
|
||||
->label('PANEL BOX SNO'),
|
||||
ExportColumn::make('scanned_status')
|
||||
->label('SCANNED STATUS'),
|
||||
ExportColumn::make('scanned_count')
|
||||
->label('SCANNED COUNT'),
|
||||
ExportColumn::make('scanned_quantity')
|
||||
->label('SCANNED QUANTITY'),
|
||||
ExportColumn::make('system_stock')
|
||||
->label('SYSTEM STOCK')
|
||||
->state(fn ($record) => $record->quantity),
|
||||
ExportColumn::make('scanned_stock')
|
||||
->label('SCANNED STOCK')
|
||||
->state(fn ($record) => $record->scanned_quantity),
|
||||
ExportColumn::make('duplicate_stock')
|
||||
->label('DUPLICATE STOCK')
|
||||
->state(function ($record) {
|
||||
return \App\Models\DuplicateStock::where('stock_data_master_id', $record->id)->count();
|
||||
}),
|
||||
ExportColumn::make('not_in_stock')
|
||||
->label('NOT IN STOCK')
|
||||
->state(function ($record) {
|
||||
return \App\Models\NotInStock::where('serial_number', $record->serial_number)
|
||||
->where('plant_id', $record->plant_id)
|
||||
->count();
|
||||
}),
|
||||
ExportColumn::make('physical_stock')
|
||||
->label('PHYSICAL STOCK')
|
||||
->state(function ($record) {
|
||||
|
||||
$duplicate = \App\Models\DuplicateStock::where('stock_data_master_id', $record->id)->count();
|
||||
|
||||
$notInStock = \App\Models\NotInStock::where('serial_number', $record->serial_number)
|
||||
->where('plant_id', $record->plant_id)
|
||||
->count();
|
||||
|
||||
$scanned = $record->scanned_quantity ?? 0;
|
||||
|
||||
return $scanned + $duplicate + $notInStock;
|
||||
}),
|
||||
|
||||
ExportColumn::make('stock_difference')
|
||||
->label('STOCK DIFFERENCE COUNT')
|
||||
->state(function ($record) {
|
||||
|
||||
$duplicate = \App\Models\DuplicateStock::where('stock_data_master_id', $record->id)->count();
|
||||
|
||||
$notInStock = \App\Models\NotInStock::where('serial_number', $record->serial_number)
|
||||
->where('plant_id', $record->plant_id)
|
||||
->count();
|
||||
|
||||
$scanned = (int) $record->scanned_quantity;
|
||||
|
||||
$physicalStock = $scanned + $duplicate + $notInStock;
|
||||
|
||||
$systemStock = (int) $record->quantity;
|
||||
|
||||
$difference = $physicalStock - $systemStock;
|
||||
|
||||
return max($difference, 0);
|
||||
}),
|
||||
ExportColumn::make('created_at')
|
||||
->label('CREATED AT'),
|
||||
ExportColumn::make('updated_at')
|
||||
@@ -78,10 +132,10 @@ class StockDataMasterExporter extends Exporter
|
||||
|
||||
public static function getCompletedNotificationBody(Export $export): string
|
||||
{
|
||||
$body = 'Your stock data master export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
|
||||
$body = 'Your stock data master export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
|
||||
|
||||
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
|
||||
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
|
||||
@@ -52,6 +52,9 @@ class ProcessOrderImporter extends Importer
|
||||
->example('1000')
|
||||
->label('ORDER QUANTITY')
|
||||
->rules(['required']),
|
||||
ImportColumn::make('updated_order_quantity')
|
||||
->exampleHeader('UPDATED ORDER QUANTITY')
|
||||
->label('UPDATED ORDER QUANTITY'),
|
||||
ImportColumn::make('coil_number')
|
||||
->exampleHeader('COIL NUMBER')
|
||||
// ->example('01')
|
||||
@@ -110,6 +113,7 @@ class ProcessOrderImporter extends Importer
|
||||
$sfgNo = trim($this->data['sfg_number'] ?? '');
|
||||
$machineName = trim($this->data['machine_name'] ?? '');
|
||||
$orderQuan = trim($this->data['order_quantity'] ?? '');
|
||||
$updatedOrderQuan = trim($this->data['updated_order_quantity'] ?? '');
|
||||
$scrapQuan = trim($this->data['scrap_quantity'] ?? '');
|
||||
$reworkStatus = trim($this->data['rework_status'] ?? '');
|
||||
$recQuan = trim($this->data['received_quantity'] ?? '');
|
||||
@@ -128,11 +132,14 @@ class ProcessOrderImporter extends Importer
|
||||
if ($iCode == null || $iCode == '') {
|
||||
$warnMsg[] = "Item code can't be empty!";
|
||||
} elseif (Str::length($iCode) < 6 || ! ctype_alnum($iCode)) {
|
||||
$warnMsg[] = 'Invalid item code found';
|
||||
$warnMsg[] = 'Invalid item code found!';
|
||||
}
|
||||
if ($machineName != null && $machineName != '' && Str::length($machineName) > 18) {
|
||||
$warnMsg[] = 'Invalid machine name found!';
|
||||
}
|
||||
if ($processOrder == null || $processOrder == '') {
|
||||
$warnMsg[] = "Process order can't be empty!";
|
||||
} elseif ($processOrder && Str::contains($processOrder, '.')) {
|
||||
} elseif ($processOrder && (Str::contains($processOrder, '.') || Str::contains($processOrder, 'E', ignoreCase: true))) {
|
||||
$warnMsg[] = 'Invalid process order found!';
|
||||
}
|
||||
if ($lineNam == null || $lineNam == '') {
|
||||
@@ -145,6 +152,12 @@ class ProcessOrderImporter extends Importer
|
||||
} elseif (Str::length($orderQuan) >= 1 && ! is_numeric($orderQuan)) {
|
||||
$warnMsg[] = 'Invalid order quantity found!';
|
||||
}
|
||||
if ($updatedOrderQuan == null || $updatedOrderQuan == '' || $updatedOrderQuan == 0 || $updatedOrderQuan == '0') {
|
||||
$updatedOrderQuan = $orderQuan;
|
||||
} elseif (Str::length($updatedOrderQuan) >= 1 && ! is_numeric($updatedOrderQuan)) {
|
||||
$warnMsg[] = 'Invalid Updated order quantity found!';
|
||||
}
|
||||
|
||||
if ($coilNo == null || $coilNo == '') {
|
||||
$coilNo = '0';
|
||||
}
|
||||
@@ -159,7 +172,7 @@ class ProcessOrderImporter extends Importer
|
||||
} elseif ($reworkStatus == 1 || $reworkStatus = '1') {
|
||||
$reworkStatus = 1;
|
||||
} else {
|
||||
$warnMsg[] = 'Invalid rework status found';
|
||||
$warnMsg[] = 'Invalid rework status found!';
|
||||
}
|
||||
|
||||
if (! empty($warnMsg)) {
|
||||
@@ -223,7 +236,7 @@ class ProcessOrderImporter extends Importer
|
||||
->first();
|
||||
|
||||
if ($existingOrder && $existingOrder->item_id !== ($itemId ?? null)) {
|
||||
$warnMsg[] = 'Same Process Order already exists for this Plant with a different Item Code';
|
||||
$warnMsg[] = 'Same Process Order already exists for this Plant with a different Item Code!';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,6 +256,39 @@ class ProcessOrderImporter extends Importer
|
||||
throw new RowImportFailedException(implode(', ', $warnMsg));
|
||||
}
|
||||
|
||||
$existing = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
// ->where('coil_number', $coilNo)
|
||||
->first();
|
||||
|
||||
$receivedQty = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->sum('received_quantity');
|
||||
|
||||
if ($existing) {
|
||||
$liveOrdQuan = (float) $existing->order_quantity;
|
||||
$liveUpdatedOrdQuan = (float) $existing->updated_order_quantity;
|
||||
|
||||
$allowedIncrease = $liveOrdQuan * 0.10;
|
||||
|
||||
$maxAllowedQty = $liveOrdQuan + $allowedIncrease;
|
||||
$minAllowedQty = $liveOrdQuan - $allowedIncrease;
|
||||
|
||||
if ($liveUpdatedOrdQuan > $maxAllowedQty) {
|
||||
throw new RowImportFailedException(
|
||||
"Updated order quantity cannot exceed 10% of existing order quantity. Max allowed: {$maxAllowedQty}!"
|
||||
);
|
||||
} elseif ($liveUpdatedOrdQuan < $minAllowedQty) {
|
||||
throw new RowImportFailedException(
|
||||
"Updated order quantity cannot decrease -10% of existing order quantity. Min allowed: {$minAllowedQty}!"
|
||||
);
|
||||
} elseif ($liveUpdatedOrdQuan < $receivedQty) {
|
||||
throw new RowImportFailedException(
|
||||
"Updated order quantity cannot decrease below its received quantity {$receivedQty}!"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($coilNo != null && $coilNo != '' && $scrapQuan && $reworkStatus && $recQuan && $createdAt && $createdBy && $updatedAt && $updatedBy && Filament::auth()->user()->hasRole('Super Admin')) {
|
||||
$existingCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
@@ -250,6 +296,17 @@ class ProcessOrderImporter extends Importer
|
||||
->where('coil_number', $coilNo)
|
||||
->first();
|
||||
|
||||
// $existingProcess = ProcessOrder::where('plant_id', $plantId)
|
||||
// ->where('process_order', $processOrder)
|
||||
// ->where('line_id', $lineId)
|
||||
// ->first();
|
||||
|
||||
if ($existing) {
|
||||
$existUpdateOrdQuan = $existing->updated_order_quantity;
|
||||
} else {
|
||||
$existUpdateOrdQuan = $updatedOrderQuan;
|
||||
}
|
||||
|
||||
if (! $existingCoil) {
|
||||
ProcessOrder::Create(
|
||||
[
|
||||
@@ -259,6 +316,7 @@ class ProcessOrderImporter extends Importer
|
||||
'item_id' => $itemId,
|
||||
'coil_number' => $coilNo,
|
||||
'order_quantity' => $orderQuan,
|
||||
'updated_order_quantity' => $existUpdateOrdQuan,
|
||||
'received_quantity' => $recQuan,
|
||||
'scrap_quantity' => $scrapQuan,
|
||||
'sfg_number' => $sfgNo,
|
||||
@@ -288,10 +346,16 @@ class ProcessOrderImporter extends Importer
|
||||
}
|
||||
} else {
|
||||
$coilNo = '0';
|
||||
$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) {
|
||||
$existUpdateOrdQuan = $existing->updated_order_quantity;
|
||||
} else {
|
||||
$existUpdateOrdQuan = $updatedOrderQuan;
|
||||
}
|
||||
|
||||
if (! $existing && ($coilNo == '0' || $coilNo == 0)) {
|
||||
ProcessOrder::create([
|
||||
@@ -301,6 +365,7 @@ class ProcessOrderImporter extends Importer
|
||||
'process_order' => $processOrder,
|
||||
'coil_number' => '0',
|
||||
'order_quantity' => $orderQuan,
|
||||
'updated_order_quantity' => $existUpdateOrdQuan,
|
||||
'received_quantity' => 0,
|
||||
'scrap_quantity' => 0,
|
||||
'created_by' => $createdBy,
|
||||
@@ -315,6 +380,7 @@ class ProcessOrderImporter extends Importer
|
||||
'process_order' => $processOrder,
|
||||
'coil_number' => $coilNo,
|
||||
'order_quantity' => $orderQuan,
|
||||
'updated_order_quantity' => $existUpdateOrdQuan,
|
||||
'received_quantity' => $recQuan,
|
||||
'scrap_quantity' => $scrapQuan ?? 0,
|
||||
'sfg_number' => $sfgNo,
|
||||
|
||||
@@ -6,12 +6,12 @@ use App\Models\Item;
|
||||
use App\Models\Plant;
|
||||
use App\Models\StickerMaster;
|
||||
use App\Models\StockDataMaster;
|
||||
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
|
||||
use Filament\Actions\Imports\ImportColumn;
|
||||
use Filament\Actions\Imports\Importer;
|
||||
use Filament\Actions\Imports\Models\Import;
|
||||
use Filament\Facades\Filament;
|
||||
use Str;
|
||||
use Filament\Actions\Imports\Exceptions\RowImportFailedException;
|
||||
|
||||
class StockDataMasterImporter extends Importer
|
||||
{
|
||||
@@ -23,46 +23,46 @@ class StockDataMasterImporter extends Importer
|
||||
ImportColumn::make('plant')
|
||||
->requiredMapping()
|
||||
->exampleHeader('PLANT CODE')
|
||||
->example('1000')
|
||||
->examples(['1000', '1000'])
|
||||
->label('PLANT CODE')
|
||||
->relationship(resolveUsing: 'code')
|
||||
->rules(['required']),
|
||||
ImportColumn::make('type')
|
||||
->requiredMapping()
|
||||
->exampleHeader('TYPE')
|
||||
->example('FG/SFG')
|
||||
->examples(['FG', 'NON-FG'])
|
||||
->label('TYPE'),
|
||||
ImportColumn::make('location')
|
||||
->requiredMapping()
|
||||
->exampleHeader('LOCATION')
|
||||
->example('2001')
|
||||
->examples(['2001', '2002'])
|
||||
->label('LOCATION')
|
||||
->rules(['required']),
|
||||
ImportColumn::make('item_reference')// stickerMaster
|
||||
ImportColumn::make('item_reference')
|
||||
->requiredMapping()
|
||||
->exampleHeader('ITEM CODE')
|
||||
->example('123456')
|
||||
->examples(['123456', '246118'])
|
||||
->label('ITEM CODE')
|
||||
->rules(['required']),
|
||||
ImportColumn::make('serial_number')
|
||||
->requiredMapping()
|
||||
->exampleHeader('SERIAL NUMBER')
|
||||
->example('200235236622')
|
||||
->examples(['200235236622', '200235236623'])
|
||||
->label('SERIAL NUMBER'),
|
||||
ImportColumn::make('batch')
|
||||
->requiredMapping()
|
||||
->exampleHeader('BATCH')
|
||||
->example('20102')
|
||||
->examples(['20102', '20103'])
|
||||
->label('BATCH'),
|
||||
ImportColumn::make('quantity')
|
||||
->requiredMapping()
|
||||
->exampleHeader('QUANTITY')
|
||||
->example('1')
|
||||
->examples(['1', '1'])
|
||||
->label('QUANTITY'),
|
||||
ImportColumn::make('doc_no')
|
||||
->requiredMapping()
|
||||
->exampleHeader('DOCUMENT NUMBER')
|
||||
->example('156566')
|
||||
->examples(['82128', '21222'])
|
||||
->label('DOCUMENT NUMBER'),
|
||||
];
|
||||
}
|
||||
@@ -86,26 +86,21 @@ class StockDataMasterImporter extends Importer
|
||||
|
||||
$operatorName = $user->name;
|
||||
|
||||
|
||||
if ($plantCod == null || $plantCod == '') {
|
||||
$warnMsg[] = "Plant code can't be empty!";
|
||||
}
|
||||
else if ($typeValue == null || $typeValue == '') {
|
||||
} elseif ($typeValue == null || $typeValue == '') {
|
||||
$warnMsg[] = "Type can't be empty!";
|
||||
}
|
||||
else if ($iCode == null || $iCode == '') {
|
||||
} elseif ($iCode == null || $iCode == '') {
|
||||
$warnMsg[] = "Item code can't be empty!";
|
||||
}
|
||||
else if ($location == null || $location == '') {
|
||||
} elseif ($location == null || $location == '') {
|
||||
$warnMsg[] = "Location can't be empty!";
|
||||
}
|
||||
else if ($serialNumber == null || $serialNumber == '') {
|
||||
} elseif ($serialNumber == null || $serialNumber == '') {
|
||||
$warnMsg[] = "Serial number can't be empty!";
|
||||
}
|
||||
// else if ($batch == null || $batch == '') {
|
||||
// $warnMsg[] = "Batch can't be empty!";
|
||||
// }
|
||||
else if ($quantity == null || $quantity == '') {
|
||||
elseif ($quantity == null || $quantity == '') {
|
||||
$warnMsg[] = "Quantity can't be empty!";
|
||||
}
|
||||
// else if ($docNo == null || $docNo == '') {
|
||||
@@ -152,33 +147,27 @@ class StockDataMasterImporter extends Importer
|
||||
|
||||
$typeValue = strtoupper($typeValue);
|
||||
|
||||
if (! in_array($typeValue, ['FG', 'SFG'])) {
|
||||
$warnMsg[] = 'Invalid type found! It should be either FG or SFG and fg/sfg.';
|
||||
}
|
||||
else if (Str::length($location) < 4) {
|
||||
if (! in_array($typeValue, ['FG', 'NON-FG'])) {
|
||||
$warnMsg[] = 'Invalid type found! It should be either FG or NON-FG.';
|
||||
} elseif (Str::length($location) < 4) {
|
||||
$warnMsg[] = 'Location should contain minimum 4 digits!';
|
||||
}
|
||||
else if (! ctype_digit((string) $location)) {
|
||||
} elseif (! ctype_digit((string) $location)) {
|
||||
$warnMsg[] = 'Location must be an integer!';
|
||||
}
|
||||
else if (Str::length($serialNumber) < 9) {
|
||||
} elseif (Str::length($serialNumber) < 9) {
|
||||
$warnMsg[] = 'Serial number should contain minimum 9 digits!';
|
||||
}
|
||||
else if (!ctype_alnum($serialNumber)) {
|
||||
} elseif (! ctype_alnum($serialNumber)) {
|
||||
$warnMsg[] = 'Serial number should contain alpha-numeric values!';
|
||||
}
|
||||
|
||||
else if (! ctype_digit((string) $quantity) || (int) $quantity <= 0) {
|
||||
} elseif (! ctype_digit((string) $quantity) || (int) $quantity <= 0) {
|
||||
$warnMsg[] = 'Quantity must be an integer and greater than 0!';
|
||||
}
|
||||
|
||||
if($batch){
|
||||
if ($batch) {
|
||||
if (Str::length($batch) < 5) {
|
||||
$warnMsg[] = 'Batch should contain minimum 5 digits!';
|
||||
}
|
||||
}
|
||||
|
||||
if($docNo){
|
||||
if ($docNo) {
|
||||
if (Str::length($docNo) < 5) {
|
||||
$warnMsg[] = 'Document number contain minimum 5 digits!';
|
||||
}
|
||||
@@ -190,7 +179,7 @@ class StockDataMasterImporter extends Importer
|
||||
|
||||
$type = match ($typeValue) {
|
||||
'FG' => '0',
|
||||
'SFG' => '1',
|
||||
'NON-FG' => '1',
|
||||
default => null,
|
||||
};
|
||||
|
||||
@@ -199,7 +188,7 @@ class StockDataMasterImporter extends Importer
|
||||
$record = StockDataMaster::where([
|
||||
'plant_id' => $plantId,
|
||||
'sticker_master_id' => $stickId,
|
||||
'serial_number' => $serialNumber
|
||||
'serial_number' => $serialNumber,
|
||||
])->first();
|
||||
|
||||
if ($record) {
|
||||
@@ -234,10 +223,10 @@ class StockDataMasterImporter extends Importer
|
||||
|
||||
public static function getCompletedNotificationBody(Import $import): string
|
||||
{
|
||||
$body = 'Your stock data master import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
|
||||
$body = 'Your stock data master import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
|
||||
|
||||
if ($failedRowsCount = $import->getFailedRowsCount()) {
|
||||
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
|
||||
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Filament\Widgets\CumulativeChart;
|
||||
use App\Filament\Widgets\ProductionQuantityStat;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
@@ -9,64 +10,117 @@ use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Plant;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Widgets\Widget;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class Dashboard extends \Filament\Pages\Dashboard
|
||||
{
|
||||
use HasFiltersForm;
|
||||
use HasFiltersForm;
|
||||
|
||||
protected static ?string $navigationGroup = 'Production DashBoard';
|
||||
protected static ?string $navigationIcon = 'heroicon-s-gift';
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
session()->forget(['selected_plant']);
|
||||
$this->filtersForm->fill([
|
||||
'plant' => null
|
||||
]);
|
||||
}
|
||||
protected static string $view = 'filament.pages.dashboard';
|
||||
|
||||
public function filtersForm(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->statePath('filters') // Store form state in 'filters'
|
||||
->schema([
|
||||
Select::make('plant')
|
||||
->options(Plant::pluck('name', 'id'))
|
||||
->label('Select Plant')
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state) {
|
||||
session(['selected_plant' => $state]); // fixed typo
|
||||
//$this->dispatch('cumulativeChart'); // custom Livewire event
|
||||
}),
|
||||
]);
|
||||
// public function mount(): void
|
||||
// {
|
||||
// session()->forget(['selected_plant']);
|
||||
// session()->forget(['from_date']);
|
||||
// session()->forget(['to_date']);
|
||||
// $this->filtersForm->fill([
|
||||
// 'plant' => null,
|
||||
// 'from_date' => null,
|
||||
// 'to_date' => null,
|
||||
// // 'success_status' => null
|
||||
// ]);
|
||||
// }
|
||||
|
||||
}
|
||||
// public function filtersForm(Form $form): Form
|
||||
// {
|
||||
// return $form
|
||||
// ->statePath('filters') // Store form state in 'filters'
|
||||
// ->schema([
|
||||
// Select::make('plant')
|
||||
// ->label('Select Plant')
|
||||
// ->reactive()
|
||||
// // ->options(Plant::pluck('name', 'id'))
|
||||
// ->options(function (callable $get) {
|
||||
// $userHas = Filament::auth()->user()->plant_id;
|
||||
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||
// })
|
||||
// ->afterStateUpdated(function ($state,callable $set) {
|
||||
// session(['selected_plant' => $state]); // fixed typo
|
||||
// //$this->dispatch('cumulativeChart'); // custom Livewire event
|
||||
// // Reset success_status whenever plant changes
|
||||
// $set('success_status', null);
|
||||
// session()->forget('success_status');
|
||||
// }),
|
||||
|
||||
// // Select::make('success_status')
|
||||
// // ->label('Select Status')
|
||||
// // ->options([
|
||||
// // 'Ok' => 'Ok',
|
||||
// // 'Not Ok' => 'Not Ok',
|
||||
// // ])
|
||||
// // ->reactive()
|
||||
// // ->afterStateUpdated(function ($state) {
|
||||
// // session(['success_status' => $state]);
|
||||
// // }),
|
||||
|
||||
// DatePicker::make('created_from')
|
||||
// ->label('Created From')
|
||||
// ->reactive()
|
||||
// ->afterStateUpdated(function ($state,callable $set) {
|
||||
// session(['from_date' => $state]);
|
||||
// }),
|
||||
|
||||
// DatePicker::make('created_to')
|
||||
// ->label('Created To')
|
||||
// ->reactive()
|
||||
// ->afterStateUpdated(function ($state,callable $set) {
|
||||
// session(['to_date' => $state]);
|
||||
// }),
|
||||
|
||||
// ]);
|
||||
// }
|
||||
|
||||
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
return 'Production Line Count';
|
||||
}
|
||||
// public static function getNavigationLabel(): string
|
||||
// {
|
||||
// return 'Production Line Count';
|
||||
// }
|
||||
|
||||
// public function getHeading(): string
|
||||
// {
|
||||
// return 'Production Line Count';
|
||||
// }
|
||||
|
||||
// public function getWidgets(): array
|
||||
// {
|
||||
// $widgets = [];
|
||||
|
||||
// if (CumulativeChart::canView()) {
|
||||
// $widgets[] = CumulativeChart::class;
|
||||
|
||||
// }
|
||||
// return $widgets;
|
||||
// }
|
||||
|
||||
// public static function canAccess(): bool
|
||||
// {
|
||||
// return Auth::check() && Auth::user()->can('view production line count dashboard');
|
||||
// }
|
||||
|
||||
|
||||
public function getHeading(): string
|
||||
{
|
||||
return 'Production Line Count';
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getWidgets(): array
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
$widgets = [];
|
||||
|
||||
if (CumulativeChart::canView()) {
|
||||
$widgets[] = CumulativeChart::class;
|
||||
}
|
||||
return $widgets;
|
||||
}
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return Auth::check() && Auth::user()->can('view production line count dashboard');
|
||||
return 'Welcome';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use Filament\Pages\Page;
|
||||
use App\Filament\Widgets\CumulativeChart;
|
||||
use App\Filament\Widgets\ProductionQuantityStat;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Plant;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Widgets\Widget;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Forms\Concerns\InteractsWithForms;
|
||||
|
||||
class Welcome extends Page
|
||||
{
|
||||
protected static ?string $navigationIcon = 'heroicon-s-gift'; // 'heroicon-o-document-text';
|
||||
|
||||
protected static string $view = 'filament.pages.welcome';
|
||||
|
||||
public function getHeading(): string
|
||||
protected static ?string $navigationIcon = 'heroicon-o-document-text';
|
||||
|
||||
use HasFiltersForm;
|
||||
|
||||
use InteractsWithForms;
|
||||
|
||||
protected static ?string $navigationGroup = 'Production DashBoard';
|
||||
|
||||
protected static ?string $slug = 'production-line-count';
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
return '';
|
||||
session()->forget(['selected_plant']);
|
||||
// session()->forget(['from_date']);
|
||||
// session()->forget(['to_date']);
|
||||
$this->filtersForm->fill([
|
||||
'plant' => null,
|
||||
// 'from_date' => null,
|
||||
// 'to_date' => null,
|
||||
// 'success_status' => null
|
||||
]);
|
||||
}
|
||||
|
||||
public function filtersForm(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->statePath('filters')
|
||||
->schema([
|
||||
Select::make('plant')
|
||||
->label('Select Plant')
|
||||
->reactive()
|
||||
// ->options(Plant::pluck('name', 'id'))
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||
})
|
||||
->afterStateUpdated(function ($state,callable $set) {
|
||||
session(['selected_plant' => $state]);
|
||||
//$this->dispatch('cumulativeChart'); // custom Livewire event
|
||||
// Reset success_status whenever plant changes
|
||||
// $set('success_status', null);
|
||||
// session()->forget('success_status');
|
||||
}),
|
||||
|
||||
// Select::make('success_status')
|
||||
// ->label('Select Status')
|
||||
// ->options([
|
||||
// 'Ok' => 'Ok',
|
||||
// 'Not Ok' => 'Not Ok',
|
||||
// ])
|
||||
// ->reactive()
|
||||
// ->afterStateUpdated(function ($state) {
|
||||
// session(['success_status' => $state]);
|
||||
// }),
|
||||
|
||||
// DatePicker::make('created_from')
|
||||
// ->label('Created From')
|
||||
// ->reactive()
|
||||
// ->afterStateUpdated(function ($state,callable $set) {
|
||||
// session(['from_date' => $state]);
|
||||
// }),
|
||||
|
||||
// DatePicker::make('created_to')
|
||||
// ->label('Created To')
|
||||
// ->reactive()
|
||||
// ->afterStateUpdated(function ($state,callable $set) {
|
||||
// session(['to_date' => $state]);
|
||||
// }),
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
// public static function canAccess(): bool
|
||||
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
return 'Production Line Count';
|
||||
}
|
||||
|
||||
public function getHeading(): string
|
||||
{
|
||||
return 'Production Line Count';
|
||||
}
|
||||
|
||||
// public function getWidgets(): array
|
||||
// {
|
||||
// return Auth::check() && Auth::user()->can('view welcome page');
|
||||
// $widgets = [];
|
||||
|
||||
// if (CumulativeChart::canView()) {
|
||||
// $widgets[] = CumulativeChart::class;
|
||||
|
||||
// }
|
||||
// return $widgets;
|
||||
// }
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return Auth::check() && Auth::user()->can('view production line count dashboard');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\DuplicateStockResource\Pages;
|
||||
use App\Filament\Resources\DuplicateStockResource\RelationManagers;
|
||||
use App\Models\DuplicateStock;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
@@ -97,7 +96,7 @@ class DuplicateStockResource extends Resource
|
||||
->searchable()
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
'0' => 'FG',
|
||||
'1' => 'SFG',
|
||||
'1' => 'NON-FG',
|
||||
default => '-',
|
||||
})
|
||||
->sortable(),
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\NotInStockResource\Pages;
|
||||
use App\Filament\Resources\NotInStockResource\RelationManagers;
|
||||
use App\Models\NotInStock;
|
||||
use App\Models\StickerMaster;
|
||||
use Filament\Facades\Filament;
|
||||
@@ -38,15 +37,15 @@ class NotInStockResource extends Resource
|
||||
->required()
|
||||
->searchable()
|
||||
->options(function ($get) {
|
||||
if (!$get('plant_id')) {
|
||||
if (! $get('plant_id')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return StickerMaster::with('item')
|
||||
->where('plant_id', $get('plant_id'))
|
||||
->get()
|
||||
->pluck('item.code', 'id')
|
||||
->toArray();
|
||||
return StickerMaster::with('item')
|
||||
->where('plant_id', $get('plant_id'))
|
||||
->get()
|
||||
->pluck('item.code', 'id')
|
||||
->toArray();
|
||||
}),
|
||||
Forms\Components\TextInput::make('location')
|
||||
->label('Location'),
|
||||
@@ -64,7 +63,7 @@ class NotInStockResource extends Resource
|
||||
->label('Type')
|
||||
->options([
|
||||
'0' => 'FG',
|
||||
'1' => 'SFG',
|
||||
'1' => 'NON-FG',
|
||||
]),
|
||||
Forms\Components\TextInput::make('motor_scanned_status')
|
||||
->label('Motor Scanned Status'),
|
||||
@@ -122,7 +121,7 @@ class NotInStockResource extends Resource
|
||||
->searchable()
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
'0' => 'FG',
|
||||
'1' => 'SFG',
|
||||
'1' => 'NON-FG',
|
||||
default => '-',
|
||||
})
|
||||
->sortable(),
|
||||
|
||||
@@ -74,6 +74,7 @@ class ProcessOrderResource extends Resource
|
||||
$set('process_order', null);
|
||||
$set('coil_number', '0');
|
||||
$set('order_quantity', '0');
|
||||
$set('updated_order_quantity', '0');
|
||||
$set('received_quantity', '0');
|
||||
$set('scrap_quantity', '0');
|
||||
$set('sfg_number', null);
|
||||
@@ -113,6 +114,7 @@ class ProcessOrderResource extends Resource
|
||||
$set('process_order', null);
|
||||
$set('coil_number', '0');
|
||||
$set('order_quantity', '0');
|
||||
$set('updated_order_quantity', '0');
|
||||
$set('received_quantity', '0');
|
||||
$set('scrap_quantity', '0');
|
||||
$set('sfg_number', null);
|
||||
@@ -141,6 +143,7 @@ class ProcessOrderResource extends Resource
|
||||
$set('process_order', null);
|
||||
$set('coil_number', '0');
|
||||
$set('order_quantity', '0');
|
||||
$set('updated_order_quantity', '0');
|
||||
$set('received_quantity', '0');
|
||||
$set('scrap_quantity', '0');
|
||||
$set('sfg_number', null);
|
||||
@@ -217,6 +220,7 @@ class ProcessOrderResource extends Resource
|
||||
$plantId = $get('plant_id');
|
||||
$set('coil_number', '0');
|
||||
$set('order_quantity', '0');
|
||||
$set('updated_order_quantity', '0');
|
||||
$set('received_quantity', '0');
|
||||
$set('scrap_quantity', '0');
|
||||
$set('sfg_number', null);
|
||||
@@ -280,10 +284,10 @@ class ProcessOrderResource extends Resource
|
||||
->required()
|
||||
->reactive()
|
||||
->numeric()
|
||||
->readOnly(fn ($get) => ($get('process_order') == null))
|
||||
->readOnly(fn ($get) => (trim($get('process_order')) == null || trim($get('process_order')) == ''))
|
||||
->afterStateUpdated(function ($state, $set, callable $get, $livewire) {
|
||||
$plantId = $get('plant_id');
|
||||
$processOrder = $get('process_order');
|
||||
$processOrder = trim($get('process_order'));
|
||||
// $coilNo = $get('coil_number');
|
||||
if (! $plantId) {
|
||||
$set('poPlantError', 'Please select a plant first.');
|
||||
@@ -319,14 +323,29 @@ class ProcessOrderResource extends Resource
|
||||
function (callable $get) {
|
||||
return Rule::unique('process_orders', 'coil_number')
|
||||
->where('plant_id', $get('plant_id'))
|
||||
->where('process_order', $get('process_order'))
|
||||
->where('process_order', trim($get('process_order')))
|
||||
->ignore($get('id'));
|
||||
},
|
||||
function (callable $get): Closure {
|
||||
return function (string $attribute, $value, Closure $fail) use ($get) {
|
||||
$rework = $get('rework_status');
|
||||
if ($value && Str::contains($value, '.') && $rework == 0) {
|
||||
$fail("Rework status should be 'Yes' for rework coil number '{$value}'!");
|
||||
$plantId = $get('plant_id');
|
||||
$processOrder = trim($get('process_order'));
|
||||
|
||||
if ($value && Str::contains($value, '.')) {
|
||||
if ($rework == 0) {
|
||||
$fail("Rework status should be 'Yes' for rework coil number '{$value}'!");
|
||||
}
|
||||
} elseif ($value > 1) {
|
||||
$prevCoilNo = (string) ($value - 1);
|
||||
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('coil_number', $prevCoilNo)
|
||||
->first();
|
||||
|
||||
if (! $existPrevCoil) {
|
||||
$fail("Previous coil number '{$prevCoilNo}' not exist against plant and process order!");
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -334,7 +353,7 @@ class ProcessOrderResource extends Resource
|
||||
// ->rule(function (callable $get) {
|
||||
// return Rule::unique('process_orders', 'coil_number')
|
||||
// ->where('plant_id', $get('plant_id'))
|
||||
// ->where('process_order', $get('process_order'))
|
||||
// ->where('process_order', trim($get('process_order')))
|
||||
// ->ignore($get('id'));
|
||||
// })
|
||||
->extraAttributes(fn ($get) => [
|
||||
@@ -348,15 +367,17 @@ class ProcessOrderResource extends Resource
|
||||
->required()
|
||||
->reactive()
|
||||
->numeric()
|
||||
->readOnly(fn ($get) => ($get('process_order') == null))
|
||||
->readOnly(fn ($get) => (trim($get('process_order')) == null || trim($get('process_order')) == ''))
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
$plantId = $get('plant_id');
|
||||
$itemId = $get('item_id');
|
||||
$processOrder = trim($get('process_order'));
|
||||
$set('received_quantity', '0');
|
||||
// $set('updated_order_quantity', $state);
|
||||
$set('scrap_quantity', '0');
|
||||
if (! $plantId || ! $itemId || ! $processOrder) {
|
||||
$set('order_quantity', '0');
|
||||
$set('updated_order_quantity', '0');
|
||||
}
|
||||
|
||||
$query = ProcessOrder::where('plant_id', $plantId)
|
||||
@@ -372,13 +393,175 @@ class ProcessOrderResource extends Resource
|
||||
}
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('updated_order_quantity')
|
||||
->label('Updated Order Quantity')
|
||||
->required()
|
||||
->readOnly(fn ($get) => (trim($get('process_order')) == null || trim($get('process_order')) == '' || trim($get('order_quantity')) == '' || trim($get('order_quantity')) == null))
|
||||
->reactive()
|
||||
->rules([
|
||||
function (callable $get): Closure {
|
||||
return function (string $attribute, $value, Closure $fail) use ($get) {
|
||||
$plantId = $get('plant_id');
|
||||
$processOrder = trim($get('process_order'));
|
||||
$receivedQty = $get('received_quantity');
|
||||
|
||||
$currentId = $get('id');
|
||||
|
||||
$orderQty = (float) $get('order_quantity');
|
||||
$updatedQty = (float) $value;
|
||||
|
||||
$allowedVariance = $orderQty * 0.10;
|
||||
|
||||
$maxAllowed = $orderQty + $allowedVariance;
|
||||
$minAllowed = $orderQty - $allowedVariance;
|
||||
|
||||
if ($updatedQty > $maxAllowed || $updatedQty < $minAllowed) {
|
||||
$fail('Quantity can vary by ±10% of the order quantity.');
|
||||
}
|
||||
|
||||
$otherReceivedQty = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->when($currentId, fn ($q) => $q->where('id', '!=', $currentId))
|
||||
->sum('received_quantity');
|
||||
|
||||
$currentReceivedQty = (float) $get('received_quantity');
|
||||
|
||||
$totalReceivedQty = $otherReceivedQty + $currentReceivedQty;
|
||||
|
||||
if ($updatedQty < $totalReceivedQty) {
|
||||
$fail("You cannot set quantity below received quantity ({$totalReceivedQty}).");
|
||||
}
|
||||
};
|
||||
},
|
||||
]),
|
||||
Forms\Components\TextInput::make('received_quantity')
|
||||
->label('Received Quantity')
|
||||
->default('0.000')
|
||||
->required()
|
||||
->reactive()
|
||||
->numeric()
|
||||
->readOnly(fn ($get) => ($get('process_order') == null))
|
||||
->maxValue(fn (Get $get) => $get('order_quantity') ?? PHP_INT_MAX)
|
||||
->readOnly(fn ($get) => (trim($get('process_order')) == null || trim($get('process_order')) == ''))
|
||||
->rule(function (callable $get) {
|
||||
return function (string $attribute, $value, Closure $fail) use ($get) {
|
||||
$rework = $get('rework_status');
|
||||
$plantId = $get('plant_id');
|
||||
$lineId = $get('line_id');
|
||||
$itemId = $get('item_id');
|
||||
$processOrder = trim($get('process_order'));
|
||||
$coilNo = trim($get('coil_number'));
|
||||
|
||||
$orderExist = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('item_id', $itemId)->latest()->first();
|
||||
|
||||
if ($orderExist) {
|
||||
// $orderQty = $orderExist->order_quantity ?? 0;
|
||||
$orderQty = $orderExist->updated_order_quantity ?? 0;
|
||||
|
||||
$alreadyReceived = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('item_id', $itemId)
|
||||
->sum('received_quantity');
|
||||
|
||||
$total = $alreadyReceived + $value;
|
||||
|
||||
if ($rework == 1) {
|
||||
if ($coilNo && Str::contains($coilNo, '.')) {
|
||||
$coilMain = explode('.', $coilNo)[0];
|
||||
|
||||
$existingCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('line_id', $lineId)
|
||||
->where('coil_number', $coilMain)
|
||||
->first();
|
||||
|
||||
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('item_id', $itemId)
|
||||
->where('coil_number', $coilNo)
|
||||
->first();
|
||||
|
||||
if ($existPrevCoil && $existPrevCoil->received_quantity < $value) {
|
||||
$fail('Rework received quantity should not exceed exist received quantity!');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($existingCoil && $existingCoil->rework_status == 1 && $total > $orderQty) {
|
||||
$fail("Rework received quantity should not exceed exist order quantity! Already Exist Total Received Qty = '{$alreadyReceived}'.");
|
||||
}
|
||||
} else {
|
||||
if ($coilNo > 1) {
|
||||
$prevCoilNo = (string) ($coilNo - 1);
|
||||
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('coil_number', $prevCoilNo)
|
||||
->first();
|
||||
|
||||
if (! $existPrevCoil) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$existingCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('line_id', $lineId)
|
||||
->where('coil_number', $coilNo)
|
||||
->first();
|
||||
|
||||
if (! $existingCoil) {
|
||||
return;
|
||||
}
|
||||
|
||||
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('item_id', $itemId)
|
||||
->where('coil_number', $coilNo)
|
||||
->first();
|
||||
|
||||
if ($existPrevCoil && $existPrevCoil->received_quantity < $value) {
|
||||
$fail('Rework received quantity should not exceed exist received quantity!');
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($coilNo && Str::contains($coilNo, '.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$existing = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('coil_number', $coilNo)
|
||||
->first();
|
||||
if ($existing) {
|
||||
if ($existing->received_quantity < $value) {
|
||||
$fail('Received quantity should not exceed exist received quantity!'); // Exist Received Qty = '{$existing->received_quantity}'.
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($coilNo > 1) {
|
||||
$prevCoilNo = (string) ($coilNo - 1);
|
||||
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('coil_number', $prevCoilNo)
|
||||
->first();
|
||||
|
||||
if (! $existPrevCoil) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ($total > $orderQty) {
|
||||
$fail("Received quantity should not exceed exist order quantity! Already Exist Total Received Qty = '{$alreadyReceived}'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
})
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
$set('scrap_quantity', '0');
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
@@ -387,7 +570,7 @@ class ProcessOrderResource extends Resource
|
||||
->label('Scrap Quantity')
|
||||
->default('0.000')
|
||||
->required()
|
||||
->readOnly(fn ($get) => ($get('rework_status') == 0 || $get('process_order') == null))
|
||||
->readOnly(fn ($get) => ($get('rework_status') == 0 || trim($get('process_order')) == null || trim($get('process_order')) == ''))
|
||||
->reactive()
|
||||
->numeric()
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
@@ -414,7 +597,7 @@ class ProcessOrderResource extends Resource
|
||||
Forms\Components\TextInput::make('sfg_number')
|
||||
->label('SFG Number')
|
||||
->reactive()
|
||||
->readOnly(fn ($get) => ($get('process_order') == null))
|
||||
->readOnly(fn ($get) => (trim($get('process_order')) == null || trim($get('process_order')) == ''))
|
||||
->afterStateUpdated(function ($state, $set, callable $get, $livewire) {
|
||||
$plantId = $get('plant_id');
|
||||
$sfgNo = $get('sfg_number');
|
||||
@@ -448,7 +631,8 @@ class ProcessOrderResource extends Resource
|
||||
Forms\Components\TextInput::make('machine_name')
|
||||
->label('Machine Name')
|
||||
->reactive()
|
||||
->readOnly(fn ($get) => ($get('process_order') == null))
|
||||
->maxLength(18)
|
||||
->readOnly(fn ($get) => (trim($get('process_order')) == null || trim($get('process_order')) == ''))
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
@@ -576,7 +760,7 @@ class ProcessOrderResource extends Resource
|
||||
}
|
||||
|
||||
// Get the value of process_order field
|
||||
$processOrder = $get('process_order');
|
||||
$processOrder = trim($get('process_order'));
|
||||
|
||||
if ($batchId != $processOrder) {
|
||||
Notification::make()
|
||||
@@ -621,7 +805,7 @@ class ProcessOrderResource extends Resource
|
||||
return Filament::auth()->user()->can('view process order packing slip');
|
||||
})
|
||||
->action(function ($get, callable $set) {
|
||||
$equipmentNumber = $get('process_order');
|
||||
$equipmentNumber = trim($get('process_order'));
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
|
||||
if (! $equipmentNumber) {
|
||||
@@ -720,6 +904,11 @@ class ProcessOrderResource extends Resource
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('updated_order_quantity')
|
||||
->label('Updated Order Quantity')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('received_quantity')
|
||||
->label('Received Quantity')
|
||||
->alignCenter()
|
||||
@@ -1064,7 +1253,7 @@ class ProcessOrderResource extends Resource
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('plant');
|
||||
$itemId = $get('Item');
|
||||
$processOrder = $get('process_order');
|
||||
$processOrder = trim($get('process_order'));
|
||||
|
||||
if (empty($plantId) || empty($itemId) || empty($processOrder)) {
|
||||
return [];
|
||||
@@ -1081,7 +1270,7 @@ class ProcessOrderResource extends Resource
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
$plantId = $get('plant');
|
||||
$itemId = $get('Item');
|
||||
$processOrder = $get('process_order');
|
||||
$processOrder = trim($get('process_order'));
|
||||
|
||||
if (! $plantId || ! $itemId || ! $processOrder || ! $state) {
|
||||
$set('received_quantity', null);
|
||||
|
||||
@@ -3,10 +3,28 @@
|
||||
namespace App\Filament\Resources\ProcessOrderResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ProcessOrderResource;
|
||||
use App\Models\ProcessOrder;
|
||||
use Filament\Actions;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateProcessOrder extends CreateRecord
|
||||
{
|
||||
protected static string $resource = ProcessOrderResource::class;
|
||||
|
||||
protected function afterCreate(): void
|
||||
{
|
||||
$plantId = $this->data['plant_id'];
|
||||
$processOrder = $this->data['process_order'];
|
||||
$updatedQty = (float) $this->data['updated_order_quantity'];
|
||||
|
||||
ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->update([
|
||||
'updated_order_quantity' => $updatedQty,
|
||||
'updated_by' => Filament::auth()->user()->name,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,13 +3,78 @@
|
||||
namespace App\Filament\Resources\ProcessOrderResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ProcessOrderResource;
|
||||
use App\Models\ProcessOrder;
|
||||
use Filament\Actions;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditProcessOrder extends EditRecord
|
||||
{
|
||||
protected static string $resource = ProcessOrderResource::class;
|
||||
|
||||
protected function beforeSave(): void
|
||||
{
|
||||
$plantId = $this->data['plant_id'] ?? null;
|
||||
$processOrder = $this->data['process_order'] ?? null;
|
||||
$extraQty = (float) ($this->data['updated_order_quantity'] ?? 0);
|
||||
$extraQtyRaw = $this->data['updated_order_quantity'] ?? '';
|
||||
|
||||
if (!preg_match('/^\d+(\.\d{1,3})?$/', $extraQtyRaw)) {
|
||||
Notification::make()
|
||||
->title('Invalid Quantity')
|
||||
->body('Only positive numbers with up to 3 decimal places are allowed.')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
$this->halt(); // stop save
|
||||
}
|
||||
|
||||
if ($extraQty < 0)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Invalid Quantity')
|
||||
->body('Negative values are not allowed.')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
$this->halt();
|
||||
}
|
||||
|
||||
if ($extraQty > 0) {
|
||||
|
||||
$order = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->first();
|
||||
|
||||
if ($order) {
|
||||
|
||||
$baseQty = (float) $order->order_quantity;
|
||||
$maxAllowed = $baseQty * 0.10;
|
||||
|
||||
$maxFinalQty = $baseQty + $maxAllowed;
|
||||
|
||||
if ($extraQty > $maxFinalQty) {
|
||||
Notification::make()
|
||||
->title('Limit Exceeded')
|
||||
->body("You can only increase the order by 10% (Max allowed: {$maxFinalQty}).")
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
$this->halt(); // stops save
|
||||
}
|
||||
|
||||
ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->update([
|
||||
'updated_order_quantity' => $extraQty,
|
||||
'updated_by' => Filament::auth()->user()?->name,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -5,28 +5,26 @@ namespace App\Filament\Resources;
|
||||
use App\Filament\Exports\StockDataMasterExporter;
|
||||
use App\Filament\Imports\StockDataMasterImporter;
|
||||
use App\Filament\Resources\StockDataMasterResource\Pages;
|
||||
use App\Filament\Resources\StockDataMasterResource\RelationManagers;
|
||||
use App\Models\Item;
|
||||
use App\Models\Plant;
|
||||
use App\Models\SerialValidation;
|
||||
use App\Models\StickerMaster;
|
||||
use App\Models\StockDataMaster;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Radio;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Radio;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class StockDataMasterResource extends Resource
|
||||
{
|
||||
@@ -51,15 +49,15 @@ class StockDataMasterResource extends Resource
|
||||
->required()
|
||||
->searchable()
|
||||
->options(function ($get) {
|
||||
if (!$get('plant_id')) {
|
||||
if (! $get('plant_id')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return StickerMaster::with('item')
|
||||
->where('plant_id', $get('plant_id'))
|
||||
->get()
|
||||
->pluck('item.code', 'id')
|
||||
->toArray();
|
||||
return StickerMaster::with('item')
|
||||
->where('plant_id', $get('plant_id'))
|
||||
->get()
|
||||
->pluck('item.code', 'id')
|
||||
->toArray();
|
||||
}),
|
||||
Forms\Components\TextInput::make('location')
|
||||
->label('Location'),
|
||||
@@ -77,7 +75,7 @@ class StockDataMasterResource extends Resource
|
||||
->label('Type')
|
||||
->options([
|
||||
'0' => 'FG',
|
||||
'1' => 'SFG',
|
||||
'1' => 'NON-FG',
|
||||
]),
|
||||
Forms\Components\TextInput::make('motor_scanned_status')
|
||||
->label('Motor Scanned Status'),
|
||||
@@ -135,7 +133,7 @@ class StockDataMasterResource extends Resource
|
||||
->searchable()
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
'0' => 'FG',
|
||||
'1' => 'SFG',
|
||||
'1' => 'NON-FG',
|
||||
default => '-',
|
||||
})
|
||||
->sortable(),
|
||||
@@ -258,27 +256,27 @@ class StockDataMasterResource extends Resource
|
||||
|
||||
return $scanned + $duplicate + $notInStock;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('stock_difference')
|
||||
->label('Stock Difference Count')
|
||||
->alignCenter()
|
||||
->getStateUsing(function ($record) {
|
||||
Tables\Columns\TextColumn::make('stock_difference')
|
||||
->label('Stock Difference Count')
|
||||
->alignCenter()
|
||||
->getStateUsing(function ($record) {
|
||||
|
||||
$duplicate = \App\Models\DuplicateStock::where('stock_data_master_id', $record->id)->count();
|
||||
$duplicate = \App\Models\DuplicateStock::where('stock_data_master_id', $record->id)->count();
|
||||
|
||||
$notInStock = \App\Models\NotInStock::where('serial_number', $record->serial_number)
|
||||
->where('plant_id', $record->plant_id)
|
||||
->count();
|
||||
$notInStock = \App\Models\NotInStock::where('serial_number', $record->serial_number)
|
||||
->where('plant_id', $record->plant_id)
|
||||
->count();
|
||||
|
||||
$scanned = (int) $record->scanned_quantity;
|
||||
$scanned = (int) $record->scanned_quantity;
|
||||
|
||||
$physicalStock = $scanned + $duplicate + $notInStock;
|
||||
$physicalStock = $scanned + $duplicate + $notInStock;
|
||||
|
||||
$systemStock = (int) $record->quantity;
|
||||
$systemStock = (int) $record->quantity;
|
||||
|
||||
$difference = $physicalStock - $systemStock;
|
||||
$difference = $physicalStock - $systemStock;
|
||||
|
||||
return max($difference, 0); // prevents negative values
|
||||
}),
|
||||
return max($difference, 0); // prevents negative values
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->label('Created At')
|
||||
->alignCenter()
|
||||
@@ -304,12 +302,13 @@ class StockDataMasterResource extends Resource
|
||||
->label('Advanced Filters')
|
||||
->form([
|
||||
Radio::make('type')
|
||||
->label('Type')
|
||||
->label('Stock Type')
|
||||
->options([
|
||||
'0' => 'FG',
|
||||
'1' => 'SFG',
|
||||
'1' => 'NON-FG',
|
||||
])
|
||||
->inline()
|
||||
->default('0')
|
||||
->nullable(),
|
||||
Select::make('Plant')
|
||||
->label('Select Plant')
|
||||
@@ -328,7 +327,7 @@ class StockDataMasterResource extends Resource
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||
$set('sticker_master_id', null);
|
||||
$set('operator_id', null);
|
||||
$set('updated_by', null);
|
||||
}),
|
||||
TextInput::make('location')
|
||||
->label('Location')
|
||||
@@ -345,6 +344,7 @@ class StockDataMasterResource extends Resource
|
||||
if (empty($pId)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Item::whereHas('stickerMasters', function ($query) use ($pId) {
|
||||
if ($pId) {
|
||||
$query->where('plant_id', $pId);
|
||||
@@ -388,7 +388,7 @@ class StockDataMasterResource extends Resource
|
||||
->native(false),
|
||||
])
|
||||
->query(function ($query, array $data) {
|
||||
if (!isset($data['type']) && (empty($data['Plant']) && empty($data['invoice_number']) && empty($data['serial_number']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['operator_id']) && empty($data['scanned_status']) && empty($data['sticker_master_id']))) {
|
||||
if (! isset($data['type']) && (empty($data['Plant']) && empty($data['location']) && empty($data['serial_number']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['scanned_status']) && empty($data['sticker_master_id']))) {
|
||||
|
||||
if (empty($data['type'])) {
|
||||
Notification::make()
|
||||
@@ -396,43 +396,63 @@ class StockDataMasterResource extends Resource
|
||||
->danger()
|
||||
->send();
|
||||
}
|
||||
|
||||
return $query->whereRaw('1 = 0');
|
||||
}
|
||||
|
||||
if ($data['type'] == '0') {
|
||||
if ($data['type'] != '') {
|
||||
|
||||
$query->where('type', '0');
|
||||
if ($data['type'] == '0') {
|
||||
|
||||
if (!empty($data['scanned_status'])) {
|
||||
$query->where('type', '0');
|
||||
|
||||
if ($data['scanned_status'] == 'Scanned') {
|
||||
$query->whereNotNull('scanned_status')
|
||||
->where('scanned_status', '!=', '');
|
||||
} elseif ($data['scanned_status'] == 'Pending') {
|
||||
if (! empty($data['scanned_status'])) {
|
||||
|
||||
$query->where(function ($query) {
|
||||
$query->whereNull('scanned_status')
|
||||
->orWhere('scanned_status', '!=', 'Scanned');
|
||||
});
|
||||
if ($data['scanned_status'] == 'Scanned') {
|
||||
$query->whereNotNull('scanned_status')
|
||||
->where('scanned_status', '!=', '');
|
||||
} elseif ($data['scanned_status'] == 'Pending') {
|
||||
|
||||
$query->where(function ($query) {
|
||||
$query->whereNull('scanned_status')
|
||||
->orWhere('scanned_status', '!=', 'Scanned');
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
} elseif ($data['type'] == '1') {
|
||||
$query->where('type', '1')
|
||||
->whereNotNull('quantity');
|
||||
|
||||
if ($data['scanned_status']) {
|
||||
|
||||
if ($data['scanned_status'] == 'Scanned') {
|
||||
|
||||
$query->whereNotNull('scanned_status')
|
||||
->where('scanned_status', '!=', '');
|
||||
|
||||
} elseif ($data['scanned_status'] == 'Pending') {
|
||||
|
||||
$query->where(function ($q) {
|
||||
$q->whereNull('scanned_status')
|
||||
->orWhere('scanned_status', '!=', 'Scanned');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($data['type'] == '1') {
|
||||
$query->where('type', '1')
|
||||
->whereNotNull('quantity');
|
||||
|
||||
} else {
|
||||
if ($data['scanned_status']) {
|
||||
|
||||
if ($data['scanned_status'] == 'Scanned') {
|
||||
|
||||
$query->whereNotNull('scanned_status')
|
||||
$query->whereNotNull('scanned_status')
|
||||
->where('scanned_status', '!=', '');
|
||||
|
||||
} elseif ($data['scanned_status'] == 'Pending') {
|
||||
|
||||
$query->where(function ($q) {
|
||||
$q->whereNull('scanned_status')
|
||||
->orWhere('scanned_status', '!=', 'Scanned');
|
||||
->orWhere('scanned_status', '!=', 'Scanned');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -627,7 +627,7 @@ class PdfController extends Controller
|
||||
// 'coil_number' => $proOrdAgPlant->coil_number ?? "",
|
||||
// 'order_quantity' => (string)$proOrdAgPlant->order_quantity ?? "",
|
||||
'coil_number' => $currentCoil,
|
||||
'order_quantity' => (string) $lastRecord->order_quantity ?? '0.000',
|
||||
'order_quantity' => (string) $lastRecord->updated_order_quantity ?? '0.000',
|
||||
'ok_quantity' => (string) $okQty ?? '0',
|
||||
'not_ok_quantity' => (string) $notOkQty ?? '0',
|
||||
'received_quantity' => (string) (($totalReceivedQty == 0) ? '0.000' : $totalReceivedQty) ?? '0.000',
|
||||
@@ -686,7 +686,7 @@ class PdfController extends Controller
|
||||
$itemCode = $data['item_code'] ?? '';
|
||||
$lineName = $data['line_name'] ?? '';
|
||||
$coilNo = $data['coil_number'] ?? '';
|
||||
$orderQty = $data['order_quantity'] ?? 0;
|
||||
$updatedOrderQty = $data['order_quantity'] ?? 0;
|
||||
$receivedQty = $data['received_quantity'] ?? 0;
|
||||
$scrapQty = $data['scrap_quantity'] ?? 0;
|
||||
$sfgNo = $data['sfg_number'] ?? '';
|
||||
@@ -728,6 +728,17 @@ class PdfController extends Controller
|
||||
], 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();
|
||||
|
||||
if (! $line) {
|
||||
@@ -861,7 +872,8 @@ class PdfController extends Controller
|
||||
->where('item_id', $itemId)
|
||||
->sum('received_quantity');
|
||||
|
||||
if ($orderQty == 0) {
|
||||
$orderQty = 0;
|
||||
if ($updatedOrderQty == 0) {
|
||||
$orderExist = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('item_id', $itemId)->latest()->first();
|
||||
@@ -869,6 +881,7 @@ class PdfController extends Controller
|
||||
|
||||
if ($orderExist) {
|
||||
$orderQty = $orderExist->order_quantity ?? 0;
|
||||
$updatedOrderQty = $orderExist->updated_order_quantity ?? 0;
|
||||
} else {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
@@ -882,9 +895,11 @@ class PdfController extends Controller
|
||||
// ->value('order_quantity') ?? 0;
|
||||
|
||||
if ($orderExist) {
|
||||
$existOrderQty = $orderExist->order_quantity ?? 0;
|
||||
// $existOrderQty = $orderExist->updated_order_quantity ?? 0;
|
||||
$orderQty = $orderExist->order_quantity ?? 0;
|
||||
$existUpdatedOrdQuan = $orderExist->updated_order_quantity ?? 0;
|
||||
|
||||
if ($existOrderQty != $orderQty) {
|
||||
if ($existUpdatedOrdQuan != $updatedOrderQty) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Order quantity doesn't equal to exist process order '{$processOrder}'",
|
||||
@@ -895,20 +910,6 @@ class PdfController extends Controller
|
||||
|
||||
$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') {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
@@ -949,6 +950,13 @@ class PdfController extends Controller
|
||||
], 404);
|
||||
}
|
||||
|
||||
if ($total > $updatedOrderQty) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Rework received quantity should not exceed exist order quantity! Exist Order Qty = '{$updatedOrderQty}', Already Exist Total Received Qty = '{$alreadyReceived}', Trying to Insert Rework Received Qty = '{$receivedQty}'",
|
||||
], 404);
|
||||
}
|
||||
|
||||
$existingCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('line_id', $lineNamePlantId)
|
||||
@@ -964,6 +972,7 @@ class PdfController extends Controller
|
||||
'item_id' => $itemId,
|
||||
'coil_number' => $coilNo,
|
||||
'order_quantity' => $orderQty,
|
||||
'updated_order_quantity' => $updatedOrderQty,
|
||||
'received_quantity' => $receivedQty,
|
||||
'scrap_quantity' => $scrapQty,
|
||||
'sfg_number' => $sfgNo,
|
||||
@@ -994,7 +1003,7 @@ class PdfController extends Controller
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
if ($coilNo >= 1) {
|
||||
if ($coilNo > 1) {
|
||||
$prevCoilNo = (string) ($coilNo - 1);
|
||||
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
@@ -1004,7 +1013,7 @@ class PdfController extends Controller
|
||||
if (! $existPrevCoil) {
|
||||
return response()->json([
|
||||
'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);
|
||||
}
|
||||
}
|
||||
@@ -1022,6 +1031,19 @@ class PdfController extends Controller
|
||||
], 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 Rework Received Qty = '{$receivedQty}'",
|
||||
], 404);
|
||||
}
|
||||
|
||||
$updated = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
->where('line_id', $lineNamePlantId)
|
||||
@@ -1070,7 +1092,7 @@ class PdfController extends Controller
|
||||
], 404);
|
||||
}
|
||||
|
||||
if ($coilNo >= 1) {
|
||||
if ($coilNo > 1) {
|
||||
$prevCoilNo = (string) ($coilNo - 1);
|
||||
$existPrevCoil = ProcessOrder::where('plant_id', $plantId)
|
||||
->where('process_order', $processOrder)
|
||||
@@ -1080,11 +1102,18 @@ class PdfController extends Controller
|
||||
if (! $existPrevCoil) {
|
||||
return response()->json([
|
||||
'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);
|
||||
}
|
||||
}
|
||||
|
||||
if ($total > $updatedOrderQty) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Received quantity should not exceed exist order quantity! Exist Order Qty = '{$updatedOrderQty}', Already Exist Total Received Qty = '{$alreadyReceived}', Trying to Insert Received Qty = '{$receivedQty}'",
|
||||
], 404);
|
||||
}
|
||||
|
||||
ProcessOrder::Create(
|
||||
[
|
||||
'plant_id' => $plantId,
|
||||
@@ -1093,6 +1122,7 @@ class PdfController extends Controller
|
||||
'item_id' => $itemId,
|
||||
'coil_number' => $coilNo,
|
||||
'order_quantity' => $orderQty,
|
||||
'updated_order_quantity' => $updatedOrderQty,
|
||||
'received_quantity' => $receivedQty,
|
||||
'scrap_quantity' => $scrapQty,
|
||||
'sfg_number' => $sfgNo,
|
||||
|
||||
@@ -30,7 +30,7 @@ class UserController extends Controller
|
||||
* Display the specified resource.
|
||||
*/
|
||||
// show(string $id)
|
||||
public function get_testing_data(Request $request)
|
||||
public function get_user_data(Request $request)
|
||||
{
|
||||
$expectedUser = env('API_AUTH_USER');
|
||||
$expectedPw = env('API_AUTH_PW');
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\DuplicateStock;
|
||||
use App\Models\Item;
|
||||
use App\Models\NotInStock;
|
||||
use App\Models\StickerMaster;
|
||||
@@ -65,7 +66,8 @@ class StockDataTable extends Component
|
||||
'refreshSfgNonData' => 'loadSfgNonQuanData',
|
||||
'confirmStockUpdate',
|
||||
'confirmSerialUpdate',
|
||||
'confirmSerialFGUpdate'
|
||||
'confirmSerialFGUpdate',
|
||||
'confirmDuplicateUpdate'
|
||||
];
|
||||
|
||||
public $capacitorInput = '';
|
||||
@@ -170,12 +172,50 @@ class StockDataTable extends Component
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmSerialFGUpdate($plantId, $location, $bin, $sNo, $stickerMasterId)
|
||||
public function confirmDuplicateUpdate($plantId, $location, $bin, $serial_number, $stickerMasterId, $batch, $docNo, $quantity)
|
||||
{
|
||||
$sNo = $serial_number;
|
||||
$stockRecord = StockDataMaster::where('serial_number', $sNo)
|
||||
->where('plant_id', $plantId)
|
||||
->first();
|
||||
|
||||
if (!$stockRecord) {
|
||||
return;
|
||||
}
|
||||
|
||||
$record = DuplicateStock::where('stock_data_master_id', $stockRecord->id)->first();
|
||||
|
||||
if (!$record) {
|
||||
|
||||
DuplicateStock::create([
|
||||
'stock_data_master_id' => $stockRecord->id,
|
||||
]);
|
||||
|
||||
Notification::make()
|
||||
->title('Record inserted successfully in duplicate stock table.')
|
||||
->success()
|
||||
->send();
|
||||
|
||||
} else {
|
||||
|
||||
DuplicateStock::create([
|
||||
'stock_data_master_id' => $stockRecord->id,
|
||||
]);
|
||||
|
||||
Notification::make()
|
||||
->title('Record inserted successfully in duplicate stock table.')
|
||||
->success()
|
||||
->send();
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmSerialFGUpdate($plantId, $location, $bin, $serial_number, $stickerMasterId)
|
||||
{
|
||||
$sNo = $serial_number;
|
||||
$record = NotInStock::where('plant_id', $plantId)
|
||||
->where('location', $location)
|
||||
->where('sticker_master_id', $stickerMasterId)
|
||||
->where('serial_number', $sNo)
|
||||
->where('bin', $bin)
|
||||
->first();
|
||||
|
||||
@@ -186,7 +226,7 @@ class StockDataTable extends Component
|
||||
'location' => $location,
|
||||
'bin' => $bin,
|
||||
'sticker_master_id' => $stickerMasterId,
|
||||
'type' => '1',
|
||||
'type' => '0',
|
||||
'serial_number' => $sNo ?? null,
|
||||
'batch' => $batch ?? null,
|
||||
'doc_no' => $docNo ?? null,
|
||||
|
||||
@@ -64,6 +64,11 @@ class Item extends Model
|
||||
return $this->hasMany(CharacteristicValue::class);
|
||||
}
|
||||
|
||||
public function ClassCharacteristics()
|
||||
{
|
||||
return $this->hasMany(ClassCharacteristic::class, 'item_id', 'id');
|
||||
}
|
||||
|
||||
public function weightValidations()
|
||||
{
|
||||
return $this->hasMany(WeightValidation::class);
|
||||
|
||||
@@ -43,6 +43,11 @@ class Machine extends Model
|
||||
return $this->hasMany(CharacteristicValue::class);
|
||||
}
|
||||
|
||||
public function ClassCharacteristics()
|
||||
{
|
||||
return $this->hasMany(ClassCharacteristic::class, 'machine_id', 'id');
|
||||
}
|
||||
|
||||
public function testingPanelReadings()
|
||||
{
|
||||
return $this->hasMany(TestingPanelReading::class);
|
||||
|
||||
@@ -113,6 +113,11 @@ class Plant extends Model
|
||||
return $this->hasMany(EquipmentMaster::class, 'plant_id', 'id');
|
||||
}
|
||||
|
||||
public function ClassCharacteristics()
|
||||
{
|
||||
return $this->hasMany(ClassCharacteristic::class, 'plant_id', 'id');
|
||||
}
|
||||
|
||||
// public function rejectReasons()
|
||||
// {
|
||||
// return $this->hasMany(RejectReason::class, 'plant_id', 'id');
|
||||
|
||||
@@ -21,6 +21,7 @@ class ProcessOrder extends Model
|
||||
'coil_number',
|
||||
'order_quantity',
|
||||
'received_quantity',
|
||||
'updated_order_quantity',
|
||||
'sfg_number',
|
||||
'machine_name',
|
||||
'scrap_quantity',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
@@ -11,7 +10,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
$sql = <<<'SQL'
|
||||
CREATE TABLE device_masters (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
plant_id BIGINT NOT NULL,
|
||||
|
||||
@@ -142,7 +142,7 @@ return new class extends Migration
|
||||
zmm_type TEXT DEFAULT NULL,
|
||||
zmm_usp TEXT DEFAULT NULL,
|
||||
mark_status TEXT DEFAULT NULL,
|
||||
marked_datetime TIMESTAMP DEFAULT NULL,
|
||||
marked_datetime TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
marked_physical_count TEXT DEFAULT '0',
|
||||
marked_expected_time TEXT DEFAULT '0',
|
||||
marked_by TEXT DEFAULT NULL,
|
||||
@@ -178,6 +178,7 @@ return new class extends Migration
|
||||
updated_by TEXT DEFAULT NULL,
|
||||
deleted_at TIMESTAMP,
|
||||
|
||||
UNIQUE (gernr, plant_id),
|
||||
FOREIGN KEY (plant_id) REFERENCES plants (id),
|
||||
FOREIGN KEY (machine_id) REFERENCES machines (id),
|
||||
FOREIGN KEY (item_id) REFERENCES items (id)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql1 = <<<'SQL'
|
||||
ALTER TABLE process_orders
|
||||
ADD COLUMN updated_order_quantity NUMERIC(10,3) NULL
|
||||
SQL;
|
||||
|
||||
DB::statement($sql1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Schema::table('process_orders', function (Blueprint $table) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
126
resources/views/filament/pages/dashboard.blade.php
Normal file
126
resources/views/filament/pages/dashboard.blade.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<x-filament-panels::page>
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="mb-8">
|
||||
<h1 class="text-4xl font-bold tracking-tight">
|
||||
CRI Digital Manufacturing IIoT Platform
|
||||
</h1>
|
||||
<p class="text-lg text-gray-600 mt-2">
|
||||
Complete visibility, traceability, and control across your manufacturing operations.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- BANNER -->
|
||||
{{-- <div class="w-full overflow-hidden rounded-2xl shadow mb-10"> --}}
|
||||
<div class="w-full overflow-hidden rounded-xl shadow">
|
||||
<img
|
||||
src="{{ asset('images/iiot-banner.jpg') }}"
|
||||
alt="CRI Digital Manufacturing IIoT"
|
||||
class="w-full h-72 object-cover"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- INTRO -->
|
||||
<div class="max-w-4xl mb-10">
|
||||
<p class="text-lg text-gray-700 mb-4">
|
||||
CRI Digital Manufacturing IIoT is built to deliver
|
||||
<strong>end-to-end traceability, real-time insights, and operational transparency</strong>
|
||||
across plants, lines, and production processes.
|
||||
</p>
|
||||
|
||||
<p class="text-lg text-gray-700">
|
||||
The platform ensures <strong>right quality and on-time delivery</strong> by enabling
|
||||
complete tracking of materials, production orders, and finished goods—helping teams
|
||||
make faster, data-driven decisions with confidence.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- KEY PILLARS -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-10">
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">🔍 Traceability</h3>
|
||||
<p class="text-gray-600">
|
||||
Track materials, batches, and serials from input to dispatch.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">✅ Quality Assurance</h3>
|
||||
<p class="text-gray-600">
|
||||
Validate process data and ensure first-time-right production.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">⏱ On-Time Delivery</h3>
|
||||
<p class="text-gray-600">
|
||||
Identify delays early and meet production commitments.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">📊 Real-Time Insights</h3>
|
||||
<p class="text-gray-600">
|
||||
Monitor performance and take quick corrective actions.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SUPPORT -->
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h2 class="text-2xl font-semibold mb-3">24×7 Support</h2>
|
||||
<p class="text-gray-700 mb-2">
|
||||
Our dedicated IIoT support team is available round-the-clock to ensure
|
||||
uninterrupted operations and quick issue resolution.
|
||||
</p>
|
||||
<p class="text-lg font-medium text-gray-900">
|
||||
📞 Support Landline: <span class="font-semibold">0422 711 7179</span>
|
||||
</p>
|
||||
{{-- <p class="text-lg font-medium text-gray-900">
|
||||
📞 Technical Support Contact: <span class="font-semibold">9952468104 / 9100832269</span>
|
||||
</p> --}}
|
||||
</div>
|
||||
|
||||
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h2 class="text-2xl font-semibold mb-4">24×7 Support</h2>
|
||||
|
||||
<p class="text-lg text-gray-700 mb-4">
|
||||
Our support structure is designed to ensure quick resolution based on the type
|
||||
of issue — whether it is on-site, application-related, or infrastructure-related.
|
||||
</p>
|
||||
|
||||
<div class="space-y-3">
|
||||
|
||||
<p class="text-lg font-medium text-gray-900">
|
||||
🏭 <strong>Plant & On-Site Support</strong> <br>
|
||||
<span class="text-gray-700">
|
||||
For plant visits, industry-level issues, and on-ground validation
|
||||
</span><br>
|
||||
📞 <span class="font-semibold">8925899458 / 8925899459</span>
|
||||
</p>
|
||||
|
||||
<p class="text-lg font-medium text-gray-900">
|
||||
💻 <strong>Application & Logic Support</strong> <br>
|
||||
<span class="text-gray-700">
|
||||
For website errors, logic issues, and application-level problems
|
||||
</span><br>
|
||||
📞 <span class="font-semibold">9952468104 / 9100832269</span>
|
||||
</p>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
|
||||
<!-- TEAM -->
|
||||
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h2 class="text-2xl font-semibold mb-4">IIOT Team Members</h2>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 text-gray-700">
|
||||
<div class="flex items-center gap-2">👤 Jothikumar</div>
|
||||
<div class="flex items-center gap-2">👤 Jeithef Shibu</div>
|
||||
<div class="flex items-center gap-2">👤 Dhanabalan</div>
|
||||
<div class="flex items-center gap-2">👤 Ranjith</div>
|
||||
<div class="flex items-center gap-2">👤 Srimathy</div>
|
||||
<div class="flex items-center gap-2">👤 Gokul</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
</x-filament-panels::page>
|
||||
@@ -1,126 +1,13 @@
|
||||
<x-filament-panels::page>
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="mb-8">
|
||||
<h1 class="text-4xl font-bold tracking-tight">
|
||||
CRI Digital Manufacturing IIoT Platform
|
||||
</h1>
|
||||
<p class="text-lg text-gray-600 mt-2">
|
||||
Complete visibility, traceability, and control across your manufacturing operations.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- BANNER -->
|
||||
{{-- <div class="w-full overflow-hidden rounded-2xl shadow mb-10"> --}}
|
||||
<div class="w-full overflow-hidden rounded-xl shadow">
|
||||
<img
|
||||
src="{{ asset('images/iiot-banner.jpg') }}"
|
||||
alt="CRI Digital Manufacturing IIoT"
|
||||
class="w-full h-72 object-cover"
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- INTRO -->
|
||||
<div class="max-w-4xl mb-10">
|
||||
<p class="text-lg text-gray-700 mb-4">
|
||||
CRI Digital Manufacturing IIoT is built to deliver
|
||||
<strong>end-to-end traceability, real-time insights, and operational transparency</strong>
|
||||
across plants, lines, and production processes.
|
||||
</p>
|
||||
|
||||
<p class="text-lg text-gray-700">
|
||||
The platform ensures <strong>right quality and on-time delivery</strong> by enabling
|
||||
complete tracking of materials, production orders, and finished goods—helping teams
|
||||
make faster, data-driven decisions with confidence.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- KEY PILLARS -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-10">
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">🔍 Traceability</h3>
|
||||
<p class="text-gray-600">
|
||||
Track materials, batches, and serials from input to dispatch.
|
||||
</p>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2 sm:gap-4 md:gap-4 p-2 md:p-4 items-start">
|
||||
{{-- Filters form --}}
|
||||
<div class="space-y-4 w-full max-w-full col-span-1">
|
||||
{{ $this->filtersForm($this->form) }}
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">✅ Quality Assurance</h3>
|
||||
<p class="text-gray-600">
|
||||
Validate process data and ensure first-time-right production.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">⏱ On-Time Delivery</h3>
|
||||
<p class="text-gray-600">
|
||||
Identify delays early and meet production commitments.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h3 class="text-lg font-semibold mb-2">📊 Real-Time Insights</h3>
|
||||
<p class="text-gray-600">
|
||||
Monitor performance and take quick corrective actions.
|
||||
</p>
|
||||
{{-- Stat widget --}}
|
||||
<div class="w-full max-w-full col-span-1 sm:col-span-1 lg:col-span-2">
|
||||
@livewire(\App\Filament\Widgets\CumulativeChart::class)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SUPPORT -->
|
||||
<div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h2 class="text-2xl font-semibold mb-3">24×7 Support</h2>
|
||||
<p class="text-gray-700 mb-2">
|
||||
Our dedicated IIoT support team is available round-the-clock to ensure
|
||||
uninterrupted operations and quick issue resolution.
|
||||
</p>
|
||||
<p class="text-lg font-medium text-gray-900">
|
||||
📞 Support Landline: <span class="font-semibold">0422 711 7179</span>
|
||||
</p>
|
||||
{{-- <p class="text-lg font-medium text-gray-900">
|
||||
📞 Technical Support Contact: <span class="font-semibold">9952468104 / 9100832269</span>
|
||||
</p> --}}
|
||||
</div>
|
||||
|
||||
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h2 class="text-2xl font-semibold mb-4">24×7 Support</h2>
|
||||
|
||||
<p class="text-lg text-gray-700 mb-4">
|
||||
Our support structure is designed to ensure quick resolution based on the type
|
||||
of issue — whether it is on-site, application-related, or infrastructure-related.
|
||||
</p>
|
||||
|
||||
<div class="space-y-3">
|
||||
|
||||
<p class="text-lg font-medium text-gray-900">
|
||||
🏭 <strong>Plant & On-Site Support</strong> <br>
|
||||
<span class="text-gray-700">
|
||||
For plant visits, industry-level issues, and on-ground validation
|
||||
</span><br>
|
||||
📞 <span class="font-semibold">8925899458 / 8925899459</span>
|
||||
</p>
|
||||
|
||||
<p class="text-lg font-medium text-gray-900">
|
||||
💻 <strong>Application & Logic Support</strong> <br>
|
||||
<span class="text-gray-700">
|
||||
For website errors, logic issues, and application-level problems
|
||||
</span><br>
|
||||
📞 <span class="font-semibold">9952468104 / 9100832269</span>
|
||||
</p>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
|
||||
<!-- TEAM -->
|
||||
{{-- <div class="bg-white rounded-xl border p-6 shadow-sm">
|
||||
<h2 class="text-2xl font-semibold mb-4">IIOT Team Members</h2>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 text-gray-700">
|
||||
<div class="flex items-center gap-2">👤 Jothikumar</div>
|
||||
<div class="flex items-center gap-2">👤 Jeithef Shibu</div>
|
||||
<div class="flex items-center gap-2">👤 Dhanabalan</div>
|
||||
<div class="flex items-center gap-2">👤 Ranjith</div>
|
||||
<div class="flex items-center gap-2">👤 Srimathy</div>
|
||||
<div class="flex items-center gap-2">👤 Gokul</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
</x-filament-panels::page>
|
||||
|
||||
@@ -136,9 +136,13 @@ Route::post('serial-invoice/store-data', [InvoiceValidationController::class, 's
|
||||
|
||||
Route::post('material-invoice/store-data', [InvoiceValidationController::class, 'materialInvoice']);
|
||||
|
||||
// User Controller
|
||||
|
||||
Route::get('user/get-data', [UserController::class, 'get_user_data']);
|
||||
|
||||
// Testing panel Controller
|
||||
|
||||
Route::get('testing/user/get-data', [UserController::class, 'get_testing_data']);
|
||||
Route::get('testing/user/get-data', [UserController::class, 'get_user_data']);
|
||||
|
||||
Route::get('testing/item/get-master-data', [TestingPanelController::class, 'get_motor_master']);
|
||||
|
||||
@@ -170,7 +174,7 @@ Route::get('laser/characteristics/check', [CharacteristicsController::class, 'ch
|
||||
|
||||
Route::post('laser/characteristics/data', [CharacteristicsController::class, 'storeClassChar']);
|
||||
|
||||
// ..serial (auto or manual)
|
||||
// ..Marked serial (auto or manual)
|
||||
|
||||
Route::post('laser/characteristics/status', [CharacteristicsController::class, 'storeLaserStatus']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user