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.

income-statement.blade.php 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <x-filament-panels::page>
  2. <x-filament::section>
  3. <form wire:submit="loadReportData">
  4. <div class="flex flex-col md:flex-row items-start md:items-center justify-between gap-4 md:gap-8">
  5. <!-- Form Container -->
  6. <div class="flex-grow">
  7. {{ $this->form }}
  8. </div>
  9. <!-- Grouping Button and Column Toggle -->
  10. <div class="flex flex-col md:flex-row items-start md:items-center gap-4 md:gap-8 flex-shrink-0">
  11. @if($this->hasToggleableColumns())
  12. <x-filament-tables::column-toggle.dropdown
  13. :form="$this->toggleTableColumnForm"
  14. :trigger-action="$this->toggleColumnsAction"
  15. />
  16. @endif
  17. <x-filament::button type="submit" wire:target="loadReportData" class="flex-shrink-0">
  18. Update Report
  19. </x-filament::button>
  20. </div>
  21. </div>
  22. </form>
  23. </x-filament::section>
  24. <x-filament::section>
  25. <!-- Summary Section -->
  26. @if($this->reportLoaded)
  27. <div
  28. class="flex flex-col md:flex-row items-center md:items-end text-center justify-center gap-4 md:gap-8">
  29. @foreach($this->report->getSummary() as $summary)
  30. <div class="text-sm">
  31. <div class="text-gray-600 font-medium mb-2">{{ $summary['label'] }}</div>
  32. @php
  33. $isNetEarnings = $summary['label'] === 'Net Earnings';
  34. $isPositive = money($summary['value'], \App\Utilities\Currency\CurrencyAccessor::getDefaultCurrency())->isPositive();
  35. @endphp
  36. <strong
  37. @class([
  38. 'text-lg',
  39. 'text-green-700' => $isNetEarnings && $isPositive,
  40. 'text-danger-700' => $isNetEarnings && ! $isPositive,
  41. ])
  42. >
  43. {{ $summary['value'] }}
  44. </strong>
  45. </div>
  46. @if(! $loop->last)
  47. <div class="flex items-center justify-center px-2">
  48. <strong class="text-lg">
  49. {{ $loop->remaining === 1 ? '=' : '-' }}
  50. </strong>
  51. </div>
  52. @endif
  53. @endforeach
  54. </div>
  55. @endif
  56. </x-filament::section>
  57. <x-filament-tables::container>
  58. <div class="es-table__header-ctn"></div>
  59. <div wire:init="loadReportData"
  60. class="relative divide-y divide-gray-200 overflow-x-auto dark:divide-white/10 dark:border-t-white/10 min-h-64">
  61. @if($this->reportLoaded)
  62. <div wire:loading.remove wire:target="loadReportData">
  63. @if($this->report)
  64. <x-company.tables.reports.detailed-report :report="$this->report"/>
  65. @endif
  66. </div>
  67. @else
  68. <div class="absolute inset-0 flex items-center justify-center">
  69. <div wire:loading wire:target="loadReportData">
  70. <x-filament::loading-indicator class="p-6 text-primary-700 dark:text-primary-300"/>
  71. </div>
  72. </div>
  73. @endif
  74. </div>
  75. <div class="es-table__footer-ctn border-t border-gray-200"></div>
  76. </x-filament-tables::container>
  77. </x-filament-panels::page>