Added material type 4 (Bundle Individual) on resource
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-05-25 16:55:55 +05:30
parent dee8246320
commit 5ebbf491f6
2 changed files with 139 additions and 71 deletions

View File

@@ -296,9 +296,10 @@ class StickerMasterResource extends Resource
Forms\Components\Select::make('material_type')
->label('Material Type')
->options([
'1' => 'Individual',
'2' => 'Bundle',
'3' => 'Quantity',
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
])
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
@@ -307,7 +308,7 @@ class StickerMasterResource extends Resource
$set('load_rate', 0);
}
if ($state !== '2') {
if ($state != '2' && $state != '4') {
$set('bundle_quantity', null);
} else {
$set('bundle_quantity', 2);
@@ -319,12 +320,12 @@ class StickerMasterResource extends Resource
Forms\Components\TextInput::make('bundle_quantity')
->label('Bundle Quantity')
->integer()
->readOnly(fn (callable $get) => $get('material_type') !== '2')
->readOnly(fn (callable $get) => $get('material_type') != 2 && $get('material_type') != 4)
->nullable()
->minValue(2)
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get) {
if ($get('material_type') !== '2') {
if ($get('material_type') != 2 && $get('material_type') != 4) {
$set('bundle_quantity', null);
} elseif ($get('bundle_quantity') < 2) {
$set('bundle_quantity', 2);
@@ -655,10 +656,6 @@ class StickerMasterResource extends Resource
->label('Load Rate')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('bundle_quantity')
->label('Bundle Quantity')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('material_type')
->label('Material Type')
->default('-')
@@ -672,9 +669,14 @@ class StickerMasterResource extends Resource
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
default => '-',
};
}),
Tables\Columns\TextColumn::make('bundle_quantity')
->label('Bundle Quantity')
->default('-')
->alignCenter(),
Tables\Columns\TextColumn::make('created_by')
->label('Created By')
->alignCenter()
@@ -754,12 +756,13 @@ class StickerMasterResource extends Resource
->searchable()
->reactive(),
Select::make('material_type')
->label('Select Material Type')
->label('Search by Material Type')
->nullable()
->options([
1 => 'Individual',
2 => 'Bundle',
3 => 'Quantity',
4 => 'Bundle Individual',
])
->searchable()
->reactive(),
@@ -870,6 +873,8 @@ class StickerMasterResource extends Resource
$indicators[] = 'Material Type: Bundle';
} elseif ($data['material_type'] == 3) {
$indicators[] = 'Material Type: Quantity';
} elseif ($data['material_type'] == 4) {
$indicators[] = 'Material Type: Bundle Individual';
}
// $indicators[] = 'Material Type: '.$data['material_type'];
}