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

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