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.

Reports.php 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. namespace App\Filament\Company\Pages;
  3. use App\Filament\Company\Pages\Reports\AccountBalances;
  4. use App\Filament\Company\Pages\Reports\AccountsPayableAging;
  5. use App\Filament\Company\Pages\Reports\AccountsReceivableAging;
  6. use App\Filament\Company\Pages\Reports\AccountTransactions;
  7. use App\Filament\Company\Pages\Reports\BalanceSheet;
  8. use App\Filament\Company\Pages\Reports\CashFlowStatement;
  9. use App\Filament\Company\Pages\Reports\IncomeStatement;
  10. use App\Filament\Company\Pages\Reports\TrialBalance;
  11. use App\Filament\Infolists\Components\ReportEntry;
  12. use Filament\Infolists\Components\Section;
  13. use Filament\Infolists\Infolist;
  14. use Filament\Navigation\NavigationItem;
  15. use Filament\Pages\Page;
  16. use Filament\Support\Colors\Color;
  17. class Reports extends Page
  18. {
  19. protected static ?string $navigationIcon = 'heroicon-o-document-chart-bar';
  20. protected static string $view = 'filament.company.pages.reports';
  21. public static function getNavigationItems(): array
  22. {
  23. return [
  24. NavigationItem::make(static::getNavigationLabel())
  25. ->group(static::getNavigationGroup())
  26. ->parentItem(static::getNavigationParentItem())
  27. ->icon(static::getNavigationIcon())
  28. ->activeIcon(static::getActiveNavigationIcon())
  29. ->isActiveWhen(fn (): bool => request()->routeIs([
  30. static::getRouteName(),
  31. static::getRouteName() . '.*',
  32. ]))
  33. ->sort(static::getNavigationSort())
  34. ->badge(static::getNavigationBadge(), color: static::getNavigationBadgeColor())
  35. ->badgeTooltip(static::getNavigationBadgeTooltip())
  36. ->url(static::getNavigationUrl()),
  37. ];
  38. }
  39. public function reportsInfolist(Infolist $infolist): Infolist
  40. {
  41. return $infolist
  42. ->state([])
  43. ->schema([
  44. Section::make('Financial Statements')
  45. ->aside()
  46. ->description('Key financial statements that provide an overview of your company’s financial health and performance.')
  47. ->extraAttributes(['class' => 'es-report-card'])
  48. ->schema([
  49. ReportEntry::make('income_statement')
  50. ->hiddenLabel()
  51. ->heading('Income Statement')
  52. ->description('Shows revenue, expenses, and net earnings over a period, indicating overall financial performance.')
  53. ->icon('heroicon-o-chart-bar')
  54. ->iconColor(Color::Purple)
  55. ->url(IncomeStatement::getUrl()),
  56. ReportEntry::make('balance_sheet')
  57. ->hiddenLabel()
  58. ->heading('Balance Sheet')
  59. ->description('Displays your company’s assets, liabilities, and equity at a single point in time, showing overall financial health and stability.')
  60. ->icon('heroicon-o-clipboard-document-list')
  61. ->iconColor(Color::Teal)
  62. ->url(BalanceSheet::getUrl()),
  63. ReportEntry::make('cash_flow_statement')
  64. ->hiddenLabel()
  65. ->heading('Cash Flow Statement')
  66. ->description('Tracks cash inflows and outflows, giving insight into liquidity and cash management over a period.')
  67. ->icon('heroicon-o-document-currency-dollar')
  68. ->iconColor(Color::Cyan)
  69. ->url(CashFlowStatement::getUrl()),
  70. ]),
  71. Section::make('Customer Reports')
  72. ->aside()
  73. ->description('Reports that provide detailed information on your company’s customer transactions and balances.')
  74. ->extraAttributes(['class' => 'es-report-card'])
  75. ->schema([
  76. ReportEntry::make('ar_aging')
  77. ->hiddenLabel()
  78. ->heading('Accounts Receivable Aging')
  79. ->description('Lists outstanding receivables by customer, showing how long invoices have been unpaid.')
  80. ->icon('heroicon-o-calendar-date-range')
  81. ->iconColor(Color::Indigo)
  82. ->url(AccountsReceivableAging::getUrl()),
  83. ReportEntry::make('income_by_customer')
  84. ->hiddenLabel()
  85. ->heading('Income by Customer')
  86. ->description('Shows revenue generated by each customer, helping identify top customers and opportunities for growth.')
  87. ->icon('heroicon-o-arrow-trending-up')
  88. ->iconColor(Color::Emerald)
  89. ->url('#'),
  90. ]),
  91. Section::make('Vendor Reports')
  92. ->aside()
  93. ->description('Reports that provide detailed information on your company’s vendor transactions and balances.')
  94. ->extraAttributes(['class' => 'es-report-card'])
  95. ->schema([
  96. ReportEntry::make('ap_aging')
  97. ->hiddenLabel()
  98. ->heading('Accounts Payable Aging')
  99. ->description('Lists outstanding payables by vendor, showing how long invoices have been unpaid.')
  100. ->icon('heroicon-o-clock')
  101. ->iconColor(Color::Rose)
  102. ->url(AccountsPayableAging::getUrl()),
  103. ReportEntry::make('expenses_by_vendor')
  104. ->hiddenLabel()
  105. ->heading('Expenses by Vendor')
  106. ->description('Shows expenses incurred with each vendor, helping identify top vendors and opportunities for cost savings.')
  107. ->icon('heroicon-o-arrow-trending-down')
  108. ->iconColor(Color::Orange)
  109. ->url('#'),
  110. ]),
  111. Section::make('Detailed Reports')
  112. ->aside()
  113. ->description('Detailed reports that provide a comprehensive view of your company’s financial transactions and account balances.')
  114. ->extraAttributes(['class' => 'es-report-card'])
  115. ->schema([
  116. ReportEntry::make('account_balances')
  117. ->hiddenLabel()
  118. ->heading('Account Balances')
  119. ->description('Lists all accounts and their balances, including starting, debit, credit, net movement, and ending balances.')
  120. ->icon('heroicon-o-calculator')
  121. ->iconColor(Color::Slate)
  122. ->url(AccountBalances::getUrl()),
  123. ReportEntry::make('trial_balance')
  124. ->hiddenLabel()
  125. ->heading('Trial Balance')
  126. ->description('Summarizes all account debits and credits on a specific date to verify the ledger is balanced.')
  127. ->icon('heroicon-o-scale')
  128. ->iconColor(Color::Sky)
  129. ->url(TrialBalance::getUrl()),
  130. ReportEntry::make('account_transactions')
  131. ->hiddenLabel()
  132. ->heading('Account Transactions')
  133. ->description('A record of all transactions, essential for monitoring and reconciling financial activity in the ledger.')
  134. ->icon('heroicon-o-list-bullet')
  135. ->iconColor(Color::Yellow)
  136. ->url(AccountTransactions::getUrl()),
  137. ]),
  138. ]);
  139. }
  140. }