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 3.9KB

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