|
@@ -41,6 +41,8 @@ abstract class BaseReportPage extends Page
|
41
|
41
|
|
42
|
42
|
public Company $company;
|
43
|
43
|
|
|
44
|
+ public bool $reportLoaded = false;
|
|
45
|
+
|
44
|
46
|
#[Session]
|
45
|
47
|
public array $toggledTableColumns = [];
|
46
|
48
|
|
|
@@ -63,8 +65,6 @@ abstract class BaseReportPage extends Page
|
63
|
65
|
|
64
|
66
|
$this->loadDefaultDateRange();
|
65
|
67
|
|
66
|
|
- $this->loadReportData();
|
67
|
|
-
|
68
|
68
|
$this->loadDefaultTableColumnToggleState();
|
69
|
69
|
}
|
70
|
70
|
|
|
@@ -94,6 +94,7 @@ abstract class BaseReportPage extends Page
|
94
|
94
|
public function loadReportData(): void
|
95
|
95
|
{
|
96
|
96
|
unset($this->report);
|
|
97
|
+ $this->reportLoaded = true;
|
97
|
98
|
}
|
98
|
99
|
|
99
|
100
|
protected function loadDefaultTableColumnToggleState(): void
|
|
@@ -142,8 +143,12 @@ abstract class BaseReportPage extends Page
|
142
|
143
|
}
|
143
|
144
|
|
144
|
145
|
#[Computed(persist: true)]
|
145
|
|
- public function report(): ExportableReport
|
|
146
|
+ public function report(): ?ExportableReport
|
146
|
147
|
{
|
|
148
|
+ if ($this->reportLoaded === false) {
|
|
149
|
+ return null;
|
|
150
|
+ }
|
|
151
|
+
|
147
|
152
|
$columns = $this->getToggledColumns();
|
148
|
153
|
$reportDTO = $this->buildReport($columns);
|
149
|
154
|
|