You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. namespace App\Filament\Company\Pages;
  3. use App\Filament\Company\Pages\Reports\AccountBalances;
  4. use App\Filament\Company\Pages\Reports\AccountTransactions;
  5. use App\Filament\Company\Pages\Reports\BalanceSheet;
  6. use App\Filament\Company\Pages\Reports\CashFlowStatement;
  7. use App\Filament\Company\Pages\Reports\IncomeStatement;
  8. use App\Filament\Company\Pages\Reports\TrialBalance;
  9. use App\Filament\Infolists\Components\ReportEntry;
  10. use Filament\Infolists\Components\Section;
  11. use Filament\Infolists\Infolist;
  12. use Filament\Navigation\NavigationItem;
  13. use Filament\Pages\Page;
  14. use Filament\Support\Colors\Color;
  15. class Reports extends Page
  16. {
  17. protected static ?string $navigationIcon = 'heroicon-o-document-chart-bar';
  18. protected static string $view = 'filament.company.pages.reports';
  19. public static function getNavigationItems(): array
  20. {
  21. return [
  22. NavigationItem::make(static::getNavigationLabel())
  23. ->group(static::getNavigationGroup())
  24. ->parentItem(static::getNavigationParentItem())
  25. ->icon(static::getNavigationIcon())
  26. ->activeIcon(static::getActiveNavigationIcon())
  27. ->isActiveWhen(fn (): bool => request()->routeIs([
  28. static::getRouteName(),
  29. static::getRouteName() . '.*',
  30. ]))
  31. ->sort(static::getNavigationSort())
  32. ->badge(static::getNavigationBadge(), color: static::getNavigationBadgeColor())
  33. ->badgeTooltip(static::getNavigationBadgeTooltip())
  34. ->url(static::getNavigationUrl()),
  35. ];
  36. }
  37. public function reportsInfolist(Infolist $infolist): Infolist
  38. {
  39. return $infolist
  40. ->state([])
  41. ->schema([
  42. Section::make('Financial Statements')
  43. ->aside()
  44. ->description('Key financial statements that provide an overview of your company’s financial health and performance.')
  45. ->extraAttributes(['class' => 'es-report-card'])
  46. ->schema([
  47. ReportEntry::make('income_statement')
  48. ->hiddenLabel()
  49. ->heading('Income Statement')
  50. ->description('Shows revenue, expenses, and net earnings over a period, indicating overall financial performance.')
  51. ->icon('heroicon-o-chart-bar')
  52. ->iconColor(Color::Indigo)
  53. ->url(IncomeStatement::getUrl()),
  54. ReportEntry::make('balance_sheet')
  55. ->hiddenLabel()
  56. ->heading('Balance Sheet')
  57. ->description('Displays your company’s assets, liabilities, and equity at a single point in time, showing overall financial health and stability.')
  58. ->icon('heroicon-o-clipboard-document-list')
  59. ->iconColor(Color::Emerald)
  60. ->url(BalanceSheet::getUrl()),
  61. ReportEntry::make('cash_flow_statement')
  62. ->hiddenLabel()
  63. ->heading('Cash Flow Statement')
  64. ->description('Tracks cash inflows and outflows, giving insight into liquidity and cash management over a period.')
  65. ->icon('heroicon-o-document-currency-dollar')
  66. ->iconColor(Color::Cyan)
  67. ->url(CashFlowStatement::getUrl()),
  68. ]),
  69. Section::make('Detailed Reports')
  70. ->aside()
  71. ->description('Detailed reports that provide a comprehensive view of your company’s financial transactions and account balances.')
  72. ->extraAttributes(['class' => 'es-report-card'])
  73. ->schema([
  74. ReportEntry::make('account_balances')
  75. ->hiddenLabel()
  76. ->heading('Account Balances')
  77. ->description('Lists all accounts and their balances, including starting, debit, credit, net movement, and ending balances.')
  78. ->icon('heroicon-o-currency-dollar')
  79. ->iconColor(Color::Teal)
  80. ->url(AccountBalances::getUrl()),
  81. ReportEntry::make('trial_balance')
  82. ->hiddenLabel()
  83. ->heading('Trial Balance')
  84. ->description('Summarizes all account debits and credits on a specific date to verify the ledger is balanced.')
  85. ->icon('heroicon-o-scale')
  86. ->iconColor(Color::Sky)
  87. ->url(TrialBalance::getUrl()),
  88. ReportEntry::make('account_transactions')
  89. ->hiddenLabel()
  90. ->heading('Account Transactions')
  91. ->description('A record of all transactions, essential for monitoring and reconciling financial activity in the ledger.')
  92. ->icon('heroicon-o-adjustments-horizontal')
  93. ->iconColor(Color::Amber)
  94. ->url(AccountTransactions::getUrl()),
  95. ]),
  96. ]);
  97. }
  98. }