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.

account-transactions.blade.php 4.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <table class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5">
  2. <thead class="divide-y divide-gray-200 dark:divide-white/5">
  3. <tr class="bg-gray-50 dark:bg-white/5">
  4. @foreach($report->getHeaders() as $index => $header)
  5. <th wire:key="header-{{ $index }}"
  6. class="px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6 {{ $report->getAlignmentClass($index) }}">
  7. <span class="text-sm font-semibold text-gray-950 dark:text-white">
  8. {{ $header }}
  9. </span>
  10. </th>
  11. @endforeach
  12. </tr>
  13. </thead>
  14. @foreach($report->getCategories() as $categoryIndex => $category)
  15. <tbody wire:key="category-{{ $categoryIndex }}"
  16. class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
  17. <!-- Category Header -->
  18. <tr class="bg-gray-50 dark:bg-white/5">
  19. <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}" class="text-left">
  20. <div class="px-3 py-2">
  21. @foreach ($category->header as $headerRow)
  22. <div
  23. class="text-sm {{ $loop->first ? 'font-semibold text-gray-950 dark:text-white' : 'text-gray-500 dark:text-white/50' }}">
  24. @foreach ($headerRow as $headerValue)
  25. @if (!empty($headerValue))
  26. {{ $headerValue }}
  27. @endif
  28. @endforeach
  29. </div>
  30. @endforeach
  31. </div>
  32. </x-filament-tables::cell>
  33. </tr>
  34. <!-- Transactions Data -->
  35. @foreach($category->data as $dataIndex => $transaction)
  36. <tr wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}"
  37. @class([
  38. 'bg-gray-50 dark:bg-white/5' => $loop->first || $loop->last || $loop->remaining === 1,
  39. ])
  40. >
  41. @foreach($transaction as $cellIndex => $cell)
  42. <x-filament-tables::cell
  43. wire:key="category-{{ $categoryIndex }}-data-{{ $dataIndex }}-cell-{{ $cellIndex }}"
  44. @class([
  45. $report->getAlignmentClass($cellIndex),
  46. 'whitespace-normal' => $cellIndex === 1,
  47. ])
  48. >
  49. <div
  50. @class([
  51. 'px-3 py-4 text-sm leading-6 text-gray-950 dark:text-white',
  52. 'font-semibold' => $loop->parent->first || $loop->parent->last || $loop->parent->remaining === 1,
  53. ])
  54. >
  55. @if(is_array($cell) && isset($cell['description']))
  56. @if(isset($cell['id']) && $cell['tableAction'])
  57. <x-filament::link
  58. :href="\App\Filament\Company\Pages\Accounting\Transactions::getUrl(parameters: [
  59. 'tableAction' => $cell['tableAction'],
  60. 'tableActionRecord' => $cell['id'],
  61. ])"
  62. target="_blank"
  63. color="primary"
  64. icon="heroicon-o-arrow-top-right-on-square"
  65. :icon-position="\Filament\Support\Enums\IconPosition::After"
  66. icon-size="w-4 h-4 min-w-4 min-h-4"
  67. >
  68. {{ $cell['description'] }}
  69. </x-filament::link>
  70. @else
  71. {{ $cell['description'] }}
  72. @endif
  73. @else
  74. {{ $cell }}
  75. @endif
  76. </div>
  77. </x-filament-tables::cell>
  78. @endforeach
  79. </tr>
  80. @endforeach
  81. <!-- Spacer Row -->
  82. @unless($loop->last)
  83. <tr wire:key="category-{{ $categoryIndex }}-spacer">
  84. <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
  85. <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
  86. </x-filament-tables::cell>
  87. </tr>
  88. @endunless
  89. </tbody>
  90. @endforeach
  91. </table>