Merge pull request 'ranjith-dev' (#334) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Reviewed-on: #334
This commit was merged in pull request #334.
This commit is contained in:
@@ -10,6 +10,7 @@ use App\Models\Item;
|
||||
use App\Models\Line;
|
||||
use App\Models\Machine;
|
||||
use App\Models\Plant;
|
||||
use App\Models\ProductCharacteristicsMaster;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
@@ -228,7 +229,7 @@ class CharacteristicValueResource extends Resource
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('item.code')
|
||||
->label('Item')
|
||||
->label('Item Code')
|
||||
->searchable()
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
@@ -247,6 +248,17 @@ class CharacteristicValueResource extends Resource
|
||||
->searchable()
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('machine.name')
|
||||
->label('Spec. Value')
|
||||
// ->searchable()
|
||||
->formatStateUsing(function ($record) {
|
||||
$specVal = ProductCharacteristicsMaster::where('plant_id', $record->plant_id)->where('item_id', $record->item_id)->where('line_id', $record->line_id)->where('machine_id', $record->machine_id)->first();
|
||||
|
||||
// return $record?->plant_id.'-'.$record?->item_id.'-'.$record->line_id.'-'.$record?->machine_id;
|
||||
return $specVal?->lower.' - '.$specVal?->upper;
|
||||
})
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('observed_value')
|
||||
->label('Observed value')
|
||||
->searchable()
|
||||
@@ -255,6 +267,15 @@ class CharacteristicValueResource extends Resource
|
||||
Tables\Columns\TextColumn::make('status')
|
||||
->label('Status')
|
||||
->searchable()
|
||||
// ->formatStateUsing(function ($record) {
|
||||
// return empty($record->status == 'Ok') ? 'Ok' : 'Not Ok';
|
||||
// })
|
||||
->color(fn (string $state): string => match ($state) {
|
||||
'Ok' => 'success',
|
||||
'Not Ok' => 'danger',
|
||||
'NotOk' => 'danger',
|
||||
default => 'gray',
|
||||
})
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_by')
|
||||
|
||||
@@ -112,9 +112,9 @@ class CharacteristicsController extends Controller
|
||||
'characteristics_type',
|
||||
'name',
|
||||
'inspection_type',
|
||||
'upper',
|
||||
'lower',
|
||||
'middle',
|
||||
'upper',
|
||||
]);
|
||||
|
||||
if ($characteristics->count() == 0) {
|
||||
@@ -2284,9 +2284,9 @@ class CharacteristicsController extends Controller
|
||||
'name' => $charMaster?->name ?? '',
|
||||
'inspection_type' => $charMaster?->inspection_type ?? '',
|
||||
'characteristics_type' => $charMaster?->characteristics_type ?? '',
|
||||
'upper' => (string) $charMaster?->upper ?? '',
|
||||
'lower' => (string) $charMaster?->lower ?? '',
|
||||
'middle' => (string) $charMaster?->middle ?? '',
|
||||
'upper' => (string) $charMaster?->upper ?? '',
|
||||
];
|
||||
|
||||
return response()->json($output, 200);
|
||||
|
||||
@@ -23,15 +23,24 @@ class CharacteristicApprovalMail extends Mailable
|
||||
public $pdfPath;
|
||||
public $tableData;
|
||||
|
||||
public $pendingApprovers;
|
||||
|
||||
public $approverNameFromMaster;
|
||||
|
||||
public $subjectLine;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($request, $approverName, $level, $pdfPath = null, $characteristics = [])
|
||||
public function __construct($request, $approverName, $level, $pdfPath = null, $pendingApprovers, $approverNameFromMaster, $subjectLine, $characteristics = [])
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->approverName = $approverName;
|
||||
$this->level = $level;
|
||||
$this->pdfPath = $pdfPath;
|
||||
$this->pendingApprovers = $pendingApprovers;
|
||||
$this->approverNameFromMaster = $approverNameFromMaster;
|
||||
$this->subjectLine = $subjectLine;
|
||||
$this->tableData = $characteristics;
|
||||
}
|
||||
|
||||
@@ -41,7 +50,7 @@ class CharacteristicApprovalMail extends Mailable
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: 'Characteristic Approval Mail',
|
||||
subject: $this->subjectLine,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,7 +65,10 @@ class CharacteristicApprovalMail extends Mailable
|
||||
'company' => 'CRI Digital Manufacturing Solutions',
|
||||
'greeting' => 'Dear ' . $this->approverName . ',',
|
||||
'request' => $this->request,
|
||||
'level' => $this->level,
|
||||
'tableData' => $this->tableData,
|
||||
'pendingApprovers' => $this->pendingApprovers,
|
||||
'approverNameFromMaster' => $this->approverNameFromMaster,
|
||||
'approveUrl' => $this->approveUrl(),
|
||||
'holdUrl' => $this->holdUrl(),
|
||||
'rejectUrl' => $this->rejectUrl(),
|
||||
@@ -112,4 +124,7 @@ class CharacteristicApprovalMail extends Mailable
|
||||
)->as(basename($this->pdfPath)),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user