Added from date and to date in invoice chart dashboard
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled

This commit is contained in:
dhanabalan
2026-05-11 10:53:41 +05:30
parent b7e8182309
commit 25cfaa6479
2 changed files with 61 additions and 25 deletions

View File

@@ -11,6 +11,7 @@ use Filament\Forms\Form;
use Filament\Pages\Page;
use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
use Illuminate\Support\Facades\Auth;
use Filament\Forms\Components\DatePicker;
class InvoiceDashboard extends Page
{
@@ -27,9 +28,13 @@ class InvoiceDashboard extends Page
public function mount(): void
{
session()->forget(['selec_plant', 'select_invoice']);
session()->forget(['from_date']);
session()->forget(['to_date']);
$this->filtersForm->fill([
'plant' => null,
'invoice' => null,
'from_date' => null,
'to_date' => null,
]);
}
@@ -62,9 +67,23 @@ class InvoiceDashboard extends Page
->afterStateUpdated(function ($state) {
session(['select_invoice' => $state]);
$this->dispatch('invoiceChart');
})
}),
DatePicker::make('created_from')
->label('Created From')
->reactive()
->afterStateUpdated(function ($state,callable $set) {
session(['from_date' => $state]);
$this->dispatch('invoiceChart');
}),
DatePicker::make('created_to')
->label('Created To')
->reactive()
->afterStateUpdated(function ($state,callable $set) {
session(['to_date' => $state]);
$this->dispatch('invoiceChart');
}),
])
->columns(2);
->columns(4);
}
public static function getNavigationLabel(): string