|
@@ -21,6 +21,22 @@ class InvoiceOverview extends EnhancedStatsOverviewWidget
|
21
|
21
|
|
22
|
22
|
protected function getStats(): array
|
23
|
23
|
{
|
|
24
|
+ $activeTab = $this->activeTab;
|
|
25
|
+
|
|
26
|
+ if ($activeTab === 'draft') {
|
|
27
|
+ return [
|
|
28
|
+ EnhancedStatsOverviewWidget\EnhancedStat::make('Total Unpaid', '-')
|
|
29
|
+ ->suffix('')
|
|
30
|
+ ->description(''),
|
|
31
|
+ EnhancedStatsOverviewWidget\EnhancedStat::make('Due Within 30 Days', '-')
|
|
32
|
+ ->suffix(''),
|
|
33
|
+ EnhancedStatsOverviewWidget\EnhancedStat::make('Average Payment Time', '-')
|
|
34
|
+ ->suffix(''),
|
|
35
|
+ EnhancedStatsOverviewWidget\EnhancedStat::make('Average Invoice Total', '-')
|
|
36
|
+ ->suffix(''),
|
|
37
|
+ ];
|
|
38
|
+ }
|
|
39
|
+
|
24
|
40
|
$unpaidInvoices = $this->getPageTableQuery()->unpaid();
|
25
|
41
|
|
26
|
42
|
$amountUnpaid = $unpaidInvoices->get()->sumMoneyInDefaultCurrency('amount_due');
|