Compare commits
1 Commits
3c34495048
...
renovate/f
| Author | SHA1 | Date | |
|---|---|---|---|
| 06ed997c7e |
@@ -39,8 +39,6 @@ class Scheduler extends Command
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|
||||||
// $this->call('approval:trigger-mails');
|
|
||||||
|
|
||||||
// --- Production Rules ---
|
// --- Production Rules ---
|
||||||
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
||||||
->where('rule_name', 'ProductionMail')
|
->where('rule_name', 'ProductionMail')
|
||||||
@@ -176,7 +174,7 @@ class Scheduler extends Command
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Daily':
|
case 'Daily':
|
||||||
if (now()->format('H:i') == '10:30') {
|
if (now()->format('H:i') == '10:00') {
|
||||||
\Artisan::call('send:invoice-data-report', [
|
\Artisan::call('send:invoice-data-report', [
|
||||||
'schedule_type' => $rule->schedule_type,
|
'schedule_type' => $rule->schedule_type,
|
||||||
'plant' => $rule->plant,
|
'plant' => $rule->plant,
|
||||||
@@ -211,7 +209,7 @@ class Scheduler extends Command
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Daily':
|
case 'Daily':
|
||||||
if (now()->format('H:i') == '10:45') {
|
if (now()->format('H:i') == '10:00') {
|
||||||
\Artisan::call('send:invoice-transit-report', [
|
\Artisan::call('send:invoice-transit-report', [
|
||||||
'schedule_type' => $rule->schedule_type,
|
'schedule_type' => $rule->schedule_type,
|
||||||
'plant' => $rule->plant,
|
'plant' => $rule->plant,
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ class ItemResource extends Resource
|
|||||||
->searchable(),
|
->searchable(),
|
||||||
Tables\Columns\TextColumn::make('category')
|
Tables\Columns\TextColumn::make('category')
|
||||||
->label('Category')
|
->label('Category')
|
||||||
->default('-')
|
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable()
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
@@ -218,7 +217,6 @@ class ItemResource extends Resource
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('uom')
|
Tables\Columns\TextColumn::make('uom')
|
||||||
->label('Unit of Measure')
|
->label('Unit of Measure')
|
||||||
->default('-')
|
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
@@ -239,7 +237,6 @@ class ItemResource extends Resource
|
|||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
])
|
])
|
||||||
->searchPlaceholder('Search Item Code')
|
|
||||||
->filters([
|
->filters([
|
||||||
Tables\Filters\TrashedFilter::make(),
|
Tables\Filters\TrashedFilter::make(),
|
||||||
Filter::make('advanced_filters')
|
Filter::make('advanced_filters')
|
||||||
@@ -259,7 +256,7 @@ class ItemResource extends Resource
|
|||||||
$set('operator_id', null);
|
$set('operator_id', null);
|
||||||
}),
|
}),
|
||||||
Select::make('code')
|
Select::make('code')
|
||||||
->label('Search by Code')
|
->label('Search by Item Code')
|
||||||
->nullable()
|
->nullable()
|
||||||
// ->options(function (callable $get) {
|
// ->options(function (callable $get) {
|
||||||
// $plantId = $get('Plant');
|
// $plantId = $get('Plant');
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ use Filament\Tables\Table;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Illuminate\Validation\Rule;
|
|
||||||
|
|
||||||
// use Illuminate\Validation\Rule;
|
// use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
@@ -94,33 +93,21 @@ class StickerMasterResource extends Resource
|
|||||||
Forms\Components\Select::make('item_id')
|
Forms\Components\Select::make('item_id')
|
||||||
->label('Item Code')
|
->label('Item Code')
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$plantId = $get('plant_id');
|
|
||||||
if (! $get('plant_id')) {
|
if (! $get('plant_id')) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $get('id')) {
|
return \App\Models\Item::where('plant_id', $get('plant_id'))
|
||||||
// whereHas
|
->pluck('code', 'id')
|
||||||
return Item::where('plant_id', $plantId)->whereDoesntHave('stickerMasters')->pluck('code', 'id');
|
->toArray();
|
||||||
} else {
|
|
||||||
$itemId = StickerMaster::where('id', $get('id'))->first()?->item_id;
|
|
||||||
|
|
||||||
return Item::where('plant_id', $plantId)
|
|
||||||
->where(function ($query) use ($itemId) {
|
|
||||||
$query->whereDoesntHave('stickerMasters')
|
|
||||||
->orWhere('id', $itemId);
|
|
||||||
})
|
|
||||||
->pluck('code', 'id');
|
|
||||||
}
|
|
||||||
// return Item::where('plant_id', $plantId)->pluck('code', 'id')->toArray();
|
|
||||||
})
|
|
||||||
->rule(function (callable $get) {
|
|
||||||
return Rule::unique('sticker_masters', 'item_id')
|
|
||||||
->where('plant_id', $get('plant_id'))
|
|
||||||
->ignore($get('id')); // Ignore current record during updates
|
|
||||||
})
|
})
|
||||||
|
// ->rule(function (callable $get) {
|
||||||
|
// return Rule::unique('items', 'code')
|
||||||
|
// ->where('plant_id', $get('plant_id'))
|
||||||
|
// ->ignore($get('id')); // Ignore current record during updates
|
||||||
|
// })
|
||||||
->required()
|
->required()
|
||||||
// ->nullable()
|
->nullable()
|
||||||
->searchable()
|
->searchable()
|
||||||
->reactive()
|
->reactive()
|
||||||
// ->disabled(fn (Get $get) => !empty($get('id')))
|
// ->disabled(fn (Get $get) => !empty($get('id')))
|
||||||
@@ -145,7 +132,7 @@ class StickerMasterResource extends Resource
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$availableItems = Item::where('plant_id', $plantId)->exists();
|
$availableItems = \App\Models\Item::where('plant_id', $plantId)->exists();
|
||||||
if (! $availableItems) {
|
if (! $availableItems) {
|
||||||
$set('item_error', null);
|
$set('item_error', null);
|
||||||
|
|
||||||
@@ -160,7 +147,7 @@ class StickerMasterResource extends Resource
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if item exists for the selected plant
|
// Check if item exists for the selected plant
|
||||||
$item = Item::where('plant_id', $plantId)
|
$item = \App\Models\Item::where('plant_id', $plantId)
|
||||||
->where('id', $itemId)
|
->where('id', $itemId)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
@@ -174,8 +161,7 @@ class StickerMasterResource extends Resource
|
|||||||
->where('item_id', $itemId)
|
->where('item_id', $itemId)
|
||||||
->exists();
|
->exists();
|
||||||
if (! $get('id')) {
|
if (! $get('id')) {
|
||||||
// $set('item_error', $duplicateSticker ? 'Item Code already exists for the selected plant.' : null);
|
$set('item_error', $duplicateSticker ? 'Item Code already exists for the selected plant.' : null);
|
||||||
$set('item_error', null);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->extraAttributes(fn ($get) => [
|
->extraAttributes(fn ($get) => [
|
||||||
@@ -191,7 +177,7 @@ class StickerMasterResource extends Resource
|
|||||||
if ($get('id')) {
|
if ($get('id')) {
|
||||||
$itemId = StickerMaster::where('id', $get('id'))->first()?->item_id;
|
$itemId = StickerMaster::where('id', $get('id'))->first()?->item_id;
|
||||||
if ($itemId) {
|
if ($itemId) {
|
||||||
$item = Item::where('id', $itemId)->first()?->description;
|
$item = \App\Models\Item::where('id', $itemId)->first()?->description;
|
||||||
if ($item) {
|
if ($item) {
|
||||||
$set('item_description', $item);
|
$set('item_description', $item);
|
||||||
} else {
|
} else {
|
||||||
@@ -539,35 +525,27 @@ class StickerMasterResource extends Resource
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('part_validation1')
|
Tables\Columns\TextColumn::make('part_validation1')
|
||||||
->label('Part Validation 1')
|
->label('Part Validation 1')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('part_validation2')
|
Tables\Columns\TextColumn::make('part_validation2')
|
||||||
->label('Part Validation 2')
|
->label('Part Validation 2')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('part_validation3')
|
Tables\Columns\TextColumn::make('part_validation3')
|
||||||
->label('Part Validation 3')
|
->label('Part Validation 3')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('part_validation4')
|
Tables\Columns\TextColumn::make('part_validation4')
|
||||||
->label('Part Validation 4')
|
->label('Part Validation 4')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('part_validation5')
|
Tables\Columns\TextColumn::make('part_validation5')
|
||||||
->label('Part Validation 5')
|
->label('Part Validation 5')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('laser_part_validation1')
|
Tables\Columns\TextColumn::make('laser_part_validation1')
|
||||||
->label('Laser Part Validation 1')
|
->label('Laser Part Validation 1')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('laser_part_validation2')
|
Tables\Columns\TextColumn::make('laser_part_validation2')
|
||||||
->label('Laser Part Validation 2')
|
->label('Laser Part Validation 2')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('panel_box_code')
|
Tables\Columns\TextColumn::make('panel_box_code')
|
||||||
->label('Panel Box Code')
|
->label('Panel Box Code')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('load_rate')
|
Tables\Columns\TextColumn::make('load_rate')
|
||||||
->label('Load Rate')
|
->label('Load Rate')
|
||||||
@@ -575,7 +553,6 @@ class StickerMasterResource extends Resource
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('bundle_quantity')
|
Tables\Columns\TextColumn::make('bundle_quantity')
|
||||||
->label('Bundle Quantity')
|
->label('Bundle Quantity')
|
||||||
->default('-')
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('material_type')
|
Tables\Columns\TextColumn::make('material_type')
|
||||||
->label('Material Type')
|
->label('Material Type')
|
||||||
@@ -610,7 +587,9 @@ class StickerMasterResource extends Resource
|
|||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
])
|
])
|
||||||
->searchPlaceholder('Search Item Code')
|
// ->filters([
|
||||||
|
// Tables\Filters\TrashedFilter::make(),
|
||||||
|
// ])
|
||||||
->filters([
|
->filters([
|
||||||
Tables\Filters\TrashedFilter::make(),
|
Tables\Filters\TrashedFilter::make(),
|
||||||
Filter::make('advanced_filters')
|
Filter::make('advanced_filters')
|
||||||
@@ -656,7 +635,7 @@ class StickerMasterResource extends Resource
|
|||||||
->searchable()
|
->searchable()
|
||||||
->reactive(),
|
->reactive(),
|
||||||
Select::make('material_type')
|
Select::make('material_type')
|
||||||
->label('Select Material Type')
|
->label('Material Type')
|
||||||
->options([
|
->options([
|
||||||
1 => 'Individual',
|
1 => 'Individual',
|
||||||
2 => 'Bundle',
|
2 => 'Bundle',
|
||||||
@@ -665,7 +644,7 @@ class StickerMasterResource extends Resource
|
|||||||
->reactive(),
|
->reactive(),
|
||||||
|
|
||||||
TextInput::make('panel_box_code')
|
TextInput::make('panel_box_code')
|
||||||
->label('Search by Panel Box Code')
|
->label('Panel Box Code')
|
||||||
->placeholder(placeholder: 'Enter Panel Box Code'),
|
->placeholder(placeholder: 'Enter Panel Box Code'),
|
||||||
DateTimePicker::make(name: 'created_from')
|
DateTimePicker::make(name: 'created_from')
|
||||||
->label('Created From')
|
->label('Created From')
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"alperenersoy/filament-export": "^3.0",
|
"alperenersoy/filament-export": "^3.0",
|
||||||
"althinect/filament-spatie-roles-permissions": "^2.3",
|
"althinect/filament-spatie-roles-permissions": "^2.3",
|
||||||
"erag/laravel-pwa": "^1.9",
|
"erag/laravel-pwa": "^1.9",
|
||||||
"filament/filament": "^3.3",
|
"filament/filament": "^5.0",
|
||||||
"intervention/image": "^3.11",
|
"intervention/image": "^3.11",
|
||||||
"irazasyed/telegram-bot-sdk": "^3.15",
|
"irazasyed/telegram-bot-sdk": "^3.15",
|
||||||
"laravel/framework": "^11.31",
|
"laravel/framework": "^11.31",
|
||||||
|
|||||||
Reference in New Issue
Block a user