Compare commits
71 Commits
ranjith-de
...
renovate/t
| Author | SHA1 | Date | |
|---|---|---|---|
| f82ff3191d | |||
| 79e3427cdb | |||
| 81a5fa16c4 | |||
| 6520c3ca87 | |||
| 2e167c75b0 | |||
| aca5d6c957 | |||
| 9edbaf3d43 | |||
| a46aaa72a2 | |||
| d917aa530d | |||
| 45944c5c25 | |||
| fda672948b | |||
| f15e6451ca | |||
| c8aac9116d | |||
| bcd107a8bc | |||
| 458e143b9a | |||
| de2dda0dc5 | |||
| 7543f8a416 | |||
| f76316ec91 | |||
| acea7b14a6 | |||
| 87f49e8491 | |||
| f612551288 | |||
| 4f84735eaf | |||
| 45b8c1fbb4 | |||
| 6015968043 | |||
| 2bc8584e7a | |||
| d126e931c8 | |||
| 62bf68ad2e | |||
| c6c63dcb35 | |||
| d1663ae58a | |||
| deb46cdda2 | |||
| 002bdc597d | |||
| a406d1b58a | |||
| 58d0b9f0ae | |||
| c0d8ca7b1e | |||
| f31ab62ec0 | |||
| 4285a31f94 | |||
| 0c9228bfec | |||
| 58b45c849d | |||
| 61a2e7ffad | |||
| 3779cf3e3b | |||
| acf955dd94 | |||
| 0de49f14ce | |||
| 0473ca33cf | |||
| 8a01033459 | |||
| 0555f9faff | |||
| 8cbbaa4845 | |||
| cb6b201648 | |||
| c3089a147c | |||
| 45f0e39f73 | |||
| fe1e1b9918 | |||
| e20915ca82 | |||
| 58e6cbfac0 | |||
| 1ace049687 | |||
| e5e85a8eea | |||
| 555802ab35 | |||
| 587b743f12 | |||
| 42555d4a81 | |||
| fd1e554076 | |||
| 022654f192 | |||
| 55f1088fda | |||
| f9233f44d8 | |||
| e0fec6b07c | |||
| 6bda9c1459 | |||
| 39bdd3df57 | |||
| 5bcf0703d9 | |||
| 80e522b7e6 | |||
| ee101f80ea | |||
| 37a99d03c1 | |||
| 5fdced003a | |||
| 0b0bb90efb | |||
| 32ce6da2c1 |
4
.github/workflows/gemini-pr-review.yaml
vendored
4
.github/workflows/gemini-pr-review.yaml
vendored
@@ -36,8 +36,8 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-npm-global-
|
${{ runner.os }}-npm-global-
|
||||||
|
|
||||||
- name: Install Gemini CLI globally
|
# - name: Install Gemini CLI globally
|
||||||
run: npm install -g --loglevel=http @google/gemini-cli
|
# run: npm install -g --loglevel=http @google/gemini-cli
|
||||||
|
|
||||||
- name: Generate git diff and review with Gemini
|
- name: Generate git diff and review with Gemini
|
||||||
id: review
|
id: review
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Exports;
|
|
||||||
|
|
||||||
use App\Models\CharacteristicValue;
|
|
||||||
use Filament\Actions\Exports\ExportColumn;
|
|
||||||
use Filament\Actions\Exports\Exporter;
|
|
||||||
use Filament\Actions\Exports\Models\Export;
|
|
||||||
|
|
||||||
class CharacteristicValueExporter extends Exporter
|
|
||||||
{
|
|
||||||
protected static ?string $model = CharacteristicValue::class;
|
|
||||||
|
|
||||||
public static function getColumns(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
ExportColumn::make('id')
|
|
||||||
->label('ID'),
|
|
||||||
ExportColumn::make('plant.name'),
|
|
||||||
ExportColumn::make('line.name'),
|
|
||||||
ExportColumn::make('item.id'),
|
|
||||||
ExportColumn::make('machine.name'),
|
|
||||||
ExportColumn::make('process_order'),
|
|
||||||
ExportColumn::make('coil_number'),
|
|
||||||
ExportColumn::make('status'),
|
|
||||||
ExportColumn::make('created_at'),
|
|
||||||
ExportColumn::make('updated_at'),
|
|
||||||
ExportColumn::make('created_by'),
|
|
||||||
ExportColumn::make('updated_by'),
|
|
||||||
ExportColumn::make('deleted_at'),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getCompletedNotificationBody(Export $export): string
|
|
||||||
{
|
|
||||||
$body = 'Your characteristic value 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.';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $body;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Imports;
|
|
||||||
|
|
||||||
use App\Models\CharacteristicValue;
|
|
||||||
use Filament\Actions\Imports\ImportColumn;
|
|
||||||
use Filament\Actions\Imports\Importer;
|
|
||||||
use Filament\Actions\Imports\Models\Import;
|
|
||||||
|
|
||||||
class CharacteristicValueImporter extends Importer
|
|
||||||
{
|
|
||||||
protected static ?string $model = CharacteristicValue::class;
|
|
||||||
|
|
||||||
public static function getColumns(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
ImportColumn::make('plant')
|
|
||||||
->requiredMapping()
|
|
||||||
->relationship()
|
|
||||||
->rules(['required']),
|
|
||||||
ImportColumn::make('line')
|
|
||||||
->requiredMapping()
|
|
||||||
->relationship()
|
|
||||||
->rules(['required']),
|
|
||||||
ImportColumn::make('item')
|
|
||||||
->requiredMapping()
|
|
||||||
->relationship()
|
|
||||||
->rules(['required']),
|
|
||||||
ImportColumn::make('machine')
|
|
||||||
->requiredMapping()
|
|
||||||
->relationship()
|
|
||||||
->rules(['required']),
|
|
||||||
ImportColumn::make('process_order'),
|
|
||||||
ImportColumn::make('coil_number'),
|
|
||||||
ImportColumn::make('status'),
|
|
||||||
ImportColumn::make('created_by'),
|
|
||||||
ImportColumn::make('updated_by'),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function resolveRecord(): ?CharacteristicValue
|
|
||||||
{
|
|
||||||
// return CharacteristicValue::firstOrNew([
|
|
||||||
// // Update existing records, matching them by `$this->data['column_name']`
|
|
||||||
// 'email' => $this->data['email'],
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
return new CharacteristicValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getCompletedNotificationBody(Import $import): string
|
|
||||||
{
|
|
||||||
$body = 'Your characteristic value 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.';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $body;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,516 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Resources;
|
|
||||||
|
|
||||||
use App\Filament\Exports\CharacteristicValueExporter;
|
|
||||||
use App\Filament\Imports\CharacteristicValueImporter;
|
|
||||||
use App\Filament\Resources\CharacteristicValueResource\Pages;
|
|
||||||
use App\Filament\Resources\CharacteristicValueResource\RelationManagers;
|
|
||||||
use App\Models\CharacteristicValue;
|
|
||||||
use App\Models\Item;
|
|
||||||
use App\Models\Line;
|
|
||||||
use App\Models\Machine;
|
|
||||||
use App\Models\Plant;
|
|
||||||
use Filament\Forms;
|
|
||||||
use Filament\Forms\Form;
|
|
||||||
use Filament\Resources\Resource;
|
|
||||||
use Filament\Tables;
|
|
||||||
use Filament\Tables\Table;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
||||||
use Filament\Facades\Filament;
|
|
||||||
use Filament\Forms\Components\DateTimePicker;
|
|
||||||
use Filament\Tables\Filters\Filter;
|
|
||||||
use Filament\Forms\Components\Select;
|
|
||||||
use Filament\Forms\Components\TextInput;
|
|
||||||
use Filament\Tables\Actions\ExportAction;
|
|
||||||
use Filament\Tables\Actions\ImportAction;
|
|
||||||
|
|
||||||
class CharacteristicValueResource extends Resource
|
|
||||||
{
|
|
||||||
protected static ?string $model = CharacteristicValue::class;
|
|
||||||
|
|
||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Process Order';
|
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
|
||||||
{
|
|
||||||
return $form
|
|
||||||
->schema([
|
|
||||||
Forms\Components\Select::make('plant_id')
|
|
||||||
->label('Plant')
|
|
||||||
->relationship('plant', 'name')
|
|
||||||
->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();
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, $set, callable $get) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
$set('item_id', null);
|
|
||||||
$set('line_id', null);
|
|
||||||
$set('machine_id', null);
|
|
||||||
if (! $plantId) {
|
|
||||||
$set('poPlantError', 'Please select a plant first.');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->extraAttributes(fn ($get) => [
|
|
||||||
'class' => $get('poPlantError') ? 'border-red-500' : '',
|
|
||||||
])
|
|
||||||
->hint(fn ($get) => $get('poPlantError') ? $get('poPlantError') : null)
|
|
||||||
->hintColor('danger')
|
|
||||||
->required(),
|
|
||||||
Forms\Components\Select::make('line_id')
|
|
||||||
->label('Line')
|
|
||||||
->options(function (callable $get) {
|
|
||||||
if (!$get('plant_id')) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Line::where('plant_id', $get('plant_id'))
|
|
||||||
->pluck('name', 'id')
|
|
||||||
->toArray();
|
|
||||||
})
|
|
||||||
->afterStateUpdated(function ($state, $set, callable $get) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
$set('item_id', null);
|
|
||||||
$set('machine_id', null);
|
|
||||||
if (! $plantId) {
|
|
||||||
$set('poPlantError', 'Please select a plant first.');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->required(),
|
|
||||||
Forms\Components\Select::make('item_id')
|
|
||||||
->label('Item')
|
|
||||||
->options(function (callable $get) {
|
|
||||||
if (!$get('plant_id') || !$get('line_id')) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Item::where('plant_id', $get('plant_id'))
|
|
||||||
->pluck('code', 'id')
|
|
||||||
->toArray();
|
|
||||||
})
|
|
||||||
->afterStateUpdated(function ($state, $set, callable $get) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
$set('machine_id', null);
|
|
||||||
if (! $plantId) {
|
|
||||||
$set('poPlantError', 'Please select a plant first.');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->required()
|
|
||||||
->searchable(),
|
|
||||||
Forms\Components\Select::make('machine_id')
|
|
||||||
->label('Machine')
|
|
||||||
->options(function (callable $get) {
|
|
||||||
if (!$get('plant_id') || !$get('line_id') || !$get('item_id')) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Machine::where('plant_id', $get('plant_id'))
|
|
||||||
->where('line_id', $get('line_id'))
|
|
||||||
->pluck('work_center', 'id')
|
|
||||||
->toArray();
|
|
||||||
})
|
|
||||||
->afterStateUpdated(function ($state, $set, callable $get) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
$set('process_order', null);
|
|
||||||
$set('coil_number', null);
|
|
||||||
$set('status', null);
|
|
||||||
if (! $plantId) {
|
|
||||||
$set('poPlantError', 'Please select a plant first.');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->required(),
|
|
||||||
Forms\Components\TextInput::make('process_order')
|
|
||||||
->label('Process Order')
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, $set, callable $get) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
$set('coil_number', null);
|
|
||||||
$set('status', null);
|
|
||||||
if (! $plantId) {
|
|
||||||
$set('poPlantError', 'Please select a plant first.');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->required(),
|
|
||||||
Forms\Components\TextInput::make('coil_number')
|
|
||||||
->label('Coil Number')
|
|
||||||
// ->reactive()
|
|
||||||
// ->afterStateUpdated(function ($state, $set, callable $get) {
|
|
||||||
// $plantId = $get('plant_id');
|
|
||||||
// $set('status', null);
|
|
||||||
// if (! $plantId) {
|
|
||||||
// $set('poPlantError', 'Please select a plant first.');
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// ->required(),
|
|
||||||
->label('Coil Number')
|
|
||||||
->default('0')
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, $set, callable $get, $livewire) {
|
|
||||||
$plantId = $get('plant_id');
|
|
||||||
$processOrder = $get('process_order');
|
|
||||||
$coilNo = $get('coil_number');
|
|
||||||
if (! $plantId) {
|
|
||||||
$set('poPlantError', 'Please select a plant first.');
|
|
||||||
} elseif (! $processOrder) {
|
|
||||||
$set('coil_number', null);
|
|
||||||
$set('poPlantError', null);
|
|
||||||
} elseif ($coilNo || $coilNo == '0') {
|
|
||||||
$existing = CharacteristicValue::where('plant_id', $plantId)
|
|
||||||
->where('process_order', $processOrder)
|
|
||||||
->where('coil_number', $coilNo)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($existing) {
|
|
||||||
$set('poPlantError', null);
|
|
||||||
$set('coil_number', null);
|
|
||||||
$set('coilNumberError', "Duplicate Coil : '{$coilNo}' found!");
|
|
||||||
} else {
|
|
||||||
$set('poPlantError', null);
|
|
||||||
$set('coilNumberError', null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
->extraAttributes(fn ($get) => [
|
|
||||||
'class' => $get('coilNumberError') ? 'border-red-500' : '',
|
|
||||||
])
|
|
||||||
->hint(fn ($get) => $get('coilNumberError') ? $get('coilNumberError') : null)
|
|
||||||
->hintColor('danger')
|
|
||||||
->required(),
|
|
||||||
Forms\Components\Select::make('status')
|
|
||||||
->label('Status')
|
|
||||||
->options([
|
|
||||||
'Ok' => 'OK',
|
|
||||||
'NotOk' => 'Not Ok'
|
|
||||||
])
|
|
||||||
->reactive()
|
|
||||||
->required(),
|
|
||||||
Forms\Components\Hidden::make('created_by')
|
|
||||||
->label('Created By')
|
|
||||||
->default(Filament::auth()->user()?->name),
|
|
||||||
Forms\Components\Hidden::make('updated_by')
|
|
||||||
->label('Updated By')
|
|
||||||
->default(Filament::auth()->user()?->name),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function table(Table $table): Table
|
|
||||||
{
|
|
||||||
return $table
|
|
||||||
->columns([
|
|
||||||
Tables\Columns\TextColumn::make('No.')
|
|
||||||
->label('No.')
|
|
||||||
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
|
||||||
$paginator = $livewire->getTableRecords();
|
|
||||||
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
|
||||||
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
|
||||||
|
|
||||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
|
||||||
}),
|
|
||||||
Tables\Columns\TextColumn::make('plant.name')
|
|
||||||
->label('Plant')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('line.name')
|
|
||||||
->label('Line')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('item.code')
|
|
||||||
->label('Item')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('machine.work_center')
|
|
||||||
->label('Machine')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('process_order')
|
|
||||||
->label('Process Order')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('coil_number')
|
|
||||||
->label('Coil Number')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('status')
|
|
||||||
->label('Status')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('created_by')
|
|
||||||
->label('Created By')
|
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
|
||||||
->label('Created At')
|
|
||||||
->alignCenter()
|
|
||||||
->dateTime()
|
|
||||||
->sortable()
|
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
|
||||||
Tables\Columns\TextColumn::make('updated_at')
|
|
||||||
->label('Updated At')
|
|
||||||
->alignCenter()
|
|
||||||
->dateTime()
|
|
||||||
->sortable()
|
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
|
||||||
Tables\Columns\TextColumn::make('deleted_at')
|
|
||||||
->label('Deleted At')
|
|
||||||
->alignCenter()
|
|
||||||
->dateTime()
|
|
||||||
->sortable()
|
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
|
||||||
])
|
|
||||||
// ->filters([
|
|
||||||
// Tables\Filters\TrashedFilter::make(),
|
|
||||||
// ])
|
|
||||||
->filters([
|
|
||||||
|
|
||||||
Tables\Filters\TrashedFilter::make(),
|
|
||||||
Filter::make('advanced_filters')
|
|
||||||
->label('Advanced Filters')
|
|
||||||
->form([
|
|
||||||
Select::make('Plant')
|
|
||||||
->label('Select Plant')
|
|
||||||
->nullable()
|
|
||||||
->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();
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$set('Item', null);
|
|
||||||
}),
|
|
||||||
Select::make('Line')
|
|
||||||
->label('Select Line')
|
|
||||||
->nullable()
|
|
||||||
->options(function (callable $get) {
|
|
||||||
$plantId = $get('Plant');
|
|
||||||
|
|
||||||
if(empty($plantId)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Line::where('plant_id', $plantId)->pluck('name', 'id');
|
|
||||||
|
|
||||||
//return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$set('Item', null);
|
|
||||||
}),
|
|
||||||
Select::make('Item')
|
|
||||||
->label('Item Code')
|
|
||||||
->nullable()
|
|
||||||
->searchable()
|
|
||||||
->options(function (callable $get) {
|
|
||||||
$plantId = $get('Plant');
|
|
||||||
|
|
||||||
if(empty($plantId)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Item::where('plant_id', $plantId)->pluck('code', 'id');
|
|
||||||
|
|
||||||
//return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$set('process_order', null);
|
|
||||||
}),
|
|
||||||
Select::make('Machine')
|
|
||||||
->label('Select Machine')
|
|
||||||
->nullable()
|
|
||||||
->options(function (callable $get) {
|
|
||||||
$plantId = $get('Plant');
|
|
||||||
$lineId = $get('Line');
|
|
||||||
|
|
||||||
if(empty($plantId) || empty($lineId)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Machine::where('plant_id', $plantId)->where('line_id', $lineId)->pluck('work_center', 'id');
|
|
||||||
|
|
||||||
//return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
|
|
||||||
})
|
|
||||||
->reactive()
|
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
|
||||||
$set('process_order', null);
|
|
||||||
}),
|
|
||||||
TextInput::make('process_order')
|
|
||||||
->label('Process Order')
|
|
||||||
->placeholder('Enter Process Order'),
|
|
||||||
TextInput::make('coil_number')
|
|
||||||
->label('Coil Number')
|
|
||||||
->placeholder(placeholder: 'Enter Coil Number'),
|
|
||||||
Select::make('status')
|
|
||||||
->label('Status')
|
|
||||||
->options([
|
|
||||||
'Ok' => 'OK',
|
|
||||||
'NotOk' => 'Not Ok'
|
|
||||||
]),
|
|
||||||
DateTimePicker::make(name: 'created_from')
|
|
||||||
->label('Created From')
|
|
||||||
->placeholder(placeholder: 'Select From DateTime')
|
|
||||||
->reactive()
|
|
||||||
->native(false),
|
|
||||||
DateTimePicker::make('created_to')
|
|
||||||
->label('Created To')
|
|
||||||
->placeholder(placeholder: 'Select To DateTime')
|
|
||||||
->reactive()
|
|
||||||
->native(false),
|
|
||||||
])
|
|
||||||
->query(function ($query, array $data) {
|
|
||||||
// Hide all records initially if no filters are applied
|
|
||||||
if (empty($data['Plant']) && empty($data['Line']) && empty($data['Item']) && empty($data['Machine']) && empty($data['process_order']) && empty($data['coil_number']) && empty($data['status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
|
||||||
return $query->whereRaw('1 = 0');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['Plant'])) {
|
|
||||||
$query->where('plant_id', $data['Plant']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['Line'])) {
|
|
||||||
$query->where('line_id', $data['Line']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['Item'])) {
|
|
||||||
$query->where('item_id', $data['Item']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['Machine'])) {
|
|
||||||
$query->where('machine_id', $data['Machine']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['process_order'])) {
|
|
||||||
$query->where('process_order', $data['process_order']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['coil_number'])) {
|
|
||||||
$query->where('coil_number', $data['coil_number']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['status'])) {
|
|
||||||
$query->where('status', $data['status']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['created_from'])) {
|
|
||||||
$query->where('created_at', '>=', $data['created_from']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['created_to'])) {
|
|
||||||
$query->where('created_at', '<=', $data['created_to']);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//$query->orderBy('created_at', 'asc');
|
|
||||||
})
|
|
||||||
->indicateUsing(function (array $data) {
|
|
||||||
$indicators = [];
|
|
||||||
|
|
||||||
if (!empty($data['Plant'])) {
|
|
||||||
$indicators[] = 'Plant: ' . Plant::where('id', $data['Plant'])->value('name');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['Line'])) {
|
|
||||||
$indicators[] = 'Line: ' . Line::where('id', $data['Line'])->value('name');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['Item'])) {
|
|
||||||
$indicators[] = 'Item: ' . Item::where('id', $data['Item'])->value('code');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['Machine'])) {
|
|
||||||
$indicators[] = 'Machine: ' . Machine::where('id', $data['Machine'])->value('work_center');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['process_order'])) {
|
|
||||||
$indicators[] = 'Process Order: ' . $data['process_order'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['coil_number'])) {
|
|
||||||
$indicators[] = 'Coil Number: ' . $data['coil_number'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['status'])) {
|
|
||||||
$indicators[] = 'Status: ' . $data['status'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['created_from'])) {
|
|
||||||
$indicators[] = 'From: ' . $data['created_from'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($data['created_to'])) {
|
|
||||||
$indicators[] = 'To: ' . $data['created_to'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $indicators;
|
|
||||||
})
|
|
||||||
])
|
|
||||||
->filtersFormMaxHeight('280px')
|
|
||||||
->actions([
|
|
||||||
Tables\Actions\ViewAction::make(),
|
|
||||||
Tables\Actions\EditAction::make(),
|
|
||||||
])
|
|
||||||
->bulkActions([
|
|
||||||
Tables\Actions\BulkActionGroup::make([
|
|
||||||
Tables\Actions\DeleteBulkAction::make(),
|
|
||||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
|
||||||
Tables\Actions\RestoreBulkAction::make(),
|
|
||||||
]),
|
|
||||||
])
|
|
||||||
->headerActions([
|
|
||||||
ImportAction::make()
|
|
||||||
->importer(CharacteristicValueImporter::class)
|
|
||||||
->label('Import Characteristic Value')
|
|
||||||
->color('warning')
|
|
||||||
->visible(function () {
|
|
||||||
return Filament::auth()->user()->can('view import characteristic value');
|
|
||||||
}),
|
|
||||||
ExportAction::make()
|
|
||||||
->exporter(CharacteristicValueExporter::class)
|
|
||||||
->label('Export Characteristic Value')
|
|
||||||
->color('warning')
|
|
||||||
->visible(function () {
|
|
||||||
return Filament::auth()->user()->can('view export characteristic value');
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getRelations(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
//
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getPages(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'index' => Pages\ListCharacteristicValues::route('/'),
|
|
||||||
'create' => Pages\CreateCharacteristicValue::route('/create'),
|
|
||||||
'view' => Pages\ViewCharacteristicValue::route('/{record}'),
|
|
||||||
'edit' => Pages\EditCharacteristicValue::route('/{record}/edit'),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getEloquentQuery(): Builder
|
|
||||||
{
|
|
||||||
return parent::getEloquentQuery()
|
|
||||||
->withoutGlobalScopes([
|
|
||||||
SoftDeletingScope::class,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Resources\CharacteristicValueResource\Pages;
|
|
||||||
|
|
||||||
use App\Filament\Resources\CharacteristicValueResource;
|
|
||||||
use Filament\Actions;
|
|
||||||
use Filament\Resources\Pages\CreateRecord;
|
|
||||||
|
|
||||||
class CreateCharacteristicValue extends CreateRecord
|
|
||||||
{
|
|
||||||
protected static string $resource = CharacteristicValueResource::class;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Resources\CharacteristicValueResource\Pages;
|
|
||||||
|
|
||||||
use App\Filament\Resources\CharacteristicValueResource;
|
|
||||||
use Filament\Actions;
|
|
||||||
use Filament\Resources\Pages\EditRecord;
|
|
||||||
|
|
||||||
class EditCharacteristicValue extends EditRecord
|
|
||||||
{
|
|
||||||
protected static string $resource = CharacteristicValueResource::class;
|
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Actions\ViewAction::make(),
|
|
||||||
Actions\DeleteAction::make(),
|
|
||||||
Actions\ForceDeleteAction::make(),
|
|
||||||
Actions\RestoreAction::make(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Resources\CharacteristicValueResource\Pages;
|
|
||||||
|
|
||||||
use App\Filament\Resources\CharacteristicValueResource;
|
|
||||||
use Filament\Actions;
|
|
||||||
use Filament\Resources\Pages\ListRecords;
|
|
||||||
|
|
||||||
class ListCharacteristicValues extends ListRecords
|
|
||||||
{
|
|
||||||
protected static string $resource = CharacteristicValueResource::class;
|
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Actions\CreateAction::make(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Filament\Resources\CharacteristicValueResource\Pages;
|
|
||||||
|
|
||||||
use App\Filament\Resources\CharacteristicValueResource;
|
|
||||||
use Filament\Actions;
|
|
||||||
use Filament\Resources\Pages\ViewRecord;
|
|
||||||
|
|
||||||
class ViewCharacteristicValue extends ViewRecord
|
|
||||||
{
|
|
||||||
protected static string $resource = CharacteristicValueResource::class;
|
|
||||||
|
|
||||||
protected function getHeaderActions(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Actions\EditAction::make(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -136,23 +136,23 @@ class InvoiceValidationResource extends Resource
|
|||||||
->reactive()
|
->reactive()
|
||||||
->readOnly(fn (callable $get) => empty($get('invoice_number')))
|
->readOnly(fn (callable $get) => empty($get('invoice_number')))
|
||||||
->disabled(fn (Get $get) => empty($get('invoice_number')))
|
->disabled(fn (Get $get) => empty($get('invoice_number')))
|
||||||
// ->extraAttributes([
|
|
||||||
// 'id' => 'serial_number_input',
|
|
||||||
// 'x-data' => '{ value: "" }',
|
|
||||||
// 'x-model' => 'value',
|
|
||||||
// 'wire:keydown.enter.prevent' => 'processSerial(value)', // Using wire:keydown
|
|
||||||
// ])
|
|
||||||
->dehydrated(false) // Do not trigger Livewire syncing
|
|
||||||
->extraAttributes([
|
->extraAttributes([
|
||||||
'id' => 'serial_number_input',
|
'id' => 'serial_number_input',
|
||||||
'x-on:keydown.enter.prevent' => "
|
'x-data' => '{ value: "" }',
|
||||||
let serial = \$event.target.value;
|
'x-model' => 'value',
|
||||||
if (serial.trim() != '') {
|
'wire:keydown.enter.prevent' => 'processSerial(value)', // Using wire:keydown
|
||||||
\$wire.dispatch('process-scan', serial);
|
|
||||||
\$event.target.value = '';
|
|
||||||
}
|
|
||||||
",
|
|
||||||
])
|
])
|
||||||
|
// ->dehydrated(false) // Do not trigger Livewire syncing
|
||||||
|
// ->extraAttributes([
|
||||||
|
// 'id' => 'serial_number_input',
|
||||||
|
// 'x-on:keydown.enter.prevent' => "
|
||||||
|
// let serial = \$event.target.value;
|
||||||
|
// if (serial.trim() != '') {
|
||||||
|
// \$wire.dispatch('process-scan', serial);
|
||||||
|
// \$event.target.value = '';
|
||||||
|
// }
|
||||||
|
// ",
|
||||||
|
// ])
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get, callable $livewire) {
|
->afterStateUpdated(function ($state, callable $set, callable $get, callable $livewire) {
|
||||||
$set('update_invoice', 0);
|
$set('update_invoice', 0);
|
||||||
// $this->dispatch('focus-serial-number');
|
// $this->dispatch('focus-serial-number');
|
||||||
|
|||||||
@@ -2261,7 +2261,7 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processSer($serNo)
|
public function processSerial($serNo)
|
||||||
{
|
{
|
||||||
$serNo = trim($serNo);
|
$serNo = trim($serNo);
|
||||||
$mSerNo = $serNo;
|
$mSerNo = $serNo;
|
||||||
@@ -3171,11 +3171,9 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$mPlantName = $mailData['plant_name'];
|
$mPlantName = $mailData['plant_name'];
|
||||||
$emails = $mailData['emails'];
|
$emails = $mailData['emails'];
|
||||||
|
|
||||||
$mUserName = Filament::auth()->user()->name;
|
|
||||||
|
|
||||||
if (! empty($emails)) {
|
if (! empty($emails)) {
|
||||||
Mail::to($emails)->send(
|
Mail::to($emails)->send(
|
||||||
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode,$mUserName,'NotFoundInvoice')
|
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'NotFoundInvoice')
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
||||||
@@ -3381,18 +3379,18 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
->send();
|
->send();
|
||||||
$this->dispatch('playNotificationSound');
|
$this->dispatch('playNotificationSound');
|
||||||
|
|
||||||
// $mInvoiceType = 'Serial';
|
$mInvoiceType = 'Serial';
|
||||||
// $mailData = $this->getMail();
|
$mailData = $this->getMail();
|
||||||
// $mPlantName = $mailData['plant_name'];
|
$mPlantName = $mailData['plant_name'];
|
||||||
// $emails = $mailData['emails'];
|
$emails = $mailData['emails'];
|
||||||
|
|
||||||
// if (! empty($emails)) {
|
if (! empty($emails)) {
|
||||||
// Mail::to($emails)->send(
|
Mail::to($emails)->send(
|
||||||
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CompletedSerialInvoice')
|
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CompletedSerialInvoice')
|
||||||
// );
|
);
|
||||||
// } else {
|
} else {
|
||||||
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
||||||
// }
|
}
|
||||||
|
|
||||||
$filename = $invoiceNumber.'.xlsx';
|
$filename = $invoiceNumber.'.xlsx';
|
||||||
$directory = 'uploads/temp';
|
$directory = 'uploads/temp';
|
||||||
@@ -3511,19 +3509,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
|
|
||||||
$this->dispatch('playNotificationSound');
|
$this->dispatch('playNotificationSound');
|
||||||
|
|
||||||
// $mInvoiceType = 'Serial';
|
$mInvoiceType = 'Serial';
|
||||||
// $mailData = $this->getMail();
|
$mailData = $this->getMail();
|
||||||
// $mPlantName = $mailData['plant_name'];
|
$mPlantName = $mailData['plant_name'];
|
||||||
// $emails = $mailData['emails'];
|
$emails = $mailData['emails'];
|
||||||
|
|
||||||
// if (! empty($emails)) {
|
if (! empty($emails)) {
|
||||||
// // Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
||||||
// Mail::to($emails)->send(
|
Mail::to($emails)->send(
|
||||||
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CSerialInvoice')
|
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CSerialInvoice')
|
||||||
// );
|
);
|
||||||
// } else {
|
} else {
|
||||||
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
||||||
// }
|
}
|
||||||
|
|
||||||
$filename = $invoiceNumber.'.xlsx';
|
$filename = $invoiceNumber.'.xlsx';
|
||||||
$directory = 'uploads/temp';
|
$directory = 'uploads/temp';
|
||||||
@@ -3584,21 +3582,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
|
|
||||||
$this->dispatch('playWarnSound');
|
$this->dispatch('playWarnSound');
|
||||||
|
|
||||||
// $mInvoiceType = 'Serial';
|
$mInvoiceType = 'Serial';
|
||||||
// $mailData = $this->getMail();
|
$mailData = $this->getMail();
|
||||||
// $mPlantName = $mailData['plant_name'];
|
$mPlantName = $mailData['plant_name'];
|
||||||
// $emails = $mailData['emails'];
|
$emails = $mailData['emails'];
|
||||||
|
|
||||||
// $mUserName = Filament::auth()->user()->name;
|
if (! empty($emails)) {
|
||||||
|
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
||||||
// if (! empty($emails)) {
|
Mail::to($emails)->send(
|
||||||
// // Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'DuplicateCapacitorQR')
|
||||||
// Mail::to($emails)->send(
|
);
|
||||||
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, $mUserName, 'DuplicateCapacitorQR')
|
} else {
|
||||||
// );
|
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
||||||
// } else {
|
}
|
||||||
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
|
||||||
// }
|
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -3723,19 +3719,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
|
|
||||||
$this->dispatch('playNotificationSound');
|
$this->dispatch('playNotificationSound');
|
||||||
|
|
||||||
// $mInvoiceType = 'Serial';
|
$mInvoiceType = 'Serial';
|
||||||
// $mailData = $this->getMail();
|
$mailData = $this->getMail();
|
||||||
// $mPlantName = $mailData['plant_name'];
|
$mPlantName = $mailData['plant_name'];
|
||||||
// $emails = $mailData['emails'];
|
$emails = $mailData['emails'];
|
||||||
|
|
||||||
// if (! empty($emails)) {
|
if (! empty($emails)) {
|
||||||
// // Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
// Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
||||||
// Mail::to($emails)->send(
|
Mail::to($emails)->send(
|
||||||
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ComSerInv')
|
new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ComSerInv')
|
||||||
// );
|
);
|
||||||
// } else {
|
} else {
|
||||||
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
\Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
|
||||||
// }
|
}
|
||||||
|
|
||||||
$filename = $invoiceNumber.'.xlsx';
|
$filename = $invoiceNumber.'.xlsx';
|
||||||
$directory = 'uploads/temp';
|
$directory = 'uploads/temp';
|
||||||
@@ -3769,11 +3765,11 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[On('process-scan')]
|
// #[On('process-scan')]
|
||||||
public function processSerial($serial)
|
// public function processSerial($serial)
|
||||||
{
|
// {
|
||||||
$this->processSer($serial);
|
// $this->processSer($serial); // Your duplicate check + mail logic
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function getHeading(): string
|
public function getHeading(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ class ProductCharacteristicsMasterResource extends Resource
|
|||||||
{
|
{
|
||||||
protected static ?string $model = ProductCharacteristicsMaster::class;
|
protected static ?string $model = ProductCharacteristicsMaster::class;
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Process Order';
|
|
||||||
|
|
||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use App\Filament\Exports\QualityValidationExporter;
|
|||||||
use App\Filament\Imports\QualityValidationImporter;
|
use App\Filament\Imports\QualityValidationImporter;
|
||||||
use App\Filament\Resources\QualityValidationResource\Pages;
|
use App\Filament\Resources\QualityValidationResource\Pages;
|
||||||
use App\Filament\Resources\QualityValidationResource\RelationManagers;
|
use App\Filament\Resources\QualityValidationResource\RelationManagers;
|
||||||
// use App\Jobs\SendInvalidQualityMailJob;
|
|
||||||
use App\Mail\InvalidQualityMail;
|
use App\Mail\InvalidQualityMail;
|
||||||
use App\Models\AlertMailRule;
|
use App\Models\AlertMailRule;
|
||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
@@ -14,8 +13,6 @@ use App\Models\Line;
|
|||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
use App\Models\QualityValidation;
|
use App\Models\QualityValidation;
|
||||||
use App\Models\StickerMaster;
|
use App\Models\StickerMaster;
|
||||||
// use App\Models\User;
|
|
||||||
// use App\Notifications\StatusUpdated;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
@@ -48,7 +45,6 @@ class QualityValidationResource extends Resource
|
|||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Display';
|
protected static ?string $navigationGroup = 'Display';
|
||||||
|
|
||||||
public $isSubmitted = false;
|
public $isSubmitted = false;
|
||||||
public $data = [];
|
public $data = [];
|
||||||
|
|
||||||
@@ -710,6 +706,7 @@ class QualityValidationResource extends Resource
|
|||||||
$fileName = "{$value}.png";
|
$fileName = "{$value}.png";
|
||||||
|
|
||||||
$imageUrl = route('part.validation.image', [
|
$imageUrl = route('part.validation.image', [
|
||||||
|
'plant' => $plantCode1,
|
||||||
'filename' => $fileName
|
'filename' => $fileName
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -1734,17 +1731,6 @@ class QualityValidationResource extends Resource
|
|||||||
|
|
||||||
$set('tube_sticker_motor_error', null);
|
$set('tube_sticker_motor_error', null);
|
||||||
|
|
||||||
// $mPorder = $get('production_order');
|
|
||||||
|
|
||||||
// $mPlantId = $get('plant_id');
|
|
||||||
//$plant = Plant::find($mPlantId);
|
|
||||||
// $plantCodePart4 = $plant?->code;
|
|
||||||
|
|
||||||
// $mlineId = $get('line_id');
|
|
||||||
|
|
||||||
// $mLine = Line::find($mlineId);
|
|
||||||
// $mLinePart = $mLine?->name;
|
|
||||||
|
|
||||||
if (empty($state)) {
|
if (empty($state)) {
|
||||||
$set('tube_sticker_motor_error', null);
|
$set('tube_sticker_motor_error', null);
|
||||||
return;
|
return;
|
||||||
@@ -1846,24 +1832,6 @@ class QualityValidationResource extends Resource
|
|||||||
if (!$isMatch)
|
if (!$isMatch)
|
||||||
{
|
{
|
||||||
$set('tube_sticker_motor_error', 'Serial number does not match.');
|
$set('tube_sticker_motor_error', 'Serial number does not match.');
|
||||||
|
|
||||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
|
||||||
|
|
||||||
// $mPlantName = $mailData['plant_name'];
|
|
||||||
// $emails = $mailData['emails'];
|
|
||||||
// $mUserName = Filament::auth()->user()->name;
|
|
||||||
|
|
||||||
// if (!empty($emails))
|
|
||||||
// {
|
|
||||||
// //Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
|
||||||
// Mail::to($emails)->send(
|
|
||||||
// new InvalidQualityMail($state, $mPorder, $mPlantName,$mLinePart, $mUserName, 'InvalidTubeStickerMotor')
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// \Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
|
||||||
// }
|
|
||||||
$set('tube_sticker_motor_qr', null);
|
$set('tube_sticker_motor_qr', null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1888,32 +1856,10 @@ class QualityValidationResource extends Resource
|
|||||||
->default('')
|
->default('')
|
||||||
->required()
|
->required()
|
||||||
->reactive()
|
->reactive()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state, $livewire) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
|
|
||||||
$set('tube_sticker_pump_error', null);
|
$set('tube_sticker_pump_error', null);
|
||||||
|
|
||||||
// $mPorder = $get('production_order');
|
|
||||||
|
|
||||||
// $mPlantId = $get('plant_id');
|
|
||||||
// $plant = Plant::find($mPlantId);
|
|
||||||
// $mPlantName = $plant?->name;
|
|
||||||
|
|
||||||
// $mlineId = $get('line_id');
|
|
||||||
|
|
||||||
// $mLine = Line::find($mlineId);
|
|
||||||
// $mLinePart = $mLine?->name;
|
|
||||||
|
|
||||||
// $mPorder = $get('production_order');
|
|
||||||
// $mPlantId = $get('plant_id');
|
|
||||||
// $mlineId = $get('line_id');
|
|
||||||
// $mUserName = Filament::auth()->user()?->name ?? 'Unknown';
|
|
||||||
|
|
||||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
|
||||||
|
|
||||||
// $mPlantName = $mailData['plant_name'];
|
|
||||||
// $emails = $mailData['emails'];
|
|
||||||
//$mUserName = Filament::auth()->user()->name;
|
|
||||||
|
|
||||||
if (empty($state)) {
|
if (empty($state)) {
|
||||||
$set('tube_sticker_pump_error', null);
|
$set('tube_sticker_pump_error', null);
|
||||||
return;
|
return;
|
||||||
@@ -2016,62 +1962,6 @@ class QualityValidationResource extends Resource
|
|||||||
{
|
{
|
||||||
$set('tube_sticker_pump_error', 'Serial number does not match.');
|
$set('tube_sticker_pump_error', 'Serial number does not match.');
|
||||||
$set('tube_sticker_pump_qr', null);
|
$set('tube_sticker_pump_qr', null);
|
||||||
// $user = User::where('name', $mUserName)->first();
|
|
||||||
|
|
||||||
// if ($user) {
|
|
||||||
// $user->notify(new StatusUpdated($state));
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// $currentUser = Filament::auth()->user();
|
|
||||||
|
|
||||||
// if ($currentUser) {
|
|
||||||
// $currentUser->notify(new StatusUpdated($state)); // standard Laravel DB notification
|
|
||||||
|
|
||||||
// // refresh Filament bell
|
|
||||||
// $livewire->dispatch('refreshFilamentNotifications');
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// Notification::make()
|
|
||||||
// ->title('Status Updated')
|
|
||||||
// ->body("Serial number scanned: $state")
|
|
||||||
// ->danger()
|
|
||||||
// ->sendToDatabase($currentUser);
|
|
||||||
|
|
||||||
//$user->notify(new StatusUpdated($state));
|
|
||||||
|
|
||||||
//Notification::send($user, new StatusUpdated($state));
|
|
||||||
|
|
||||||
|
|
||||||
//dd($user);
|
|
||||||
// $user->notify(new StatusUpdated($state));
|
|
||||||
// Inside a Filament page or resource
|
|
||||||
//$this->notify('success', "Serial number scanned: $state");
|
|
||||||
|
|
||||||
// dispatch(new SendInvalidQualityMailJob(
|
|
||||||
// $state, $mPorder, $mPlantId, $mlineId, $mUserName, 'InvalidTubeStickerPump'
|
|
||||||
// ))->afterResponse();
|
|
||||||
|
|
||||||
|
|
||||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
|
||||||
|
|
||||||
// $mPlantName = $mailData['plant_name'];
|
|
||||||
// $emails = $mailData['emails'];
|
|
||||||
// $mUserName = Filament::auth()->user()->name;
|
|
||||||
|
|
||||||
// if (!empty($emails))
|
|
||||||
// {
|
|
||||||
// //Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
|
||||||
// Mail::to($emails)->queue(
|
|
||||||
// new InvalidQualityMail($state, $mPorder, $mPlantName,$mLinePart, $mUserName, 'InvalidTubeStickerPumpset')
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// \Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
|
||||||
// }
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -2099,17 +1989,6 @@ class QualityValidationResource extends Resource
|
|||||||
|
|
||||||
$set('tube_sticker_pumpset_error', null);
|
$set('tube_sticker_pumpset_error', null);
|
||||||
|
|
||||||
$mPorder = $get('production_order');
|
|
||||||
|
|
||||||
$mPlantId = $get('plant_id');
|
|
||||||
//$plant = Plant::find($mPlantId);
|
|
||||||
// $plantCodePart4 = $plant?->code;
|
|
||||||
|
|
||||||
$mlineId = $get('line_id');
|
|
||||||
|
|
||||||
$mLine = Line::find($mlineId);
|
|
||||||
$mLinePart = $mLine?->name;
|
|
||||||
|
|
||||||
if (empty($state)) {
|
if (empty($state)) {
|
||||||
$set('tube_sticker_pumpset_error', null);
|
$set('tube_sticker_pumpset_error', null);
|
||||||
return;
|
return;
|
||||||
@@ -2213,23 +2092,6 @@ class QualityValidationResource extends Resource
|
|||||||
if (!$isMatch)
|
if (!$isMatch)
|
||||||
{
|
{
|
||||||
$set('tube_sticker_pumpset_error', 'Serial number does not match.');
|
$set('tube_sticker_pumpset_error', 'Serial number does not match.');
|
||||||
// $mailData = \App\Filament\Resources\QualityValidationResource::getMailData($mPlantId);
|
|
||||||
|
|
||||||
// $mPlantName = $mailData['plant_name'];
|
|
||||||
// $emails = $mailData['emails'];
|
|
||||||
// $mUserName = Filament::auth()->user()->name;
|
|
||||||
|
|
||||||
// if (!empty($emails))
|
|
||||||
// {
|
|
||||||
// //Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
|
|
||||||
// Mail::to($emails)->send(
|
|
||||||
// new InvalidQualityMail($state, $mPorder, $mPlantName,$mLinePart, $mUserName, 'InvalidTubeStickerPumpset')
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// \Log::warning("No recipients found for plant {$mPlantName}, module Serial, rule invalid_serial.");
|
|
||||||
// }
|
|
||||||
$set('tube_sticker_pumpset_qr', null);
|
$set('tube_sticker_pumpset_qr', null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2443,7 +2305,7 @@ class QualityValidationResource extends Resource
|
|||||||
$set('part_validation1', null);
|
$set('part_validation1', null);
|
||||||
|
|
||||||
$fileName = $expectedValue . ".png"; // or .jpg based on your file
|
$fileName = $expectedValue . ".png"; // or .jpg based on your file
|
||||||
$fullPath = storage_path("app/private/uploads/PartValidation/{$fileName}");
|
$fullPath = storage_path("app/private/uploads/PartValidation/{$plantCodePart1}/{$fileName}");
|
||||||
|
|
||||||
// dd($fullPath);
|
// dd($fullPath);
|
||||||
|
|
||||||
@@ -2454,7 +2316,7 @@ class QualityValidationResource extends Resource
|
|||||||
// ]);
|
// ]);
|
||||||
if (file_exists($fullPath)) {
|
if (file_exists($fullPath)) {
|
||||||
$imageUrl = route('part.validation.image', [
|
$imageUrl = route('part.validation.image', [
|
||||||
// 'plant' => $plantCodePart1,
|
'plant' => $plantCodePart1,
|
||||||
'filename' => $fileName
|
'filename' => $fileName
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
@@ -2745,7 +2607,7 @@ class QualityValidationResource extends Resource
|
|||||||
'filename' => $fileName
|
'filename' => $fileName
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$set('part_validation4_error_image', $imageUrl);
|
$set('part_validation2_error_image', $imageUrl);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2909,6 +2771,34 @@ class QualityValidationResource extends Resource
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// public function getMail(){
|
||||||
|
// //$plantId = $this->form->getState()['plant_id'];
|
||||||
|
// $plantId = $this->data['plant_id'] ?? null;
|
||||||
|
// //$this->plantId = $plantId;
|
||||||
|
// dd($plantId);
|
||||||
|
// $mInvoiceType = 'Serial';
|
||||||
|
// $mPlantName = Plant::where('id', $plantId)->value('name');
|
||||||
|
// $emails = AlertMailRule::where('plant', $plantId)
|
||||||
|
// //->where('plant', $plantName)
|
||||||
|
// ->where('module', 'InvoiceValidation')
|
||||||
|
// ->where('rule_name', 'InvoiceMail')
|
||||||
|
// ->where(function ($query) {
|
||||||
|
// $query->whereNull('schedule_type')
|
||||||
|
// ->orWhere('schedule_type', '');
|
||||||
|
// })
|
||||||
|
// ->pluck('email')
|
||||||
|
// ->toArray();
|
||||||
|
|
||||||
|
// return [
|
||||||
|
// 'plant_id' => $plantId,
|
||||||
|
// 'plant_name' => $mPlantName,
|
||||||
|
// 'invoice_type' => $mInvoiceType,
|
||||||
|
// 'emails' => $emails,
|
||||||
|
// ];
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
public static function table(Table $table): Table
|
public static function table(Table $table): Table
|
||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
|
|||||||
@@ -844,56 +844,50 @@ class StickerMasterResource extends Resource
|
|||||||
|
|
||||||
$plantCode = $plant->code;
|
$plantCode = $plant->code;
|
||||||
|
|
||||||
// $sticker = StickerMaster::where('plant_id', $plantId)
|
$sticker = StickerMaster::where('plant_id', $plantId)
|
||||||
// ->where('item_id', $itemId)
|
->where('item_id', $itemId)
|
||||||
// ->first();
|
->first();
|
||||||
|
|
||||||
// if (! $sticker) {
|
if (! $sticker) {
|
||||||
// Notification::make()
|
Notification::make()
|
||||||
// ->title('Unknown Sticker Master')
|
->title('Unknown Sticker Master')
|
||||||
// ->body('Sticker Master data not found.')
|
->body('Sticker Master data not found.')
|
||||||
// ->danger()
|
->danger()
|
||||||
// ->seconds(2)
|
->seconds(2)
|
||||||
// ->send();
|
->send();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $value = $sticker->{$column};
|
$value = $sticker->{$column};
|
||||||
|
|
||||||
// if (empty($value)) {
|
if (empty($value)) {
|
||||||
// Notification::make()
|
Notification::make()
|
||||||
// ->title('Unknown Part validation')
|
->title('Unknown Part validation')
|
||||||
// ->body("Selected validation '$column' has no value.")
|
->body("Selected validation '$column' has no value.")
|
||||||
// ->danger()
|
->danger()
|
||||||
// ->seconds(2)
|
->seconds(2)
|
||||||
// ->send();
|
->send();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// $newFileName = $value.'.png';
|
$newFileName = $value.'.png';
|
||||||
|
|
||||||
$originalName = $uploadedFile->getClientOriginalName();
|
$directory = "uploads/PartValidation/{$plantCode}";
|
||||||
$directory = 'uploads/PartValidation';
|
|
||||||
|
|
||||||
$disk = Storage::disk('local');
|
$disk = Storage::disk('local');
|
||||||
if (! $disk->exists($directory)) {
|
if (! $disk->exists($directory)) {
|
||||||
$disk->makeDirectory($directory, 0755, true);
|
$disk->makeDirectory($directory, 0755, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $fullPath = Storage::disk('local')->path($directory);
|
|
||||||
|
|
||||||
// $directory = "uploads/PartValidation/{$plantCode}";
|
|
||||||
|
|
||||||
// $disk = Storage::disk('local');
|
|
||||||
// if (! $disk->exists($directory)) {
|
|
||||||
// $disk->makeDirectory($directory, 0755, true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $path = $uploadedFile->storeAs(
|
// $path = $uploadedFile->storeAs(
|
||||||
// $directory,
|
// $directory,
|
||||||
// $newFileName,
|
// $newFileName,
|
||||||
// 'local'
|
// 'local'
|
||||||
// );
|
// );
|
||||||
try {
|
try {
|
||||||
$path = $disk->putFileAs($directory, $uploadedFile, $originalName);
|
$path = $uploadedFile->storeAs(
|
||||||
|
$directory,
|
||||||
|
$newFileName,
|
||||||
|
'local'
|
||||||
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Upload Failed')
|
->title('Upload Failed')
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ class StickerPrintingResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Sticker Reprint';
|
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
@@ -40,6 +38,7 @@ class StickerPrintingResource extends Resource
|
|||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$userHas = Filament::auth()->user()->plant_id;
|
$userHas = Filament::auth()->user()->plant_id;
|
||||||
|
|
||||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||||
})
|
})
|
||||||
->required()
|
->required()
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\CharacteristicValue;
|
|
||||||
use App\Models\ClassCharacteristic;
|
use App\Models\ClassCharacteristic;
|
||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
use App\Models\Line;
|
use App\Models\Line;
|
||||||
@@ -498,7 +497,7 @@ class CharacteristicsController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$col = ['marked_by', 'man_marked_by', 'motor_marked_by', 'pump_marked_by'];
|
$col = ['marked_by', 'man_marked_by'];
|
||||||
$missingUsers = [];
|
$missingUsers = [];
|
||||||
$missingUsersPlant = [];
|
$missingUsersPlant = [];
|
||||||
$missingUsersRight = [];
|
$missingUsersRight = [];
|
||||||
@@ -557,148 +556,25 @@ class CharacteristicsController extends Controller
|
|||||||
$isAuto = false;
|
$isAuto = false;
|
||||||
|
|
||||||
foreach ($data['characteristics'] as $char) {
|
foreach ($data['characteristics'] as $char) {
|
||||||
|
$values = [
|
||||||
// $values = [
|
'mark_status' => $char['mark_status'] ?? null,
|
||||||
// 'mark_status' => $char['mark_status'] ?? null,
|
'marked_datetime' => $char['marked_datetime'] ?? null,
|
||||||
// 'marked_datetime' => $char['marked_datetime'] ?? null,
|
'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
||||||
// 'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
'man_marked_status' => $char['man_marked_status'] ?? null,
|
||||||
// 'man_marked_status' => $char['man_marked_status'] ?? null,
|
'man_marked_datetime' => $char['man_marked_datetime'] ?? null,
|
||||||
// 'man_marked_datetime' => $char['man_marked_datetime'] ?? null,
|
'man_marked_by' => ($char['man_marked_by'] == 'jothi') ? 'Admin' : $char['man_marked_by'] ?? null,
|
||||||
// 'man_marked_by' => ($char['man_marked_by'] == 'jothi') ? 'Admin' : $char['man_marked_by'] ?? null,
|
'motor_marked_status' => $char['motor_marked_status'] ?? null,
|
||||||
// 'motor_marked_status' => $char['motor_marked_status'] ?? null,
|
'pump_marked_status' => $char['pump_marked_status'] ?? null,
|
||||||
// 'pump_marked_status' => $char['pump_marked_status'] ?? null,
|
'motor_pump_pumpset_status' => $char['motor_pump_pumpset_status'] ?? null,
|
||||||
// 'motor_pump_pumpset_status' => $char['motor_pump_pumpset_status'] ?? null,
|
'part_validation_1' => $char['part_validation_1'] ?? null,
|
||||||
// 'part_validation_1' => $char['part_validation_1'] ?? null,
|
'part_validation_2' => $char['part_validation_2'] ?? null,
|
||||||
// 'part_validation_2' => $char['part_validation_2'] ?? null,
|
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
||||||
// 'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
'pending_released_status' => $char['pending_released_status'] ?? null,
|
||||||
// 'pending_released_status' => $char['pending_released_status'] ?? null,
|
'expected_time' => $char['expected_time'] ?? null,
|
||||||
// 'expected_time' => $char['expected_time'] ?? null,
|
'updated_by' => $userName ?? null,
|
||||||
// 'updated_by' => $userName ?? null,
|
];
|
||||||
// ];
|
|
||||||
|
|
||||||
if ($jobNo != null && $jobNo != '' && $jobNo) {
|
if ($jobNo != null && $jobNo != '' && $jobNo) {
|
||||||
$curStat = ClassCharacteristic::where('plant_id', $plantId)
|
|
||||||
->where('machine_id', $machineId)
|
|
||||||
->where('aufnr', $jobNo)
|
|
||||||
->where('gernr', $serialNumber)
|
|
||||||
->where('item_id', $itemId)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($char['mark_status'] == 'Stopped') {
|
|
||||||
$values = [
|
|
||||||
'mark_status' => $char['mark_status'] ?? null,
|
|
||||||
'marked_datetime' => $char['marked_datetime'] ?? null,
|
|
||||||
'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
} elseif ($char['motor_pump_pumpset_status'] == '3') {
|
|
||||||
$values = [
|
|
||||||
'mark_status' => $char['mark_status'] ?? null,
|
|
||||||
'marked_datetime' => $char['marked_datetime'] ?? null,
|
|
||||||
'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
|
||||||
'motor_marked_status' => $char['motor_marked_status'] ?? null,
|
|
||||||
'motor_marked_by' => ($char['motor_marked_by'] == 'jothi') ? 'Admin' : $char['motor_marked_by'] ?? null,
|
|
||||||
'pump_marked_status' => $char['pump_marked_status'] ?? null,
|
|
||||||
'pump_marked_by' => ($char['pump_marked_by'] == 'jothi') ? 'Admin' : $char['pump_marked_by'] ?? null,
|
|
||||||
'motor_pump_pumpset_status' => '3',
|
|
||||||
'pumpset_machine_name' => $char['pumpset_machine_name'] ?? null,
|
|
||||||
'part_validation_1' => $char['part_validation_1'] ?? null,
|
|
||||||
'part_validation_2' => $char['part_validation_2'] ?? null,
|
|
||||||
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
|
||||||
// 'pending_released_status' => $char['pending_released_status'] ?? null,
|
|
||||||
'expected_time' => $char['expected_time'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
} elseif ($char['motor_pump_pumpset_status'] == '2') {
|
|
||||||
if ($curStat->motor_marked_status == null || $curStat->motor_marked_status == '') {
|
|
||||||
$values = [
|
|
||||||
// 'mark_status' => $char['mark_status'] ?? null,
|
|
||||||
'marked_datetime' => $char['marked_datetime'] ?? null,
|
|
||||||
// 'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
|
||||||
'pump_marked_status' => $char['pump_marked_status'] ?? null,
|
|
||||||
'pump_marked_by' => ($char['pump_marked_by'] == 'jothi') ? 'Admin' : $char['pump_marked_by'] ?? null,
|
|
||||||
'motor_pump_pumpset_status' => '3',
|
|
||||||
'pump_machine_name' => $char['pump_machine_name'] ?? null,
|
|
||||||
'part_validation_1' => $char['part_validation_1'] ?? null,
|
|
||||||
'part_validation_2' => $char['part_validation_2'] ?? null,
|
|
||||||
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
|
||||||
// 'pending_released_status' => $char['pending_released_status'] ?? null,
|
|
||||||
'expected_time' => $char['expected_time'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
$values = [
|
|
||||||
'mark_status' => $char['mark_status'] ?? null,
|
|
||||||
'marked_datetime' => $char['marked_datetime'] ?? null,
|
|
||||||
'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
|
||||||
'pump_marked_status' => $char['pump_marked_status'] ?? null,
|
|
||||||
'pump_marked_by' => ($char['pump_marked_by'] == 'jothi') ? 'Admin' : $char['pump_marked_by'] ?? null,
|
|
||||||
'motor_pump_pumpset_status' => '3',
|
|
||||||
'pump_machine_name' => $char['pump_machine_name'] ?? null,
|
|
||||||
'part_validation_1' => $char['part_validation_1'] ?? null,
|
|
||||||
'part_validation_2' => $char['part_validation_2'] ?? null,
|
|
||||||
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
|
||||||
// 'pending_released_status' => $char['pending_released_status'] ?? null,
|
|
||||||
'expected_time' => $char['expected_time'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
} elseif ($char['motor_pump_pumpset_status'] == '1') {
|
|
||||||
if ($curStat->pump_marked_status == null || $curStat->pump_marked_status == '') {
|
|
||||||
$values = [
|
|
||||||
// 'mark_status' => $char['mark_status'] ?? null,
|
|
||||||
'marked_datetime' => $char['marked_datetime'] ?? null,
|
|
||||||
// 'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
|
||||||
'motor_marked_status' => $char['motor_marked_status'] ?? null,
|
|
||||||
'motor_marked_by' => ($char['motor_marked_by'] == 'jothi') ? 'Admin' : $char['motor_marked_by'] ?? null,
|
|
||||||
'motor_pump_pumpset_status' => '3',
|
|
||||||
'motor_machine_name' => $char['motor_machine_name'] ?? null,
|
|
||||||
'part_validation_1' => $char['part_validation_1'] ?? null,
|
|
||||||
'part_validation_2' => $char['part_validation_2'] ?? null,
|
|
||||||
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
|
||||||
// 'pending_released_status' => $char['pending_released_status'] ?? null,
|
|
||||||
'expected_time' => $char['expected_time'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
$values = [
|
|
||||||
'mark_status' => $char['mark_status'] ?? null,
|
|
||||||
'marked_datetime' => $char['marked_datetime'] ?? null,
|
|
||||||
'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
|
||||||
'motor_marked_status' => $char['motor_marked_status'] ?? null,
|
|
||||||
'motor_marked_by' => ($char['motor_marked_by'] == 'jothi') ? 'Admin' : $char['motor_marked_by'] ?? null,
|
|
||||||
'motor_pump_pumpset_status' => '3',
|
|
||||||
'motor_machine_name' => $char['motor_machine_name'] ?? null,
|
|
||||||
'part_validation_1' => $char['part_validation_1'] ?? null,
|
|
||||||
'part_validation_2' => $char['part_validation_2'] ?? null,
|
|
||||||
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
|
||||||
// 'pending_released_status' => $char['pending_released_status'] ?? null,
|
|
||||||
'expected_time' => $char['expected_time'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$values = [
|
|
||||||
'mark_status' => $char['mark_status'] ?? null,
|
|
||||||
'marked_datetime' => $char['marked_datetime'] ?? null,
|
|
||||||
'marked_by' => ($char['marked_by'] == 'jothi') ? 'Admin' : $char['marked_by'] ?? null,
|
|
||||||
'motor_marked_status' => $char['motor_marked_status'] ?? null,
|
|
||||||
'motor_marked_by' => ($char['motor_marked_by'] == 'jothi') ? 'Admin' : $char['motor_marked_by'] ?? null,
|
|
||||||
'pump_marked_status' => $char['pump_marked_status'] ?? null,
|
|
||||||
'pump_marked_by' => ($char['pump_marked_by'] == 'jothi') ? 'Admin' : $char['pump_marked_by'] ?? null,
|
|
||||||
'motor_pump_pumpset_status' => $char['motor_pump_pumpset_status'] ?? null,
|
|
||||||
'motor_machine_name' => $char['motor_machine_name'] ?? null,
|
|
||||||
'pump_machine_name' => $char['pump_machine_name'] ?? null,
|
|
||||||
'pumpset_machine_name' => $char['pumpset_machine_name'] ?? null,
|
|
||||||
'part_validation_1' => $char['part_validation_1'] ?? null,
|
|
||||||
'part_validation_2' => $char['part_validation_2'] ?? null,
|
|
||||||
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
|
||||||
// 'pending_released_status' => $char['pending_released_status'] ?? null,
|
|
||||||
'expected_time' => $char['expected_time'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$isAuto = true;
|
$isAuto = true;
|
||||||
$affected = ClassCharacteristic::where('plant_id', $plantId)
|
$affected = ClassCharacteristic::where('plant_id', $plantId)
|
||||||
->where('machine_id', $machineId)
|
->where('machine_id', $machineId)
|
||||||
@@ -709,14 +585,6 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
$updatedRows += $affected;
|
$updatedRows += $affected;
|
||||||
} else {
|
} else {
|
||||||
$values = [
|
|
||||||
'man_marked_status' => $char['man_marked_status'] ?? null,
|
|
||||||
'man_marked_datetime' => $char['man_marked_datetime'] ?? null,
|
|
||||||
'man_marked_by' => ($char['man_marked_by'] == 'jothi') ? 'Admin' : $char['man_marked_by'] ?? null,
|
|
||||||
'samlight_logged_name' => $char['samlight_logged_name'] ?? null,
|
|
||||||
'updated_by' => $userName ?? null,
|
|
||||||
];
|
|
||||||
|
|
||||||
$isAuto = false;
|
$isAuto = false;
|
||||||
$affected = ClassCharacteristic::where('plant_id', $plantId)
|
$affected = ClassCharacteristic::where('plant_id', $plantId)
|
||||||
->where('machine_id', $machineId)
|
->where('machine_id', $machineId)
|
||||||
@@ -1470,7 +1338,7 @@ class CharacteristicsController extends Controller
|
|||||||
], 400);
|
], 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
$columnsToShow = ['mark_status', 'marked_datetime', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_by', 'pump_marked_status', 'pump_marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'pumpset_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'expected_time'];
|
$columnsToShow = ['mark_status', 'marked_datetime', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'pump_marked_status', 'motor_pump_pumpset_status', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'expected_time'];
|
||||||
|
|
||||||
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name'];
|
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name'];
|
||||||
|
|
||||||
@@ -1523,8 +1391,6 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
$otherData['marked_by'] = ($otherData['marked_by'] == 'Admin') ? 'jothi' : $otherData['marked_by'] ?? '';
|
$otherData['marked_by'] = ($otherData['marked_by'] == 'Admin') ? 'jothi' : $otherData['marked_by'] ?? '';
|
||||||
$otherData['man_marked_by'] = ($otherData['man_marked_by'] == 'Admin') ? 'jothi' : $otherData['man_marked_by'] ?? '';
|
$otherData['man_marked_by'] = ($otherData['man_marked_by'] == 'Admin') ? 'jothi' : $otherData['man_marked_by'] ?? '';
|
||||||
$otherData['motor_marked_by'] = ($otherData['motor_marked_by'] == 'Admin') ? 'jothi' : $otherData['motor_marked_by'] ?? '';
|
|
||||||
$otherData['pump_marked_by'] = ($otherData['pump_marked_by'] == 'Admin') ? 'jothi' : $otherData['pump_marked_by'] ?? '';
|
|
||||||
|
|
||||||
// $otherData['pending_released_status'] = (string)$otherData['pending_released_status'] ?? '';
|
// $otherData['pending_released_status'] = (string)$otherData['pending_released_status'] ?? '';
|
||||||
return array_merge(['gernr' => $serial->gernr], $otherData);
|
return array_merge(['gernr' => $serial->gernr], $otherData);
|
||||||
@@ -1654,7 +1520,7 @@ class CharacteristicsController extends Controller
|
|||||||
->get();
|
->get();
|
||||||
|
|
||||||
$remFields = [
|
$remFields = [
|
||||||
'id', 'plant_id', 'machine_id', 'item_id', 'gernr', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', 'created_at', 'updated_at', 'created_by', 'updated_by', 'deleted_at',
|
'id', 'plant_id', 'machine_id', 'item_id', 'gernr', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_logo_ce', 'zmm_codeclass', 'zmm_colour', 'zmm_logo_cp', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_logo_nsf', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', 'created_at', 'updated_at', 'created_by', 'updated_by', 'deleted_at',
|
||||||
];
|
];
|
||||||
|
|
||||||
$filteredData = $characteristicsData->map(function ($char) use ($remFields) {
|
$filteredData = $characteristicsData->map(function ($char) use ($remFields) {
|
||||||
@@ -1673,8 +1539,6 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
$charArray['marked_by'] = ($charArray['marked_by'] == 'Admin') ? 'jothi' : $charArray['marked_by'] ?? '';
|
$charArray['marked_by'] = ($charArray['marked_by'] == 'Admin') ? 'jothi' : $charArray['marked_by'] ?? '';
|
||||||
$charArray['man_marked_by'] = ($charArray['man_marked_by'] == 'Admin') ? 'jothi' : $charArray['man_marked_by'] ?? '';
|
$charArray['man_marked_by'] = ($charArray['man_marked_by'] == 'Admin') ? 'jothi' : $charArray['man_marked_by'] ?? '';
|
||||||
$charArray['motor_marked_by'] = ($charArray['motor_marked_by'] == 'Admin') ? 'jothi' : $charArray['motor_marked_by'] ?? '';
|
|
||||||
$charArray['pump_marked_by'] = ($charArray['pump_marked_by'] == 'Admin') ? 'jothi' : $charArray['pump_marked_by'] ?? '';
|
|
||||||
|
|
||||||
foreach ($charArray as $key => $value) {
|
foreach ($charArray as $key => $value) {
|
||||||
if ($value instanceof \Carbon\Carbon) {
|
if ($value instanceof \Carbon\Carbon) {
|
||||||
@@ -1861,7 +1725,7 @@ class CharacteristicsController extends Controller
|
|||||||
|
|
||||||
// $columnsToShow = ['mark_status','marked_datetime','marked_by','man_marked_status','man_marked_datetime','man_marked_by','motor_marked_status','pump_marked_status','motor_pump_pumpset_status','part_validation_1','part_validation_2','samlight_logged_name','pending_released_status','expected_time'];
|
// $columnsToShow = ['mark_status','marked_datetime','marked_by','man_marked_status','man_marked_datetime','man_marked_by','motor_marked_status','pump_marked_status','motor_pump_pumpset_status','part_validation_1','part_validation_2','samlight_logged_name','pending_released_status','expected_time'];
|
||||||
|
|
||||||
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_laser_name'];
|
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name'];
|
||||||
|
|
||||||
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)
|
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)
|
||||||
->where('plant_id', $plantId)
|
->where('plant_id', $plantId)
|
||||||
@@ -2112,18 +1976,13 @@ class CharacteristicsController extends Controller
|
|||||||
'ZMM_HEADING' => $serialExists->zmm_heading ?? '',
|
'ZMM_HEADING' => $serialExists->zmm_heading ?? '',
|
||||||
'MARK_STATUS' => $serialExists->mark_status ?? '',
|
'MARK_STATUS' => $serialExists->mark_status ?? '',
|
||||||
'MARKED_DATETIME' => $serialExists->marked_datetime,
|
'MARKED_DATETIME' => $serialExists->marked_datetime,
|
||||||
'MARKED_BY' => ($serialExists->marked_by == 'Admin') ? 'jothi' : $serialExists->marked_by ?? '',
|
'MARKED_BY' => $serialExists->marked_by ?? '',
|
||||||
'MAN_MARKED_STATUS' => $serialExists->man_marked_status ?? '',
|
'MAN_MARKED_STATUS' => $serialExists->man_marked_status ?? '',
|
||||||
'MAN_MARKED_DATETIME' => $serialExists->man_marked_datetime ?? '',
|
'MAN_MARKED_DATETIME' => $serialExists->man_marked_datetime ?? '',
|
||||||
'MAN_MARKED_BY' => ($serialExists->man_marked_by == 'Admin') ? 'jothi' : $serialExists->man_marked_by ?? '',
|
'MAN_MARKED_BY' => $serialExists->man_marked_by ?? '',
|
||||||
'MOTOR_MARKED_STATUS' => $serialExists->motor_marked_status ?? '',
|
'MOTOR_MARKED_STATUS' => $serialExists->motor_marked_status ?? '',
|
||||||
'MOTOR_MARKED_BY' => ($serialExists->motor_marked_by == 'Admin') ? 'jothi' : $serialExists->motor_marked_by ?? '',
|
|
||||||
'PUMP_MARKED_STATUS' => $serialExists->pump_marked_status ?? '',
|
'PUMP_MARKED_STATUS' => $serialExists->pump_marked_status ?? '',
|
||||||
'PUMP_MARKED_BY' => ($serialExists->pump_marked_by == 'Admin') ? 'jothi' : $serialExists->pump_marked_by ?? '',
|
|
||||||
'MOTOR_PUMP_PUMPSET_STATUS' => $serialExists->motor_pump_pumpset_status ?? '',
|
'MOTOR_PUMP_PUMPSET_STATUS' => $serialExists->motor_pump_pumpset_status ?? '',
|
||||||
'MOTOR_MACHINE_NAME' => $serialExists->motor_machine_name ?? '',
|
|
||||||
'PUMP_MACHINE_NAME' => $serialExists->pump_machine_name ?? '',
|
|
||||||
'PUMPSET_MACHINE_NAME' => $serialExists->pumpset_machine_name ?? '',
|
|
||||||
], 200);
|
], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2278,221 +2137,6 @@ class CharacteristicsController extends Controller
|
|||||||
return response()->json($output, 200);
|
return response()->json($output, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeCharValues(Request $request)
|
|
||||||
{
|
|
||||||
$expectedUser = env('API_AUTH_USER');
|
|
||||||
$expectedPw = env('API_AUTH_PW');
|
|
||||||
$headerAuth = $request->header('Authorization');
|
|
||||||
$expectedToken = 'Bearer '.$expectedUser.':'.$expectedPw;
|
|
||||||
|
|
||||||
if ($headerAuth !== $expectedToken) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => 'Invalid authorization token!',
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$plantCode = $request->header('plant-code');
|
|
||||||
$itemCode = $request->header('item-code');
|
|
||||||
$lineName = $request->header('line-name');
|
|
||||||
$workCenter = $request->header('work-center');
|
|
||||||
|
|
||||||
if ($plantCode == null || $plantCode == '' || ! $plantCode) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Plant code can't be empty!",
|
|
||||||
], 404);
|
|
||||||
} elseif (! is_numeric($plantCode) || Str::length($plantCode) < 4 || ! preg_match('/^[1-9]\d{3,}$/', $plantCode)) { // !ctype_digit($data['plant_code'])
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => 'Invalid plant code found!',
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$plant = Plant::where('code', $plantCode)->first();
|
|
||||||
if (! $plant) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Plant code '{$plantCode}' not found!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$plantId = $plant->id;
|
|
||||||
|
|
||||||
if ($lineName == null || $lineName == '') {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Line name can't be empty!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$line = Line::where('name', $lineName)->first();
|
|
||||||
if (! $line) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Line '{$lineName}' not found!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$lineAgaPlant = Line::where('plant_id', $plantId)->where('name', $lineName)->first();
|
|
||||||
if (! $lineAgaPlant) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Line '{$lineName}' not found against plant code '$plantCode'!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$lineId = $lineAgaPlant->id;
|
|
||||||
|
|
||||||
if ($itemCode == null || $itemCode == '') {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Item code can't be empty!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$item = Item::where('code', $itemCode)->first();
|
|
||||||
if (! $item) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Item Code '{$itemCode}' not found!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$itemAgaPlant = Item::where('plant_id', $plantId)->where('code', $itemCode)->first();
|
|
||||||
if (! $itemAgaPlant) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Item code '{$itemCode}' not found against plant code '$plantCode'!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$itemId = $itemAgaPlant->id;
|
|
||||||
|
|
||||||
if ($workCenter == null || $workCenter == '') {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Work center can't be empty!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$machine = Machine::where('work_center', $workCenter)->first();
|
|
||||||
if (! $machine) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Work center '{$workCenter}' not found!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$machineAgaPlant = Machine::where('plant_id', $plantId)->where('work_center', $workCenter)->first();
|
|
||||||
if (! $machineAgaPlant) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Work center '{$workCenter}' not found against plant code '$plantCode'!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$machineAgaPlantLine = Machine::where('plant_id', $plantId)->where('line_id', $lineId)->where('work_center', $workCenter)->first();
|
|
||||||
if (! $machineAgaPlantLine) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Work center '{$workCenter}' not found against plant code '$plantCode' and line name '$lineName'!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$machineId = $machineAgaPlantLine->id;
|
|
||||||
|
|
||||||
$data = $request->all();
|
|
||||||
|
|
||||||
$processOrder = $data['process_order'] ?? '';
|
|
||||||
$coilNo = $data['coil_number'] ?? '';
|
|
||||||
$status = $data['status'] ?? '';
|
|
||||||
$createdBy = $data['created_by'] ?? '';
|
|
||||||
|
|
||||||
if ($processOrder == null || $processOrder == '' || ! $processOrder) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Process order can't be empty!",
|
|
||||||
], 404);
|
|
||||||
} elseif (Str::length($processOrder) < 9) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => 'Process order should contain minimum 9 digits!',
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($coilNo == null || $coilNo == '' || ! $coilNo) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Coil number can't be empty!",
|
|
||||||
], 404);
|
|
||||||
} elseif (! is_numeric($coilNo)) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => 'Coil number should contain only numeric values!',
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($status == null || $status == '' || ! $status) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Status can't be empty!",
|
|
||||||
], 404);
|
|
||||||
} elseif (! in_array($status, ['Ok', 'NotOk'], true)) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Status must be either 'Ok' or 'NotOk'!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($createdBy == null || $createdBy == '' || ! $createdBy) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Created by can't be empty!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$existing = CharacteristicValue::where('plant_id', $plantId)
|
|
||||||
->where('process_order', $processOrder)
|
|
||||||
->where('item_id', '!=', $itemId)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($existing) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Process order '{$processOrder}' already has item_code '{$existing->item->code}' for the plant code '{$plantCode}'!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$existing = CharacteristicValue::where('plant_id', $plantId)
|
|
||||||
->where('process_order', $processOrder)
|
|
||||||
->where('coil_number', $coilNo)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($existing) {
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'ERROR',
|
|
||||||
'status_description' => "Process order '{$processOrder}' with coil number '{$coilNo}' already exist for the plant code '{$plantCode}'!",
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
CharacteristicValue::create([
|
|
||||||
'plant_id' => $plantId,
|
|
||||||
'line_id' => $lineId,
|
|
||||||
'item_id' => $itemId,
|
|
||||||
'machine_id' => $machineId,
|
|
||||||
'process_order' => $processOrder,
|
|
||||||
'coil_number' => $coilNo,
|
|
||||||
'status' => $status,
|
|
||||||
'created_by' => $createdBy,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return response()->json([
|
|
||||||
'status_code' => 'SUCCESS',
|
|
||||||
'status_description' => 'Characteristics values inserted successfully',
|
|
||||||
], 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -46,20 +46,20 @@ class InvalidQualityMail extends Mailable
|
|||||||
// dynamic subject based on mail type
|
// dynamic subject based on mail type
|
||||||
switch ($this->mailType) {
|
switch ($this->mailType) {
|
||||||
case 'InvalidPartNumber2':
|
case 'InvalidPartNumber2':
|
||||||
$this->subjectLine = "Quality Part Validation ({$this->mplantName})";
|
$this->subjectLine = "Invalid Part Number 2 Scanned ({$this->mplantName})";
|
||||||
break;
|
break;
|
||||||
case 'InvalidPartNumber3':
|
case 'InvalidPartNumber3':
|
||||||
$this->subjectLine = "Quality Part Validation ({$this->mplantName})";
|
$this->subjectLine = "Invalid Part Number 3 Scanned ({$this->mplantName})";
|
||||||
break;
|
break;
|
||||||
case 'InvalidPartNumber4':
|
case 'InvalidPartNumber4':
|
||||||
$this->subjectLine = "Quality Part Validation ({$this->mplantName})";
|
$this->subjectLine = "Invalid Part Number 4 Scanned ({$this->mplantName})";
|
||||||
break;
|
break;
|
||||||
case 'InvalidPartNumber5':
|
case 'InvalidPartNumber5':
|
||||||
$this->subjectLine = "Quality Part Validation ({$this->mplantName})";
|
$this->subjectLine = "Invalid Part Number 5 Scanned ({$this->mplantName})";
|
||||||
break;
|
break;
|
||||||
case 'InvalidPartNumber':
|
case 'InvalidPartNumber':
|
||||||
default:
|
default:
|
||||||
$this->subjectLine = "Quality Part Validation ({$this->mplantName})";
|
$this->subjectLine = "Invalid Part Number 1 Scanned ({$this->mplantName})";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,14 +82,12 @@ class InvalidSerialMail extends Mailable
|
|||||||
public $greeting;
|
public $greeting;
|
||||||
public $subjectLine;
|
public $subjectLine;
|
||||||
|
|
||||||
public $mUserName;
|
|
||||||
|
|
||||||
public $itemCode;
|
public $itemCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new message instance.
|
* Create a new message instance.
|
||||||
*/
|
*/
|
||||||
public function __construct($serial, $invoiceNumber, $mplantName, $mInvoiceType, $itemCode, $mUserName, $mailType = 'InvalidFormat')
|
public function __construct($serial, $invoiceNumber, $mplantName, $mInvoiceType, $itemCode, $mailType = 'InvalidFormat')
|
||||||
{
|
{
|
||||||
$this->serial = $serial;
|
$this->serial = $serial;
|
||||||
$this->invoiceNumber = $invoiceNumber;
|
$this->invoiceNumber = $invoiceNumber;
|
||||||
@@ -97,7 +95,6 @@ class InvalidSerialMail extends Mailable
|
|||||||
$this->mInvoiceType = $mInvoiceType;
|
$this->mInvoiceType = $mInvoiceType;
|
||||||
$this->mailType = $mailType;
|
$this->mailType = $mailType;
|
||||||
$this->itemCode = $itemCode;
|
$this->itemCode = $itemCode;
|
||||||
$this->mUserName = $mUserName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,18 +110,15 @@ class InvalidSerialMail extends Mailable
|
|||||||
case 'DuplicateCapacitorQR':
|
case 'DuplicateCapacitorQR':
|
||||||
$this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
$this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
||||||
break;
|
break;
|
||||||
case 'InvalidPanelBox':
|
case 'CompletedSerialInvoice':
|
||||||
|
$this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
||||||
|
break;
|
||||||
|
case 'CSerialInvoice':
|
||||||
|
$this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
||||||
|
break;
|
||||||
|
case 'ComSerInv':
|
||||||
$this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
$this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
||||||
break;
|
break;
|
||||||
// case 'CompletedSerialInvoice':
|
|
||||||
// $this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
|
||||||
// break;
|
|
||||||
// case 'CSerialInvoice':
|
|
||||||
// $this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
|
||||||
// break;
|
|
||||||
// case 'ComSerInv':
|
|
||||||
// $this->subjectLine = "Invoice - Second Scanning({$this->mplantName})";
|
|
||||||
// break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Envelope(
|
return new Envelope(
|
||||||
@@ -147,20 +141,48 @@ class InvalidSerialMail extends Mailable
|
|||||||
<b>Invoice Type:</b> {$this->mInvoiceType}<br>
|
<b>Invoice Type:</b> {$this->mInvoiceType}<br>
|
||||||
<b>Invoice Number:</b> {$this->invoiceNumber}<br>
|
<b>Invoice Number:</b> {$this->invoiceNumber}<br>
|
||||||
<b>Scanned QR Code:</b> {$this->serial}<br>
|
<b>Scanned QR Code:</b> {$this->serial}<br>
|
||||||
<b>Employee Code:</b> {$this->mUserName}<br>
|
|
||||||
";
|
";
|
||||||
break;
|
break;
|
||||||
// case 'DuplicateCapacitorQR':
|
case 'DuplicateCapacitorQR':
|
||||||
// $this->greeting = "
|
$this->greeting = "
|
||||||
// Dear Sir/Madam,<br><br>
|
Dear Sir/Madam,<br><br>
|
||||||
// The scanned <b>Capacitor</b> serial number has already completed the scanning process.<br><br>
|
The scanned <b>Capacitor</b> serial number has already completed the scanning process.<br><br>
|
||||||
// <b>Plant:</b> {$this->mplantName}<br>
|
<b>Plant:</b> {$this->mplantName}<br>
|
||||||
// <b>Invoice Type:</b> {$this->mInvoiceType}<br>
|
<b>Invoice Type:</b> {$this->mInvoiceType}<br>
|
||||||
// <b>Invoice Number:</b> {$this->invoiceNumber}<br>
|
<b>Invoice Number:</b> {$this->invoiceNumber}<br>
|
||||||
// <b>Scanned QR Code:</b> {$this->serial}<br>
|
<b>Scanned QR Code:</b> {$this->serial}<br>
|
||||||
// <b>Employee Code:</b> {$this->mUserName}<br>
|
";
|
||||||
// ";
|
break;
|
||||||
// break;
|
case 'CompletedSerialInvoice':
|
||||||
|
$this->greeting = "
|
||||||
|
Dear Sir/Madam,<br><br>
|
||||||
|
Serial invoice <b>'{$this->invoiceNumber}'</b> completed the scanning process.<br>
|
||||||
|
<b>Plant:</b> {$this->mplantName}<br>
|
||||||
|
<b>Invoice Type:</b> {$this->mInvoiceType}<br>
|
||||||
|
<b>Invoice Number:</b> {$this->invoiceNumber}<br>
|
||||||
|
<b>Scanned QR Code:</b> {$this->serial}<br>
|
||||||
|
";
|
||||||
|
break;
|
||||||
|
case 'CSerialInvoice':
|
||||||
|
$this->greeting = "
|
||||||
|
Dear Sir/Madam,<br><br>
|
||||||
|
Serial invoice <b>'{$this->invoiceNumber}'</b> completed the scanning process.<br>
|
||||||
|
<b>Plant:</b> {$this->mplantName}<br>
|
||||||
|
<b>Invoice Type:</b> {$this->mInvoiceType}<br>
|
||||||
|
<b>Invoice Number:</b> {$this->invoiceNumber}<br>
|
||||||
|
<b>Scanned QR Code:</b> {$this->serial}<br>
|
||||||
|
";
|
||||||
|
break;
|
||||||
|
case 'ComSerInv':
|
||||||
|
$this->greeting = "
|
||||||
|
Dear Sir/Madam,<br><br>
|
||||||
|
Serial invoice <b>'{$this->invoiceNumber}'</b> completed the scanning process.<br>
|
||||||
|
<b>Plant:</b> {$this->mplantName}<br>
|
||||||
|
<b>Invoice Type:</b> {$this->mInvoiceType}<br>
|
||||||
|
<b>Invoice Number:</b> {$this->invoiceNumber}<br>
|
||||||
|
<b>Scanned QR Code:</b> {$this->serial}<br>
|
||||||
|
";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Content(
|
return new Content(
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
|
|
||||||
class CharacteristicValue extends Model
|
|
||||||
{
|
|
||||||
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'plant_id',
|
|
||||||
'line_id',
|
|
||||||
'item_id',
|
|
||||||
'machine_id',
|
|
||||||
'process_order',
|
|
||||||
'coil_number',
|
|
||||||
'status',
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
'created_by',
|
|
||||||
'updated_by',
|
|
||||||
];
|
|
||||||
|
|
||||||
public function plant(): BelongsTo
|
|
||||||
{
|
|
||||||
return $this->belongsTo(Plant::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function line(): BelongsTo
|
|
||||||
{
|
|
||||||
return $this->belongsTo(Line::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function item(): BelongsTo
|
|
||||||
{
|
|
||||||
return $this->belongsTo(Item::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function machine(): BelongsTo
|
|
||||||
{
|
|
||||||
return $this->belongsTo(Machine::class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Policies;
|
|
||||||
|
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
use App\Models\CharacteristicValue;
|
|
||||||
use App\Models\User;
|
|
||||||
|
|
||||||
class CharacteristicValuePolicy
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('view-any CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, CharacteristicValue $characteristicvalue): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('view CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('create CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, CharacteristicValue $characteristicvalue): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('update CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, CharacteristicValue $characteristicvalue): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('delete CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can delete any models.
|
|
||||||
*/
|
|
||||||
public function deleteAny(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('delete-any CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, CharacteristicValue $characteristicvalue): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('restore CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can restore any models.
|
|
||||||
*/
|
|
||||||
public function restoreAny(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('restore-any CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can replicate the model.
|
|
||||||
*/
|
|
||||||
public function replicate(User $user, CharacteristicValue $characteristicvalue): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('replicate CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can reorder the models.
|
|
||||||
*/
|
|
||||||
public function reorder(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('reorder CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, CharacteristicValue $characteristicvalue): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('force-delete CharacteristicValue');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine whether the user can permanently delete any models.
|
|
||||||
*/
|
|
||||||
public function forceDeleteAny(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->checkPermissionTo('force-delete-any CharacteristicValue');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
<?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
|
|
||||||
{
|
|
||||||
$sql = <<<'SQL'
|
|
||||||
CREATE TABLE characteristic_values (
|
|
||||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
|
||||||
plant_id BIGINT NOT NULL,
|
|
||||||
line_id BIGINT NOT NULL,
|
|
||||||
item_id BIGINT NOT NULL,
|
|
||||||
machine_id BIGINT NOT NULL,
|
|
||||||
|
|
||||||
process_order TEXT DEFAULT NULL,
|
|
||||||
coil_number TEXT DEFAULT NULL,
|
|
||||||
status TEXT DEFAULT NULL,
|
|
||||||
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
||||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
|
||||||
created_by TEXT DEFAULT NULL,
|
|
||||||
updated_by TEXT DEFAULT NULL,
|
|
||||||
deleted_at TIMESTAMP,
|
|
||||||
|
|
||||||
FOREIGN KEY (plant_id) REFERENCES plants (id),
|
|
||||||
FOREIGN KEY (line_id) REFERENCES lines (id),
|
|
||||||
FOREIGN KEY (item_id) REFERENCES items (id),
|
|
||||||
FOREIGN KEY (machine_id) REFERENCES machines (id)
|
|
||||||
);
|
|
||||||
SQL;
|
|
||||||
DB::statement($sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('characteristic_values');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<?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
|
|
||||||
{
|
|
||||||
// received_quantity → NUMERIC(10,6)
|
|
||||||
|
|
||||||
DB::statement(<<<SQL
|
|
||||||
ALTER TABLE process_orders
|
|
||||||
ALTER COLUMN received_quantity TYPE NUMERIC(10,6)
|
|
||||||
USING received_quantity::NUMERIC(10,6);
|
|
||||||
SQL);
|
|
||||||
|
|
||||||
// order_quantity → NUMERIC(10,6)
|
|
||||||
|
|
||||||
DB::statement(<<<SQL
|
|
||||||
ALTER TABLE process_orders
|
|
||||||
ALTER COLUMN order_quantity TYPE NUMERIC(10,6)
|
|
||||||
USING order_quantity::NUMERIC(10,6);
|
|
||||||
SQL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
// Schema::table('process_orders', function (Blueprint $table) {
|
|
||||||
// //
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<?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
|
|
||||||
{
|
|
||||||
DB::statement(<<<SQL
|
|
||||||
ALTER TABLE process_orders
|
|
||||||
ALTER COLUMN received_quantity TYPE NUMERIC(10,3)
|
|
||||||
USING received_quantity::NUMERIC(10,3);
|
|
||||||
SQL);
|
|
||||||
|
|
||||||
// order_quantity → NUMERIC(10,6)
|
|
||||||
|
|
||||||
DB::statement(<<<SQL
|
|
||||||
ALTER TABLE process_orders
|
|
||||||
ALTER COLUMN order_quantity TYPE NUMERIC(10,3)
|
|
||||||
USING order_quantity::NUMERIC(10,3);
|
|
||||||
SQL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
// Schema::table('process_orders', function (Blueprint $table) {
|
|
||||||
// //
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"concurrently": "^9.0.1",
|
"concurrently": "^9.0.1",
|
||||||
"laravel-vite-plugin": "^1.2.0",
|
"laravel-vite-plugin": "^1.2.0",
|
||||||
"postcss": "^8.4.47",
|
"postcss": "^8.4.47",
|
||||||
"tailwindcss": "^3.4.13",
|
"tailwindcss": "^4.0.0",
|
||||||
"vite": "^6.0.11"
|
"vite": "^6.0.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
// return $item;
|
// return $item;
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
// Route::post('/user/update', function (Request $request) {
|
// Route::post('/user/update', function (Request $request) {
|
||||||
// // Return the request data as JSON
|
// // Return the request data as JSON
|
||||||
|
|
||||||
@@ -53,6 +54,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
// ]);
|
// ]);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
// Route::middleware('auth.basic')->post('/user/update', function (Request $request) {
|
// Route::middleware('auth.basic')->post('/user/update', function (Request $request) {
|
||||||
// return response()->json([
|
// return response()->json([
|
||||||
// 'message' => 'Authenticated via Basic Auth',
|
// 'message' => 'Authenticated via Basic Auth',
|
||||||
@@ -61,6 +63,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
// ]);
|
// ]);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
Route::post('obd/store-data', [ObdController::class, 'store']);
|
Route::post('obd/store-data', [ObdController::class, 'store']);
|
||||||
|
|
||||||
Route::get('obd/get-test-datas', [ObdController::class, 'get_test']);
|
Route::get('obd/get-test-datas', [ObdController::class, 'get_test']);
|
||||||
@@ -75,7 +78,7 @@ Route::get('/download-qr-pdf/{palletNo}', [PalletController::class, 'downloadQrP
|
|||||||
|
|
||||||
Route::get('/download-reprint-qr-pdf/{palletNo}', [PalletController::class, 'downloadReprintQrPdf'])->name('download-reprint-qr-pdf');
|
Route::get('/download-reprint-qr-pdf/{palletNo}', [PalletController::class, 'downloadReprintQrPdf'])->name('download-reprint-qr-pdf');
|
||||||
|
|
||||||
// Route::get('/download-reprint-process-pdf/{plant}/{item}/{process_order}/{coil_number}/{name}', [PalletController::class, 'downloadReprintProcess'])->name('download-reprint-process-pdf');
|
//Route::get('/download-reprint-process-pdf/{plant}/{item}/{process_order}/{coil_number}', [PalletController::class, 'downloadReprintProcess'])->name('download-reprint-process-pdf');
|
||||||
|
|
||||||
Route::get('/download-qr1-pdf/{palletNo}', [ProductionStickerReprintController::class, 'downloadQrPdf'])->name('download-qr1-pdf');
|
Route::get('/download-qr1-pdf/{palletNo}', [ProductionStickerReprintController::class, 'downloadQrPdf'])->name('download-qr1-pdf');
|
||||||
|
|
||||||
@@ -159,30 +162,18 @@ Route::get('laser/item/get-master-data', [StickerMasterController::class, 'get_m
|
|||||||
|
|
||||||
Route::post('laser/route/data', [CharacteristicsController::class, 'test']);//->withoutMiddleware(VerifyCsrfToken::class)
|
Route::post('laser/route/data', [CharacteristicsController::class, 'test']);//->withoutMiddleware(VerifyCsrfToken::class)
|
||||||
|
|
||||||
// //..Part Validation - Characteristics
|
// Route::get('get-characteristics/master-data', [CharacteristicsController::class, 'getCharacteristicsMaster']);
|
||||||
|
|
||||||
// // Route::get('get-characteristics/master-data', [CharacteristicsController::class, 'getCharacteristicsMaster']);
|
// Route::get('laser/characteristics/get', [CharacteristicsController::class, 'getClassChar']);
|
||||||
|
|
||||||
// // //..Serial or job
|
// Route::get('laser/characteristics/check', [CharacteristicsController::class, 'checkClassChar']);
|
||||||
|
|
||||||
// // Route::get('laser/characteristics/get', [CharacteristicsController::class, 'getClassChar']);
|
// Route::post('laser/characteristics/data', [CharacteristicsController::class, 'storeClassChar']);
|
||||||
|
|
||||||
// // Route::get('laser/characteristics/check', [CharacteristicsController::class, 'checkClassChar']);
|
// Route::post('laser/characteristics/status', [CharacteristicsController::class, 'storeLaserStatus']);
|
||||||
|
|
||||||
// // //..Job or Master - Characteristics
|
|
||||||
|
|
||||||
// // Route::post('laser/characteristics/data', [CharacteristicsController::class, 'storeClassChar']);
|
|
||||||
|
|
||||||
// // //..serial auto or manual
|
|
||||||
|
|
||||||
// // Route::post('laser/characteristics/status', [CharacteristicsController::class, 'storeLaserStatus']);
|
|
||||||
|
|
||||||
// ..Product Characteristics
|
|
||||||
|
|
||||||
Route::get('characteristics/get/master', [CharacteristicsController::class, 'getCharMaster']);
|
Route::get('characteristics/get/master', [CharacteristicsController::class, 'getCharMaster']);
|
||||||
|
|
||||||
Route::post('characteristics/values', [CharacteristicsController::class, 'storeCharValues']);
|
|
||||||
|
|
||||||
//GR Master PDF and Serial Number
|
//GR Master PDF and Serial Number
|
||||||
|
|
||||||
Route::get('grNumber-pdf', [PdfController::class, 'getGRPdf']);
|
Route::get('grNumber-pdf', [PdfController::class, 'getGRPdf']);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Mail;
|
|||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use thiagoalessio\TesseractOCR\TesseractOCR;
|
use thiagoalessio\TesseractOCR\TesseractOCR;
|
||||||
|
use App\Filament\Pages\CustomLogin;
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return redirect('/admin');
|
return redirect('/admin');
|
||||||
@@ -25,8 +25,8 @@ use thiagoalessio\TesseractOCR\TesseractOCR;
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('/part-validation-image/{filename}', function ($filename) {
|
Route::get('/part-validation-image/{plant}/{filename}', function ($plant, $filename) {
|
||||||
$path = storage_path("app/private/uploads/PartValidation/{$filename}");
|
$path = storage_path("app/private/uploads/PartValidation/{$plant}/{$filename}");
|
||||||
|
|
||||||
if (!file_exists($path)) {
|
if (!file_exists($path)) {
|
||||||
abort(404, 'Image not found');
|
abort(404, 'Image not found');
|
||||||
|
|||||||
Reference in New Issue
Block a user