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.

chart.blade.php 5.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <x-filament-panels::page>
  2. <div class="flex flex-col gap-y-6">
  3. <x-filament::tabs>
  4. @foreach($this->categories as $categoryValue => $subtypes)
  5. <x-filament::tabs.item
  6. wire:key="tab-item-{{ $categoryValue }}"
  7. :active="$activeTab === $categoryValue"
  8. wire:click="$set('activeTab', '{{ $categoryValue }}')"
  9. :badge="$subtypes->sum('accounts_count')"
  10. >
  11. {{ $this->getCategoryLabel($categoryValue) }}
  12. </x-filament::tabs.item>
  13. @endforeach
  14. </x-filament::tabs>
  15. @foreach($this->categories as $categoryValue => $subtypes)
  16. @if($activeTab === $categoryValue)
  17. <div class="es-table__container overflow-hidden rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:divide-white/10 dark:bg-gray-900 dark:ring-white/10">
  18. <div class="es-table__header-ctn"></div>
  19. <div class="es-table__content overflow-x-auto">
  20. <table class="es-table table-fixed w-full divide-y divide-gray-200 text-start text-sm dark:divide-white/5">
  21. <colgroup>
  22. <col span="1" style="width: 12.5%;">
  23. <col span="1" style="width: 25%;">
  24. <col span="1" style="width: 40%;">
  25. <col span="1" style="width: 15%;">
  26. <col span="1" style="width: 7.5%;">
  27. </colgroup>
  28. @foreach($subtypes as $subtype)
  29. <tbody class="es-table__rowgroup divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
  30. <!-- Subtype Name Header Row -->
  31. <tr class="es-table__row--header bg-gray-50 dark:bg-white/5">
  32. <td colspan="5" class="es-table__cell px-4 py-4">
  33. <div class="es-table__row-content flex items-center space-x-2">
  34. <span class="es-table__row-title text-gray-800 dark:text-gray-200 font-semibold tracking-wider">
  35. {{ $subtype->name }}
  36. </span>
  37. <x-tooltip
  38. text="{!! $subtype->description !!}"
  39. icon="heroicon-o-question-mark-circle"
  40. placement="right"
  41. maxWidth="300"
  42. />
  43. </div>
  44. </td>
  45. </tr>
  46. <!-- Chart Rows -->
  47. @forelse($subtype->accounts as $account)
  48. @php
  49. $accountBalance = $this->getAccountBalance($account);
  50. @endphp
  51. <tr class="es-table__row">
  52. <td colspan="1" class="es-table__cell px-4 py-4">{{ $account->code }}</td>
  53. <td colspan="1" class="es-table__cell px-4 py-4">{{ $account->name }}</td>
  54. <td colspan="{{ $accountBalance === null ? '2' : '1' }}" class="es-table__cell px-4 py-4">{{ $account->description }}</td>
  55. @if($accountBalance !== null)
  56. <td colspan="1" class="es-table__cell px-4 py-4">
  57. {{ $accountBalance }}
  58. </td>
  59. @endif
  60. <td colspan="1" class="es-table__cell px-4 py-4">
  61. <div>
  62. @if($account->default === false)
  63. {{ ($this->editChartAction)(['chart' => $account->id]) }}
  64. @endif
  65. </div>
  66. </td>
  67. </tr>
  68. @empty
  69. <!-- No Accounts Available Row -->
  70. <tr class="es-table__row">
  71. <td colspan="5" class="es-table__cell px-4 py-4 italic">
  72. {{ __("You haven't added any {$subtype->name} accounts yet.") }}
  73. </td>
  74. </tr>
  75. @endforelse
  76. <!-- Add New Account Row -->
  77. <tr class="es-table__row">
  78. <td colspan="5" class="es-table__cell px-4 py-4">
  79. {{ ($this->createChartAction)(['subtype' => $subtype->id]) }}
  80. </td>
  81. </tr>
  82. </tbody>
  83. @endforeach
  84. </table>
  85. </div>
  86. <div class="es-table__footer-ctn border-t border-gray-200"></div>
  87. </div>
  88. @endif
  89. @endforeach
  90. </div>
  91. </x-filament-panels::page>