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.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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']))
  57. <x-filament::link
  58. :href="\App\Filament\Company\Pages\Accounting\Transactions::getUrl()"
  59. target="_blank"
  60. x-on:click="localStorage.setItem('openTransactionId', '{{ $cell['id'] }}')"
  61. color="primary"
  62. icon="heroicon-o-arrow-top-right-on-square"
  63. :icon-position="\Filament\Support\Enums\IconPosition::After"
  64. icon-size="w-4 h-4 min-w-4 min-h-4"
  65. >
  66. {{ $cell['description'] }}
  67. </x-filament::link>
  68. @else
  69. {{ $cell['description'] }}
  70. @endif
  71. @else
  72. {{ $cell }}
  73. @endif
  74. </div>
  75. </x-filament-tables::cell>
  76. @endforeach
  77. </tr>
  78. @endforeach
  79. <!-- Spacer Row -->
  80. @unless($loop->last)
  81. <tr wire:key="category-{{ $categoryIndex }}-spacer">
  82. <x-filament-tables::cell colspan="{{ count($report->getHeaders()) }}">
  83. <div class="px-3 py-2 leading-6 invisible">Hidden Text</div>
  84. </x-filament-tables::cell>
  85. </tr>
  86. @endunless
  87. </tbody>
  88. @endforeach
  89. </table>