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.

cash-flow-statement.blade.php 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <table class="w-full table-fixed divide-y divide-gray-200 dark:divide-white/5">
  2. <colgroup>
  3. @if(array_key_exists('account_code', $report->getHeaders()))
  4. <col span="1" style="width: 20%;">
  5. <col span="1" style="width: 55%;">
  6. <col span="1" style="width: 25%;">
  7. @else
  8. <col span="1" style="width: 65%;">
  9. <col span="1" style="width: 35%;">
  10. @endif
  11. </colgroup>
  12. <x-company.tables.header :headers="$report->getHeaders()" :alignment-class="[$report, 'getAlignmentClass']"/>
  13. @foreach($report->getCategories() as $accountCategory)
  14. <tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
  15. <x-company.tables.category-header :category-headers="$accountCategory->header"
  16. :alignment-class="[$report, 'getAlignmentClass']"/>
  17. @foreach($accountCategory->data as $categoryAccount)
  18. <tr>
  19. @foreach($categoryAccount as $accountIndex => $categoryAccountCell)
  20. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountIndex)">
  21. @if(is_array($categoryAccountCell) && isset($categoryAccountCell['name']))
  22. @if($categoryAccountCell['name'] === 'Retained Earnings' && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
  23. <x-filament::link
  24. color="primary"
  25. target="_blank"
  26. icon="heroicon-o-arrow-top-right-on-square"
  27. :icon-position="\Filament\Support\Enums\IconPosition::After"
  28. :icon-size="\Filament\Support\Enums\IconSize::Small"
  29. href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
  30. 'startDate' => $categoryAccountCell['start_date'],
  31. 'endDate' => $categoryAccountCell['end_date']
  32. ]) }}"
  33. >
  34. {{ $categoryAccountCell['name'] }}
  35. </x-filament::link>
  36. @elseif(isset($categoryAccountCell['id']) && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date']))
  37. <x-filament::link
  38. color="primary"
  39. target="_blank"
  40. icon="heroicon-o-arrow-top-right-on-square"
  41. :icon-position="\Filament\Support\Enums\IconPosition::After"
  42. :icon-size="\Filament\Support\Enums\IconSize::Small"
  43. href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
  44. 'startDate' => $categoryAccountCell['start_date'],
  45. 'endDate' => $categoryAccountCell['end_date'],
  46. 'selectedAccount' => $categoryAccountCell['id']
  47. ]) }}"
  48. >
  49. {{ $categoryAccountCell['name'] }}
  50. </x-filament::link>
  51. @else
  52. {{ $categoryAccountCell['name'] }}
  53. @endif
  54. @else
  55. {{ $categoryAccountCell }}
  56. @endif
  57. </x-company.tables.cell>
  58. @endforeach
  59. </tr>
  60. @endforeach
  61. @foreach($accountCategory->types as $accountType)
  62. <tr class="bg-gray-50 dark:bg-white/5">
  63. @foreach($accountType->header as $accountTypeHeaderIndex => $accountTypeHeaderCell)
  64. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountTypeHeaderIndex)"
  65. :indent="$accountTypeHeaderIndex === 'account_name'" bold="true">
  66. {{ $accountTypeHeaderCell }}
  67. </x-company.tables.cell>
  68. @endforeach
  69. </tr>
  70. @foreach($accountType->data as $typeAccount)
  71. <tr>
  72. @foreach($typeAccount as $accountIndex => $typeAccountCell)
  73. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountIndex)"
  74. :indent="$accountIndex === 'account_name'">
  75. @if(is_array($typeAccountCell) && isset($typeAccountCell['name']))
  76. @if($typeAccountCell['name'] === 'Retained Earnings' && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date']))
  77. <x-filament::link
  78. color="primary"
  79. target="_blank"
  80. icon="heroicon-o-arrow-top-right-on-square"
  81. :icon-position="\Filament\Support\Enums\IconPosition::After"
  82. :icon-size="\Filament\Support\Enums\IconSize::Small"
  83. href="{{ \App\Filament\Company\Pages\Reports\IncomeStatement::getUrl([
  84. 'startDate' => $typeAccountCell['start_date'],
  85. 'endDate' => $typeAccountCell['end_date']
  86. ]) }}"
  87. >
  88. {{ $typeAccountCell['name'] }}
  89. </x-filament::link>
  90. @elseif(isset($typeAccountCell['id']) && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date']))
  91. <x-filament::link
  92. color="primary"
  93. target="_blank"
  94. icon="heroicon-o-arrow-top-right-on-square"
  95. :icon-position="\Filament\Support\Enums\IconPosition::After"
  96. :icon-size="\Filament\Support\Enums\IconSize::Small"
  97. href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
  98. 'startDate' => $typeAccountCell['start_date'],
  99. 'endDate' => $typeAccountCell['end_date'],
  100. 'selectedAccount' => $typeAccountCell['id']
  101. ]) }}"
  102. >
  103. {{ $typeAccountCell['name'] }}
  104. </x-filament::link>
  105. @else
  106. {{ $typeAccountCell['name'] }}
  107. @endif
  108. @else
  109. {{ $typeAccountCell }}
  110. @endif
  111. </x-company.tables.cell>
  112. @endforeach
  113. </tr>
  114. @endforeach
  115. <tr>
  116. @foreach($accountType->summary as $accountTypeSummaryIndex => $accountTypeSummaryCell)
  117. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountTypeSummaryIndex)"
  118. :indent="$accountTypeSummaryIndex === 'account_name'" bold="true">
  119. {{ $accountTypeSummaryCell }}
  120. </x-company.tables.cell>
  121. @endforeach
  122. </tr>
  123. @endforeach
  124. <tr>
  125. @foreach($accountCategory->summary as $accountCategorySummaryIndex => $accountCategorySummaryCell)
  126. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($accountCategorySummaryIndex)"
  127. bold="true" :underline-bold="$loop->last">
  128. {{ $accountCategorySummaryCell }}
  129. </x-company.tables.cell>
  130. @endforeach
  131. </tr>
  132. <tr>
  133. <td colspan="{{ count($report->getHeaders()) }}">
  134. <div class="min-h-12"></div>
  135. </td>
  136. </tr>
  137. </tbody>
  138. @endforeach
  139. <x-company.tables.footer :totals="$report->getOverallTotals()" :alignment-class="[$report, 'getAlignmentClass']"/>
  140. </table>
  141. <table class="w-full table-fixed divide-y border-t divide-gray-200 dark:divide-white/5">
  142. <colgroup>
  143. @if(array_key_exists('account_code', $report->getHeaders()))
  144. <col span="1" style="width: 20%;">
  145. <col span="1" style="width: 55%;">
  146. <col span="1" style="width: 25%;">
  147. @else
  148. <col span="1" style="width: 65%;">
  149. <col span="1" style="width: 35%;">
  150. @endif
  151. </colgroup>
  152. <x-company.tables.header :headers="$report->getOverviewHeaders()"
  153. :alignment-class="[$report, 'getAlignmentClass']"/>
  154. @foreach($report->getOverview() as $overviewCategory)
  155. <tbody class="divide-y divide-gray-200 whitespace-nowrap dark:divide-white/5">
  156. <x-company.tables.category-header :category-headers="$overviewCategory->header"
  157. :alignment-class="[$report, 'getAlignmentClass']"/>
  158. @foreach($overviewCategory->data as $overviewAccount)
  159. <tr>
  160. @foreach($overviewAccount as $overviewIndex => $overviewCell)
  161. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($overviewIndex)">
  162. @if(is_array($overviewCell) && isset($overviewCell['name']))
  163. @if(isset($overviewCell['id']) && isset($overviewCell['start_date']) && isset($overviewCell['end_date']))
  164. <x-filament::link
  165. color="primary"
  166. target="_blank"
  167. icon="heroicon-o-arrow-top-right-on-square"
  168. :icon-position="\Filament\Support\Enums\IconPosition::After"
  169. :icon-size="\Filament\Support\Enums\IconSize::Small"
  170. href="{{ \App\Filament\Company\Pages\Reports\AccountTransactions::getUrl([
  171. 'startDate' => $overviewCell['start_date'],
  172. 'endDate' => $overviewCell['end_date'],
  173. 'selectedAccount' => $overviewCell['id']
  174. ]) }}"
  175. >
  176. {{ $overviewCell['name'] }}
  177. </x-filament::link>
  178. @else
  179. {{ $overviewCell['name'] }}
  180. @endif
  181. @else
  182. {{ $overviewCell }}
  183. @endif
  184. </x-company.tables.cell>
  185. @endforeach
  186. </tr>
  187. @endforeach
  188. <tr>
  189. @foreach($overviewCategory->summary as $overviewSummaryIndex => $overviewSummaryCell)
  190. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($overviewSummaryIndex)" bold="true">
  191. {{ $overviewSummaryCell }}
  192. </x-company.tables.cell>
  193. @endforeach
  194. </tr>
  195. @if($overviewCategory->header['account_name'] === 'Starting Balance')
  196. @foreach($report->getOverviewAlignedWithColumns() as $summaryRow)
  197. <tr>
  198. @foreach($summaryRow as $summaryIndex => $summaryCell)
  199. <x-company.tables.cell :alignment-class="$report->getAlignmentClass($summaryIndex)"
  200. :bold="$loop->parent->last"
  201. :underline-bold="$loop->parent->last && $summaryIndex === 'net_movement'"
  202. :underline-thin="$loop->parent->remaining === 1 && $summaryIndex === 'net_movement'"
  203. >
  204. {{ $summaryCell }}
  205. </x-company.tables.cell>
  206. @endforeach
  207. </tr>
  208. @endforeach
  209. @endif
  210. </tbody>
  211. @endforeach
  212. </table>