Compare commits
2 Commits
6d26307c4a
...
99a95dc150
| Author | SHA1 | Date | |
|---|---|---|---|
| 99a95dc150 | |||
|
|
99afa82c75 |
@@ -118,31 +118,31 @@ class AlertMailRuleResource extends Resource
|
|||||||
->label('All Plants Reports')
|
->label('All Plants Reports')
|
||||||
->afterStateUpdated(fn ($state, callable $set) => $state ? $set('plant', null) : null)
|
->afterStateUpdated(fn ($state, callable $set) => $state ? $set('plant', null) : null)
|
||||||
->reactive(),
|
->reactive(),
|
||||||
Forms\Components\Actions::make([
|
// Forms\Components\Actions::make([
|
||||||
Action::make('sendInvoiceData')
|
// Action::make('sendInvoiceData')
|
||||||
->label('Invoice Data Report')
|
// ->label('Invoice Data Report')
|
||||||
->action(function ($get) {
|
// ->action(function ($get) {
|
||||||
|
|
||||||
$plantIds = AlertMailRule::where('module', 'InvoiceDataReport')
|
// $plantIds = AlertMailRule::where('module', 'InvoiceDataReport')
|
||||||
->orderBy('plant')
|
// ->orderBy('plant')
|
||||||
->pluck('plant')
|
// ->pluck('plant')
|
||||||
->toArray();
|
// ->toArray();
|
||||||
|
|
||||||
foreach ($plantIds as $plantId) {
|
// foreach ($plantIds as $plantId) {
|
||||||
Artisan::call('send:invoice-data-report', [
|
// Artisan::call('send:invoice-data-report', [
|
||||||
'schedule_type' => 'Daily',
|
// 'schedule_type' => 'Daily',
|
||||||
'plant' => $plantId,
|
// 'plant' => $plantId,
|
||||||
]);
|
// ]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Notify user in Filament
|
// // Notify user in Filament
|
||||||
Notification::make()
|
// Notification::make()
|
||||||
->title('Invoice data report sent successfully!')
|
// ->title('Invoice data report sent successfully!')
|
||||||
->success()
|
// ->success()
|
||||||
->send();
|
// ->send();
|
||||||
}),
|
// }),
|
||||||
|
|
||||||
]),
|
// ]),
|
||||||
Forms\Components\Hidden::make('created_by')
|
Forms\Components\Hidden::make('created_by')
|
||||||
->default(fn () => Filament::auth()->user()?->name),
|
->default(fn () => Filament::auth()->user()?->name),
|
||||||
Forms\Components\Hidden::make('updated_by')
|
Forms\Components\Hidden::make('updated_by')
|
||||||
|
|||||||
Reference in New Issue
Block a user