Compare commits
64 Commits
85b214d5f3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 32b213a464 | |||
|
|
aea402cd4c | ||
| 7fbeead3dd | |||
|
|
a6b29e07bb | ||
|
|
8f32671db6 | ||
| b39c298fb4 | |||
|
|
fe5630e7b0 | ||
| cb12cec5af | |||
|
|
107d356745 | ||
| dca11f0349 | |||
|
|
dd56cd7aae | ||
| 835a928ff3 | |||
|
|
d275fb9407 | ||
| 7aee42cc5d | |||
|
|
1f1b690515 | ||
| 0de8916f02 | |||
|
|
56ae97d2a3 | ||
| 105295350b | |||
|
|
41d31fcf3d | ||
| ac1ca537ef | |||
|
|
5e86a51fa5 | ||
| 207527491e | |||
|
|
188cfdac4d | ||
| 7aa244886b | |||
|
|
8f3dfbc290 | ||
| 5189ece56b | |||
|
|
a294ca3ef0 | ||
| bbecb86dc3 | |||
|
|
fdc0aed31c | ||
| a3cec9db06 | |||
|
|
947aacb074 | ||
| 0c6331282e | |||
|
|
b7b5db068b | ||
| 7d8b2d8632 | |||
|
|
d42ae70e46 | ||
|
|
be2e7b00d7 | ||
| 7276765aa4 | |||
|
|
1ce7995105 | ||
| 164a1becac | |||
|
|
d5cd1437fe | ||
| 6ad91c8c96 | |||
|
|
d4d101c5c9 | ||
| a6496b59c1 | |||
|
|
b8cb0aa237 | ||
| 027bacbce8 | |||
|
|
eef42d9736 | ||
| 6a87067387 | |||
|
|
3316c11036 | ||
| 4ac1e9f7c7 | |||
|
|
bf22ef5af0 | ||
| 2f84b269a1 | |||
|
|
52868742c0 | ||
| 8de311cdfb | |||
|
|
30175a71d3 | ||
| f4f10e8748 | |||
|
|
5fe8eeaeee | ||
| d1e4114504 | |||
|
|
fa10ea14fe | ||
| 375bffe6ce | |||
|
|
f0af6853ee | ||
| 3de0ca365c | |||
|
|
d213049fdd | ||
| 16cbe67c8b | |||
|
|
42e926f9c2 |
68
app/Exports/SerialExport.php
Normal file
68
app/Exports/SerialExport.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Illuminate\Support\Collection;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder;
|
||||
use Maatwebsite\Excel\Concerns\WithCustomValueBinder;
|
||||
|
||||
class SerialExport extends DefaultValueBinder implements FromCollection, WithHeadings, WithCustomValueBinder
|
||||
, WithColumnFormatting
|
||||
{
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
|
||||
protected $itemCode;
|
||||
protected $fromSerial;
|
||||
protected $toSerial;
|
||||
|
||||
public function __construct($itemCode, $fromSerial, $toSerial)
|
||||
{
|
||||
$this->itemCode = $itemCode;
|
||||
$this->fromSerial = $fromSerial;
|
||||
$this->toSerial = $toSerial;
|
||||
}
|
||||
|
||||
public function bindValue(Cell $cell, $value)
|
||||
{
|
||||
$cell->setValueExplicit((string) $value, DataType::TYPE_STRING);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function collection()
|
||||
{
|
||||
$rows = [];
|
||||
|
||||
for ($i = $this->fromSerial; $i <= $this->toSerial; $i++) {
|
||||
$rows[] = [
|
||||
'item_code' => $this->itemCode,
|
||||
'serial_number' => str_pad($i, 6, '0', STR_PAD_LEFT),
|
||||
];
|
||||
}
|
||||
|
||||
return new Collection($rows);
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_TEXT,
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Item Code',
|
||||
'Serial Number',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -39,8 +39,6 @@ class ProductionCharacteristicExporter extends Exporter
|
||||
->label('OBSERVED VALUE'),
|
||||
ExportColumn::make('status')
|
||||
->label('STATUS'),
|
||||
ExportColumn::make('inspection_status')
|
||||
->label('INSPECTION STATUS'),
|
||||
ExportColumn::make('remark')
|
||||
->label('REMARK'),
|
||||
ExportColumn::make('created_at')
|
||||
|
||||
@@ -111,6 +111,13 @@ class CustomerPoMasterImporter extends Importer
|
||||
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'.";
|
||||
}
|
||||
|
||||
$existingPoItem = CustomerPoMaster::where('plant_id', $plant->id)->where('item_id', $item->id)->where('customer_po', $this->data['customer_po'])->where('customer_name', $this->data['customer_name'])->first();
|
||||
|
||||
if ($existingPoItem)
|
||||
{
|
||||
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already exist with item code '{$this->data['item']}' and customer name '{$this->data['customer_name']}'.";
|
||||
}
|
||||
|
||||
// $user = User::where('name', $this->data['created_by'])->first();
|
||||
// if (! $user) {
|
||||
// $warnMsg[] = 'User not found';
|
||||
|
||||
@@ -128,7 +128,8 @@ class CycleCount extends Page
|
||||
$operatorName = $user->name;
|
||||
|
||||
$pattern1 = '/^[^#]*#[^#]*#[^#]*#[^#]*#$/';
|
||||
$pattern2 = '/^[^|]*\|[^|]*\|[^|]*$/';
|
||||
// $pattern2 = '/^[^|]*\|[^|]*\|[^|]*$/';
|
||||
$pattern2 = '/^[^|]+\|[^|]+(?:\|[^|]*)?$/';
|
||||
$pattern3 = '/^([a-zA-Z0-9]{6,})\|([1-9][a-zA-Z0-9]{8,})(?:\/[MmPp])?\|?$/';
|
||||
|
||||
// $pattern2 = '/^[^|]+\|[^|]+\|[^|]+\|?$/'; Optional Pipeline at end
|
||||
@@ -678,7 +679,7 @@ class CycleCount extends Page
|
||||
$stock->update([
|
||||
'bin' => $bin,
|
||||
'batch' => $this->batch,
|
||||
// 'doc_no' =>$this->docNo,
|
||||
'doc_no' =>$this->docNo,
|
||||
'scanned_quantity' => $newScannedQty,
|
||||
'scanned_status' => $status,
|
||||
]);
|
||||
@@ -721,6 +722,13 @@ class CycleCount extends Page
|
||||
$parts = explode('|', $value);
|
||||
|
||||
$this->itemCode = $parts[0] ?? null;
|
||||
|
||||
if (count($parts) == 2) {
|
||||
// Format: itemcode|serialnumber
|
||||
$this->sNo = $parts[1];
|
||||
$this->batch = null;
|
||||
} else {
|
||||
// Format: itemcode|value1|value2
|
||||
if (strlen($parts[1]) > strlen($parts[2])) {
|
||||
$this->sNo = $parts[1];
|
||||
$this->batch = $parts[2];
|
||||
@@ -728,6 +736,14 @@ class CycleCount extends Page
|
||||
$this->batch = $parts[1];
|
||||
$this->sNo = $parts[2];
|
||||
}
|
||||
}
|
||||
// if (strlen($parts[1]) > strlen($parts[2])) {
|
||||
// $this->sNo = $parts[1];
|
||||
// $this->batch = $parts[2];
|
||||
// } else {
|
||||
// $this->batch = $parts[1];
|
||||
// $this->sNo = $parts[2];
|
||||
// }
|
||||
|
||||
if (strlen($this->itemCode) < 6) {
|
||||
Notification::make()
|
||||
@@ -759,7 +775,7 @@ class CycleCount extends Page
|
||||
]);
|
||||
|
||||
return;
|
||||
} elseif (strlen($this->batch) < 5) {
|
||||
} elseif (count($parts) !== 2 && strlen($this->batch) < 5) {
|
||||
Notification::make()
|
||||
->title('Unknown Batch')
|
||||
->body("Batch should contain minimum 5 digits '$this->batch'")
|
||||
@@ -927,7 +943,7 @@ class CycleCount extends Page
|
||||
'bin' => $bin,
|
||||
'serial_number' => $this->sNo,
|
||||
'stickerMasterId' => $stickerMasterId,
|
||||
'batch' => $this->batch,
|
||||
'batch' => $this->batch ?? null,
|
||||
'docNo' => $this->docNo,
|
||||
'quantity' => $this->quantity,
|
||||
]),
|
||||
@@ -1240,7 +1256,7 @@ class CycleCount extends Page
|
||||
return;
|
||||
}
|
||||
|
||||
if ($serialAgaPlant->batch != '' || $serialAgaPlant->batch != null) {
|
||||
if (count($parts) !== 2 && ($serialAgaPlant->batch != '' || $serialAgaPlant->batch != null)){
|
||||
|
||||
if ($serialAgaPlant->batch != $this->batch) {
|
||||
|
||||
@@ -1396,7 +1412,7 @@ class CycleCount extends Page
|
||||
'bin' => $bin,
|
||||
'serial_number' => $this->sNo,
|
||||
'stickerMasterId' => $stickerMasterId,
|
||||
'batch' => $this->batch,
|
||||
'batch' => $this->batch ?? null,
|
||||
'docNo' => $this->docNo,
|
||||
'quantity' => $this->quantity,
|
||||
]),
|
||||
@@ -1415,8 +1431,8 @@ class CycleCount extends Page
|
||||
|
||||
$serial->update([
|
||||
'bin' => $bin ?? null,
|
||||
'batch' => $this->batch ?? null,
|
||||
'doc_no' => $this->docNo ?? null,
|
||||
'batch' => count($parts) !== 2 ? $this->batch : $serial->batch,
|
||||
// 'doc_no' => $this->docNo ?? null,
|
||||
'scanned_status' => 'Scanned',
|
||||
'scanned_quantity' => '1',
|
||||
'updated_at' => now(),
|
||||
@@ -2132,6 +2148,7 @@ class CycleCount extends Page
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
|
||||
@@ -82,6 +82,13 @@ class CustomerPoMasterResource extends Resource
|
||||
|
||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('id')
|
||||
->label('ID')
|
||||
->numeric()
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->searchable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->label('Plant')
|
||||
->alignCenter()
|
||||
@@ -110,10 +117,18 @@ class CustomerPoMasterResource extends Resource
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('created_by')
|
||||
->label('Created By')
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_by')
|
||||
->label('Updated By')
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('deleted_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
@@ -12,6 +12,7 @@ use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms\Get;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
@@ -39,18 +40,32 @@ class EquipmentMasterResource extends Resource
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->label('Plant')
|
||||
->reactive()
|
||||
->label('Plant Name')
|
||||
->relationship('plant', 'name')
|
||||
->required()
|
||||
->searchable()
|
||||
->reactive()
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||
})
|
||||
->required(),
|
||||
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
$set('machine_id', null);
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
})
|
||||
->default(function () {
|
||||
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
return ($userHas && strlen($userHas) > 0) ? $userHas : optional(EquipmentMaster::latest()->first())->plant_id;
|
||||
}),
|
||||
Forms\Components\Select::make('machine_id')
|
||||
// ->relationship('machine', 'name')
|
||||
->label('Work Center')
|
||||
->required()
|
||||
->searchable()
|
||||
->reactive()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
@@ -60,15 +75,30 @@ class EquipmentMasterResource extends Resource
|
||||
|
||||
return \App\Models\Machine::where('plant_id', $plantId)->pluck('work_center', 'id');
|
||||
})
|
||||
->required(),
|
||||
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('name')
|
||||
->label('Name'),
|
||||
->label('Name')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('description')
|
||||
->label('Description'),
|
||||
->label('Description')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('make')
|
||||
->label('Make'),
|
||||
->label('Make')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('model')
|
||||
->label('Model'),
|
||||
->label('Model')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('equipment_number')
|
||||
->label('Equipment Number')
|
||||
->reactive()
|
||||
@@ -82,6 +112,8 @@ class EquipmentMasterResource extends Resource
|
||||
];
|
||||
})
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
|
||||
if (! $state) {
|
||||
return;
|
||||
}
|
||||
@@ -108,7 +140,10 @@ class EquipmentMasterResource extends Resource
|
||||
// }
|
||||
// }),
|
||||
Forms\Components\TextInput::make('instrument_serial_number')
|
||||
->label('Instrument Serial Number'),
|
||||
->label('Instrument Serial Number')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
// Forms\Components\DateTimePicker::make('calibrated_on')
|
||||
// ->label('Calibrated On')
|
||||
// ->required(),
|
||||
@@ -128,6 +163,7 @@ class EquipmentMasterResource extends Resource
|
||||
$frequency = $get('frequency') ?? '1';
|
||||
$nextDate = self::calculateNextCalibrationDate($state, $frequency);
|
||||
$set('next_calibration_date', $nextDate);
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
// ->afterStateUpdated(function ($state, callable $get, callable $set) {
|
||||
// $frequency = (int) $get('frequency');
|
||||
@@ -152,6 +188,7 @@ class EquipmentMasterResource extends Resource
|
||||
$calibratedOn = $get('calibrated_on');
|
||||
$nextDate = self::calculateNextCalibrationDate($calibratedOn, $state);
|
||||
$set('next_calibration_date', $nextDate);
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
// ->afterStateUpdated(function ($state, callable $get, callable $set) {
|
||||
// $calibratedOn = $get('calibrated_on');
|
||||
@@ -171,12 +208,21 @@ class EquipmentMasterResource extends Resource
|
||||
Forms\Components\DateTimePicker::make('next_calibration_date')
|
||||
->label('Next Calibration Date')
|
||||
->readOnly()
|
||||
->required(),
|
||||
->required()
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
|
||||
Forms\Components\TextInput::make('calibrated_by')
|
||||
->label('Calibrated By'),
|
||||
->label('Calibrated By')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\Textarea::make('calibration_certificate')
|
||||
->label('Calibration Certificate'),
|
||||
->label('Calibration Certificate')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
|
||||
Forms\Components\FileUpload::make('attachment')
|
||||
->label('PDF Upload')
|
||||
@@ -185,7 +231,10 @@ class EquipmentMasterResource extends Resource
|
||||
->disk('local')
|
||||
->directory('uploads/temp')
|
||||
->preserveFilenames()
|
||||
->reactive(),
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
|
||||
// Forms\Components\Actions::make([
|
||||
// Action::make('uploadNow')
|
||||
@@ -341,7 +390,11 @@ class EquipmentMasterResource extends Resource
|
||||
->label('Created By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
Forms\Components\Hidden::make('updated_by')
|
||||
->label('Updated By'),
|
||||
->label('Updated By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
Forms\Components\TextInput::make('id')
|
||||
->hidden()
|
||||
->readOnly(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -359,7 +412,7 @@ class EquipmentMasterResource extends Resource
|
||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->label('Plant')
|
||||
->label('Plant Name')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('machine.work_center')
|
||||
@@ -413,24 +466,30 @@ class EquipmentMasterResource extends Resource
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_by')
|
||||
->label('Created Bys')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('updated_by')
|
||||
->label('Updated By')
|
||||
->label('Created By')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->label('Created At')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('updated_by')
|
||||
->label('Updated By')
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
->toggleable(isToggledHiddenByDefault: false),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->label('Updated At')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: false),
|
||||
Tables\Columns\TextColumn::make('deleted_at')
|
||||
->label('Deleted At')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
|
||||
@@ -178,6 +178,8 @@ class PanelBoxValidationResource extends Resource
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
|
||||
$pId = $get('line_id');
|
||||
$plantId = $get('plant_id');
|
||||
$plaCode = Plant::find($plantId)?->code;
|
||||
$set('part_validation_type', null);
|
||||
$set('show_validation_image', false);
|
||||
$set('validation1_image_url', null);
|
||||
@@ -384,7 +386,17 @@ class PanelBoxValidationResource extends Resource
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
else if($plantCode != $plaCode){
|
||||
Notification::make()
|
||||
->title('Invalid Plant Code')
|
||||
->body("Scanned plant code doesn't match the selected plant.")
|
||||
->danger()
|
||||
->send();
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
@@ -478,6 +490,7 @@ class PanelBoxValidationResource extends Resource
|
||||
// $set('serial_number', null);
|
||||
// $set('serial_number', $serialNumber);
|
||||
}
|
||||
|
||||
// Check if user input matches the database values
|
||||
foreach ($partValidationColumns as $field) {
|
||||
if ($get("{$field}_visible")) {
|
||||
|
||||
@@ -72,8 +72,6 @@ class CreatePanelBoxValidation extends CreateRecord {
|
||||
->send();
|
||||
$this->halt();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function checkIfHasCharacteristics(array $data)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\ProductionOrderResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ProductionOrderResource;
|
||||
use App\Models\Item;
|
||||
use App\Models\Plant;
|
||||
use App\Models\ProductionOrder;
|
||||
use Filament\Facades\Filament;
|
||||
@@ -282,6 +283,64 @@ class CreateProductionOrder extends CreateRecord
|
||||
}
|
||||
}
|
||||
|
||||
public function exportSerialNo(){
|
||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||
|
||||
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
|
||||
|
||||
$itemId = trim($this->form->getState()['item_id'] ?? '') ?? null;
|
||||
|
||||
$fromSerNo = trim($this->form->getState()['from_serial_number'] ?? '') ?? null;
|
||||
|
||||
$toSerNo = trim($this->form->getState()['to_serial_number'] ?? '') ?? null;
|
||||
|
||||
$plantCode = Plant::where('id', $plantId)->value('code');
|
||||
|
||||
// $itemCode = Item::where('id', $itemId)->value('code');
|
||||
|
||||
if (empty($plantId)) {
|
||||
Notification::make()
|
||||
->title('Plant name cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
} elseif (empty($pOrder)) {
|
||||
Notification::make()
|
||||
->title('Production order cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
elseif (empty($fromSerNo)) {
|
||||
Notification::make()
|
||||
->title('From serial number cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
elseif (empty($toSerNo)) {
|
||||
Notification::make()
|
||||
->title('To serial number cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
|
||||
$pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
|
||||
|
||||
if (! $pOrderExists) {
|
||||
Notification::make()
|
||||
->title("Production Order '{$pOrder}' does not exist to get print!")
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
} else {
|
||||
return redirect()->route('production-orders.exportSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode, 'from_serial_no' => $fromSerNo, 'to_serial_no' => $toSerNo]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getFormActions(): array
|
||||
{
|
||||
return [];
|
||||
|
||||
@@ -157,6 +157,64 @@ class EditProductionOrder extends EditRecord
|
||||
}
|
||||
}
|
||||
|
||||
public function exportSerialNo(){
|
||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||
|
||||
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
|
||||
|
||||
$itemId = trim($this->form->getState()['item_id'] ?? '') ?? null;
|
||||
|
||||
$fromSerNo = trim($this->form->getState()['from_serial_number'] ?? '') ?? null;
|
||||
|
||||
$toSerNo = trim($this->form->getState()['to_serial_number'] ?? '') ?? null;
|
||||
|
||||
$plantCode = Plant::where('id', $plantId)->value('code');
|
||||
|
||||
// $itemCode = Item::where('id', $itemId)->value('code');
|
||||
|
||||
if (empty($plantId)) {
|
||||
Notification::make()
|
||||
->title('Plant name cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
} elseif (empty($pOrder)) {
|
||||
Notification::make()
|
||||
->title('Production order cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
elseif (empty($fromSerNo)) {
|
||||
Notification::make()
|
||||
->title('From serial number cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
elseif (empty($toSerNo)) {
|
||||
Notification::make()
|
||||
->title('To serial number cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
|
||||
$pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
|
||||
|
||||
if (! $pOrderExists) {
|
||||
Notification::make()
|
||||
->title("Production Order '{$pOrder}' does not exist to get print!")
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
} else {
|
||||
return redirect()->route('production-orders.exportSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode, 'from_serial_no' => $fromSerNo, 'to_serial_no' => $toSerNo]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\ProductionOrderResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ProductionOrderResource;
|
||||
use App\Models\Item;
|
||||
use App\Models\Plant;
|
||||
use App\Models\ProductionOrder;
|
||||
use Filament\Actions;
|
||||
@@ -159,6 +160,64 @@ class ViewProductionOrder extends ViewRecord
|
||||
}
|
||||
}
|
||||
|
||||
public function exportSerialNo(){
|
||||
$pOrder = trim($this->form->getState()['production_order'] ?? '') ?? null;
|
||||
|
||||
$plantId = trim($this->form->getState()['plant_id'] ?? '') ?? null;
|
||||
|
||||
$itemId = trim($this->form->getState()['item_id'] ?? '') ?? null;
|
||||
|
||||
$fromSerNo = trim($this->form->getState()['from_serial_number'] ?? '') ?? null;
|
||||
|
||||
$toSerNo = trim($this->form->getState()['to_serial_number'] ?? '') ?? null;
|
||||
|
||||
$plantCode = Plant::where('id', $plantId)->value('code');
|
||||
|
||||
// $itemCode = Item::where('id', $itemId)->value('code');
|
||||
|
||||
if (empty($plantId)) {
|
||||
Notification::make()
|
||||
->title('Plant name cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
} elseif (empty($pOrder)) {
|
||||
Notification::make()
|
||||
->title('Production order cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
elseif (empty($fromSerNo)) {
|
||||
Notification::make()
|
||||
->title('From serial number cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
elseif (empty($toSerNo)) {
|
||||
Notification::make()
|
||||
->title('To serial number cannot be empty!')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
|
||||
$pOrderExists = ProductionOrder::where('plant_id', $plantId)->where('production_order', $pOrder)->first();
|
||||
|
||||
if (! $pOrderExists) {
|
||||
Notification::make()
|
||||
->title("Production Order '{$pOrder}' does not exist to get print!")
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
} else {
|
||||
return redirect()->route('production-orders.exportSerial', ['production_order' => $pOrder, 'plant_code' => $plantCode, 'from_serial_no' => $fromSerNo, 'to_serial_no' => $toSerNo]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -8,6 +8,7 @@ use App\Filament\Resources\VisitorEntryResource\Pages;
|
||||
use App\Filament\Resources\VisitorEntryResource\RelationManagers;
|
||||
use App\Models\VisitorEntry;
|
||||
use App\Models\EmployeeMaster;
|
||||
use App\Models\Plant;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
@@ -63,6 +64,47 @@ class VisitorEntryResource extends Resource
|
||||
return $prefix . $nextNumber;
|
||||
})
|
||||
->readOnly(),
|
||||
Forms\Components\Select::make('inter_unit')
|
||||
->label('Inter Unit Staff Code')
|
||||
->options(
|
||||
EmployeeMaster::distinct()
|
||||
->orderBy('code')
|
||||
->pluck('code', 'code')
|
||||
)
|
||||
->searchable()
|
||||
->reactive()
|
||||
->afterStateUpdated(function (callable $set, callable $get, $state) {
|
||||
|
||||
$code = $get('inter_unit');
|
||||
|
||||
if($code){
|
||||
$employeeExist = EmployeeMaster::where('code', $code)->first();
|
||||
|
||||
$plantId = $employeeExist->plant_id;
|
||||
|
||||
$plant = Plant::find($plantId);
|
||||
|
||||
if ($employeeExist) {
|
||||
$set('name', $employeeExist->name);
|
||||
$set('mobile_number', $employeeExist->mobile_number);
|
||||
$set('company', $plant->name);
|
||||
$set('type', 'InterUnitStaff');
|
||||
} else {
|
||||
$set('name', null);
|
||||
$set('mobile_number', null);
|
||||
$set('company', null);
|
||||
$set('type', null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$set('name', null);
|
||||
$set('mobile_number', null);
|
||||
$set('company', null);
|
||||
$set('type', null);
|
||||
|
||||
}
|
||||
}),
|
||||
Forms\Components\TextInput::make('mobile_number')
|
||||
->label('Mobile Number')
|
||||
->length(10)
|
||||
@@ -72,6 +114,7 @@ class VisitorEntryResource extends Resource
|
||||
'maxlength' => 10,
|
||||
])
|
||||
->required()
|
||||
->readOnly(fn (callable $get) => filled($get('inter_unit')))
|
||||
->extraAttributes([
|
||||
'id' => 'mobile_number_input',
|
||||
'x-data' => '{ value: "" }',
|
||||
@@ -82,9 +125,14 @@ class VisitorEntryResource extends Resource
|
||||
->label('Name')
|
||||
->required()
|
||||
->reactive()
|
||||
->readOnly(fn (callable $get) => filled($get('inter_unit')))
|
||||
->extraInputAttributes([
|
||||
'oninput' => 'this.value = this.value.replace(/[^a-zA-Z\s]/g, "")',
|
||||
]),
|
||||
Forms\Components\TextInput::make('company')
|
||||
->label('Company')
|
||||
->readOnly(fn (callable $get) => filled($get('inter_unit')))
|
||||
->required(),
|
||||
Forms\Components\Select::make('type')
|
||||
->label('Type')
|
||||
->reactive()
|
||||
@@ -92,6 +140,7 @@ class VisitorEntryResource extends Resource
|
||||
'Student' => 'Student',
|
||||
'Consultant' => 'Consultant',
|
||||
'Supplier' => 'Supplier',
|
||||
'InterUnitStaff' => 'Inter Unit Staff',
|
||||
'InterviewCandidates' => 'Interview Candidates',
|
||||
'Customers/Dealers' => 'Customers/Dealers',
|
||||
'Bankers' => 'Bankers',
|
||||
@@ -104,6 +153,17 @@ class VisitorEntryResource extends Resource
|
||||
return $state == 'Other'
|
||||
? $get('other_type')
|
||||
: $state;
|
||||
})
|
||||
->afterStateUpdated(function (callable $set, callable $get, $state) {
|
||||
|
||||
$code = $get('inter_unit');
|
||||
|
||||
if($code){
|
||||
$set('inter_unit', null);
|
||||
$set('name', null);
|
||||
$set('mobile_number', null);
|
||||
$set('company', null);
|
||||
}
|
||||
}),
|
||||
Forms\Components\TextInput::make('other_type')
|
||||
->label('Specify Type')
|
||||
@@ -111,9 +171,6 @@ class VisitorEntryResource extends Resource
|
||||
->visible(fn (callable $get) => $get('type') == 'Other')
|
||||
->required(fn (callable $get) => $get('type') == 'Other')
|
||||
->dehydrated(false),
|
||||
Forms\Components\TextInput::make('company')
|
||||
->label('Company')
|
||||
->required(),
|
||||
Forms\Components\Select::make('department')
|
||||
->label('Employee Department')
|
||||
->options(
|
||||
|
||||
@@ -169,13 +169,19 @@ class WireMasterPackingResource extends Resource
|
||||
->options(function ($get) {
|
||||
|
||||
$plantId = $get('plant_id');
|
||||
$customerPo = $get('customer_po_master_id');
|
||||
|
||||
if (! $plantId) {
|
||||
if (!$plantId || !$customerPo) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$customerPoIds = CustomerPoMaster::where('plant_id', $plantId)
|
||||
->where('customer_po', $customerPo)
|
||||
->pluck('id');
|
||||
|
||||
return WireMasterPacking::query()
|
||||
->where('plant_id', $plantId)
|
||||
->whereIn('customer_po_master_id', $customerPoIds)
|
||||
->where(function ($query) {
|
||||
$query->whereNull('wire_packing_status')
|
||||
->orWhere('wire_packing_status', '');
|
||||
|
||||
@@ -167,6 +167,16 @@ class PalletPrintController extends Controller
|
||||
->where('wire_packing_number', $pallet)
|
||||
->value('customer_po_master_id');
|
||||
|
||||
$masterIds = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
->pluck('customer_po_master_id');
|
||||
|
||||
$customerPo = CustomerPoMaster::whereIn('id', $masterIds)
|
||||
->value('customer_po');
|
||||
|
||||
$customerPoMasterIds = CustomerPoMaster::where('customer_po', $customerPo)
|
||||
->pluck('id');
|
||||
|
||||
$items = WireMasterPacking::with('item')
|
||||
->where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
@@ -185,8 +195,18 @@ class PalletPrintController extends Controller
|
||||
$customerCode = $customer->customer_po ?? '';
|
||||
$customerName = $customer->customer_name ?? '';
|
||||
|
||||
// $totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->where('customer_po_master_id', $customerPoMasterId)
|
||||
// ->select('wire_packing_number')
|
||||
// ->groupBy('wire_packing_number')
|
||||
// ->havingRaw(
|
||||
// 'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
|
||||
// ['Completed']
|
||||
// )
|
||||
// ->count();
|
||||
|
||||
$totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('customer_po_master_id', $customerPoMasterId)
|
||||
->whereIn('customer_po_master_id', $customerPoMasterIds)
|
||||
->select('wire_packing_number')
|
||||
->groupBy('wire_packing_number')
|
||||
->havingRaw(
|
||||
@@ -195,8 +215,20 @@ class PalletPrintController extends Controller
|
||||
)
|
||||
->count();
|
||||
|
||||
// $completedPallets = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->where('customer_po_master_id', $customerPoMasterId)
|
||||
// ->select('wire_packing_number')
|
||||
// ->groupBy('wire_packing_number')
|
||||
// ->havingRaw(
|
||||
// 'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
|
||||
// ['Completed']
|
||||
// )
|
||||
// ->orderBy('wire_packing_number')
|
||||
// ->pluck('wire_packing_number')
|
||||
// ->values();
|
||||
|
||||
$completedPallets = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('customer_po_master_id', $customerPoMasterId)
|
||||
->whereIn('customer_po_master_id', $customerPoMasterIds)
|
||||
->select('wire_packing_number')
|
||||
->groupBy('wire_packing_number')
|
||||
->havingRaw(
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Item;
|
||||
use App\Models\Plant;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -56,6 +57,78 @@ class PlantController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function getItemCode(Request $request){
|
||||
$expectedUser = env('API_AUTH_USER');
|
||||
$expectedPw = env('API_AUTH_PW');
|
||||
$header_auth = $request->header('Authorization');
|
||||
$expectedToken = $expectedUser.':'.$expectedPw;
|
||||
|
||||
if ('Bearer '.$expectedToken != $header_auth) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => 'Invalid authorization token!',
|
||||
], 403);
|
||||
}
|
||||
|
||||
$plantCode = $request->header('plant-code');
|
||||
|
||||
$itemCode = $request->header('item-code');
|
||||
|
||||
if (! $plantCode) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Plant Code value can't be empty",
|
||||
], 404);
|
||||
} elseif (! $itemCode) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => 'Item code cannot be empty!',
|
||||
], 404);
|
||||
}
|
||||
|
||||
$plant = Plant::where('code', $plantCode)->first();
|
||||
$plantId = $plant->id;
|
||||
|
||||
if (! $plant) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Plant Code '{$plantCode}' not found!",
|
||||
], 404);
|
||||
}
|
||||
|
||||
$itemCodeExist = Item::where('code', $itemCode)->first();
|
||||
|
||||
if (! $itemCodeExist) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => 'Item code not found',
|
||||
], 404);
|
||||
}
|
||||
|
||||
$itemCodePlantExist = Item::where('code', $itemCode)->where('plant_id', $plantId)->first();
|
||||
|
||||
if (! $itemCodePlantExist) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Item code not found against plant code '$plantCode'",
|
||||
], 404);
|
||||
}
|
||||
|
||||
if (empty(trim($itemCodePlantExist->description ?? ''))) {
|
||||
return response()->json([
|
||||
'status_code' => 'ERROR',
|
||||
'status_description' => "Description is empty in Item Master against item code '$itemCode'.",
|
||||
], 404);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'status_code' => 'SUCCESS',
|
||||
'status_description' => [
|
||||
'description' => $itemCodePlantExist->description,
|
||||
],
|
||||
], 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,8 @@ use Illuminate\Support\Facades\Log;
|
||||
use Mpdf\QrCode\QrCode;
|
||||
use Mpdf\QrCode\Output;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
use App\Exports\SerialExport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class ProductionOrderController extends Controller
|
||||
{
|
||||
@@ -62,6 +64,7 @@ class ProductionOrderController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$pdf = Pdf::loadView('production-orders.print', compact('stickers'))
|
||||
->setPaper([0, 0, 170, 40]);
|
||||
|
||||
@@ -214,6 +217,24 @@ class ProductionOrderController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function exportSerial($production_order, $plantCode, $fromSerialNo, $toSerialNo){
|
||||
$order = ProductionOrder::where('production_order', $production_order)->first();
|
||||
|
||||
if (!$order) {
|
||||
abort(404, 'Production Order not found');
|
||||
}
|
||||
else{
|
||||
return Excel::download(
|
||||
new SerialExport(
|
||||
$order->item->code,
|
||||
$fromSerialNo,
|
||||
$toSerialNo
|
||||
),
|
||||
'serial_numbers.xlsx'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
|
||||
@@ -151,19 +151,38 @@ public $records = [];
|
||||
|
||||
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
|
||||
|
||||
if (($characteristic?->inspection_type ?? null) === 'Value') {
|
||||
if ($characteristic && is_numeric($value) && (($value >= $characteristic->lower && $value <= $characteristic->upper) || $value == $characteristic->lower || $value == $characteristic->upper)
|
||||
$itemCharacteristic = ProductCharacteristicsMaster::where('plant_id', $this->data['plant_id'])
|
||||
->where('line_id', $this->data['line_id'])
|
||||
->where('name', $characteristic->name)
|
||||
->where('item_id', $itemId)
|
||||
->first();
|
||||
|
||||
// if (($characteristic?->inspection_type ?? null) === 'Value') {
|
||||
// if ($characteristic && is_numeric($value) && (($value >= $characteristic->lower && $value <= $characteristic->upper) || $value == $characteristic->lower || $value == $characteristic->upper)
|
||||
// ) {
|
||||
// $status = 'Ok';
|
||||
// } else {
|
||||
// $status = 'NotOk';
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// $status = $value;
|
||||
// }
|
||||
|
||||
if (($itemCharacteristic?->inspection_type ?? null) === 'Value') {
|
||||
|
||||
if ($itemCharacteristic && is_numeric($value) && $value >= $itemCharacteristic->lower && $value <= $itemCharacteristic->upper
|
||||
) {
|
||||
$status = 'Ok';
|
||||
} else {
|
||||
$status = 'NotOk';
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// $status = $value;
|
||||
// }
|
||||
else {
|
||||
$status = $value;
|
||||
}
|
||||
|
||||
ProductionCharacteristic::create([
|
||||
$prod = ProductionCharacteristic::create([
|
||||
'plant_id' => $this->data['plant_id'] ?? null,
|
||||
'item_id' => $itemId ?? null,
|
||||
'line_id' => $this->data['line_id'] ?? null,
|
||||
@@ -178,6 +197,15 @@ public $records = [];
|
||||
]);
|
||||
}
|
||||
|
||||
if (! $prod) {
|
||||
Notification::make()
|
||||
->title('Failed to save Panel Box Validation')
|
||||
->body('Something went wrong while inserting data.')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->showChecklist = false;
|
||||
|
||||
$this->dispatch('checklist-saved');
|
||||
@@ -214,11 +242,24 @@ public $records = [];
|
||||
|
||||
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
|
||||
|
||||
$itemCode = $this->data['item_id'];
|
||||
|
||||
$itemId = Item::where('plant_id', $characteristic->plant_id)->where('code', $itemCode)->value('id');
|
||||
|
||||
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
|
||||
|
||||
$limit = ProductCharacteristicsMaster::where('plant_id', $characteristic->plant_id)
|
||||
->where('line_id', $characteristic->line_id)
|
||||
->where('name', $characteristic->name)
|
||||
->where('item_id', $itemId)
|
||||
->first();
|
||||
|
||||
if (! $characteristic || ! is_numeric($value)) {
|
||||
return 'Not Ok';
|
||||
}
|
||||
// return ($value >= $characteristic->lower && $value <= $characteristic->upper) ? 'Ok' : 'Not Ok';
|
||||
|
||||
return ($value >= $characteristic->lower && $value <= $characteristic->upper) ? 'Ok' : 'Not Ok';
|
||||
return ($value >= $limit->lower && $value <= $limit->upper) ? 'Ok' : 'Not Ok';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,10 @@ class VisitorMail extends Mailable
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: 'Visitor Arrival Notification',
|
||||
// subject: 'Visitor Arrival Notification',
|
||||
subject: $this->visitor->type === 'InterUnitStaff'
|
||||
? 'Employee Arrival Notification'
|
||||
: 'Visitor Arrival Notification',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,10 @@ class VisitorOutMail extends Mailable
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: 'Visitor Out Notification',
|
||||
// subject: 'Visitor Out Notification',
|
||||
subject: $this->entry->type === 'InterUnitStaff'
|
||||
? 'Employee Out Notification'
|
||||
: 'Visitor Out Notification',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,5 +36,14 @@ class="px-2 py-1 border border-primary-500 text-primary-600 rounded hover:bg-pri
|
||||
Print Item
|
||||
</button>
|
||||
@endcan
|
||||
@can('view export serial number button')
|
||||
<button
|
||||
type="button"
|
||||
wire:click="exportSerialNo"
|
||||
class="px-2 py-1 border border-primary-500 text-primary-600 rounded hover:bg-primary-50 hover:border-primary-700 transition text-sm"
|
||||
>
|
||||
Export Serial Number
|
||||
</button>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,14 +7,6 @@
|
||||
</head>
|
||||
<body style="margin:0;padding:0;background:#f4f6f9;font-family:Arial,Helvetica,sans-serif;">
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Visitor Arrival Notification</title>
|
||||
</head>
|
||||
<body style="margin:0;padding:0;background:#ffffff;font-family:Arial,Helvetica,sans-serif;">
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="background:#ffffff;">
|
||||
<tr>
|
||||
@@ -25,8 +17,14 @@
|
||||
<!-- Header -->
|
||||
<tr>
|
||||
<td style="background:#0f766e;padding:20px;text-align:center;">
|
||||
<h2 style="margin:0;color:#ffffff;">
|
||||
{{-- <h2 style="margin:0;color:#ffffff;">
|
||||
Visitor Arrival Notification
|
||||
</h2> --}}
|
||||
<h2 style="margin:0;color:#ffffff;">
|
||||
{{ $visitor->type === 'InterUnitStaff'
|
||||
? 'Employee Arrival Notification'
|
||||
: 'Visitor Arrival Notification'
|
||||
}}
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -40,7 +38,7 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A visitor has arrived and is waiting to meet you.
|
||||
A {{ $visitor->type === 'InterUnitStaff' ? 'Employee' : 'Visitor' }} has arrived and is waiting to meet you.
|
||||
Please find the details below:
|
||||
</p>
|
||||
|
||||
@@ -48,8 +46,11 @@
|
||||
style="border-collapse:collapse;margin-top:15px;">
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
|
||||
{{-- <td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
|
||||
Visitor Name
|
||||
</td> --}}
|
||||
<td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
|
||||
{{ $visitor->type === 'InterUnitStaff' ? 'Employee Name' : 'Visitor Name' }}
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $visitor->name }}
|
||||
@@ -67,7 +68,7 @@
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Company
|
||||
{{ $visitor->type === 'InterUnitStaff' ? 'Unit' : 'Company' }}
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $visitor->company }}
|
||||
@@ -83,6 +84,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
No of Person
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $visitor->number_of_person }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Visit Time
|
||||
|
||||
@@ -15,8 +15,14 @@
|
||||
<!-- Header -->
|
||||
<tr>
|
||||
<td style="background:#0f766e;padding:20px;text-align:center;">
|
||||
<h2 style="margin:0;color:#ffffff;">
|
||||
{{-- <h2 style="margin:0;color:#ffffff;">
|
||||
Visitor Out Notification
|
||||
</h2> --}}
|
||||
<h2 style="margin:0;color:#ffffff;">
|
||||
{{ $entry->type === 'InterUnitStaff'
|
||||
? 'Employee Out Notification'
|
||||
: 'Visitor Out Notification'
|
||||
}}
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -30,15 +36,18 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A visitor has checked out. Please find the details below:
|
||||
A {{ $entry->type === 'InterUnitStaff' ? 'Employee' : 'Visitor' }} has checked out. Please find the details below:
|
||||
</p>
|
||||
|
||||
<table width="100%" cellpadding="10" cellspacing="0"
|
||||
style="border-collapse:collapse;margin-top:15px;">
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
|
||||
{{-- <td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
|
||||
Visitor Name
|
||||
</td> --}}
|
||||
<td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
|
||||
{{ $entry->type === 'InterUnitStaff' ? 'Employee Name' : 'Visitor Name' }}
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->name ?? '-' }}
|
||||
@@ -55,8 +64,11 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
{{-- <td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Company
|
||||
</td> --}}
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
{{ $entry->type === 'InterUnitStaff' ? 'Unit' : 'Company' }}
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->company ?? '-' }}
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
max-width: <?php echo $isilogoMaxWidth; ?>mm;
|
||||
left: 71mm;"> --}}
|
||||
<img src="{{ $qrBase64 }}"
|
||||
style="position: absolute; bottom: 1.2mm; right: 2mm; width: 8mm; height: 7.2mm;">
|
||||
style="position: absolute; bottom: 0.8mm; right: 2mm; width: 8mm; height: 7.8mm;">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -77,6 +77,17 @@
|
||||
position: absolute;
|
||||
right: 5pt;
|
||||
top: 8pt;
|
||||
/* width: 69pt; */
|
||||
}
|
||||
|
||||
.po-long {
|
||||
font-size: 8pt;
|
||||
font-weight: bold;
|
||||
text-align: left !important;
|
||||
position: absolute;
|
||||
right: 5pt;
|
||||
top: 8pt;
|
||||
width: 69pt;
|
||||
}
|
||||
|
||||
/* .desc {
|
||||
@@ -108,7 +119,10 @@
|
||||
</td>
|
||||
<td class="text">
|
||||
<div class="serial">{{ $sticker['serial'] }}</div>
|
||||
<div class="po">{{ $sticker['production_order'] }}</div>
|
||||
{{-- <div class="po">{{ $sticker['production_order'] }}</div> --}}
|
||||
<div class="{{ strlen($sticker['serial']) > 14 ? 'po-long' : 'po' }}">
|
||||
{{ $sticker['production_order'] }}
|
||||
</div>
|
||||
<div class="desc">{{ $sticker['description'] }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -79,6 +79,16 @@
|
||||
top: 8pt;
|
||||
}
|
||||
|
||||
.po-long {
|
||||
font-size: 8pt;
|
||||
font-weight: bold;
|
||||
text-align: left !important;
|
||||
position: absolute;
|
||||
right: 5pt;
|
||||
top: 8pt;
|
||||
width: 45pt;
|
||||
}
|
||||
|
||||
/* .desc {
|
||||
font-size: 6pt;
|
||||
margin-left: -5pt;
|
||||
@@ -108,7 +118,10 @@
|
||||
</td>
|
||||
<td class="text">
|
||||
<div class="serial">{{ $sticker['serial'] }}</div>
|
||||
<div class="po">{{ $sticker['production_order'] }}</div>
|
||||
{{-- <div class="po">{{ $sticker['production_order'] }}</div> --}}
|
||||
<div class="{{ strlen($sticker['serial']) > 14 ? 'po-long' : 'po' }}">
|
||||
{{ $sticker['production_order'] }}
|
||||
</div>
|
||||
<div class="desc">{{ $sticker['description'] }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -234,3 +234,7 @@ Route::post('file/store', [SapFileController::class, 'store'])->name('file.store
|
||||
Route::get('/print-pallet/{pallet}/{plant}', [PalletPrintController::class, 'print'])->name('print.pallet');
|
||||
|
||||
Route::post('vehicle/entry', [VehicleController::class, 'storeVehicleEntry']);
|
||||
|
||||
//..Item Code
|
||||
|
||||
Route::get('item-code', [PlantController::class, 'getItemCode']);
|
||||
|
||||
@@ -66,6 +66,10 @@ Route::get('production-orders/{production_order}/{plant_code}/printItemSerial',
|
||||
[ProductionOrderController::class, 'printItemSerial']
|
||||
)->name('production-orders.printItemSerial');
|
||||
|
||||
Route::get('production-orders/{production_order}/{plant_code}/{from_serial_no}/{to_serial_no}/exportSerial',
|
||||
[ProductionOrderController::class, 'exportSerial']
|
||||
)->name('production-orders.exportSerial');
|
||||
|
||||
Route::get('/visitor-badge/{id}', [VisitorBadgeController::class, 'show'])
|
||||
->name('visitor.badge');
|
||||
// Route::get('/characteristic/approve', [CharacteristicApprovalController::class, 'approve'])
|
||||
|
||||
Reference in New Issue
Block a user