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-pdf.blade.php 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. @extends('components.company.reports.layout')
  2. @section('content')
  3. <div class="header">
  4. <div class="title">{{ $report->getTitle() }}</div>
  5. <div class="company-name">{{ $company->name }}</div>
  6. @if($startDate && $endDate)
  7. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  8. @else
  9. <div class="date-range">As of {{ $endDate }}</div>
  10. @endif
  11. </div>
  12. <table class="table-class">
  13. <colgroup>
  14. @if(array_key_exists('account_code', $report->getHeaders()))
  15. <col span="1" style="width: 20%;">
  16. <col span="1" style="width: 55%;">
  17. <col span="1" style="width: 25%;">
  18. @else
  19. <col span="1" style="width: 65%;">
  20. <col span="1" style="width: 35%;">
  21. @endif
  22. </colgroup>
  23. <thead class="table-head">
  24. <tr>
  25. @foreach($report->getHeaders() as $index => $header)
  26. <th class="{{ $report->getAlignmentClass($index) }}">
  27. {{ $header }}
  28. </th>
  29. @endforeach
  30. </tr>
  31. </thead>
  32. @foreach($report->getCategories() as $category)
  33. <tbody>
  34. <tr class="category-header-row">
  35. @foreach($category->header as $index => $header)
  36. <td class="{{ $report->getAlignmentClass($index) }}">
  37. {{ $header }}
  38. </td>
  39. @endforeach
  40. </tr>
  41. @foreach($category->data as $account)
  42. <tr>
  43. @foreach($account as $index => $cell)
  44. <td @class([
  45. $report->getAlignmentClass($index),
  46. 'whitespace-normal' => $index === 'account_name',
  47. 'whitespace-nowrap' => $index !== 'account_name',
  48. ])
  49. >
  50. @if(is_array($cell) && isset($cell['name']))
  51. {{ $cell['name'] }}
  52. @else
  53. {{ $cell }}
  54. @endif
  55. </td>
  56. @endforeach
  57. </tr>
  58. @endforeach
  59. <!-- Category Types -->
  60. @foreach($category->types ?? [] as $type)
  61. <!-- Type Header -->
  62. <tr class="type-header-row">
  63. @foreach($type->header as $index => $header)
  64. <td @class([
  65. $report->getAlignmentClass($index),
  66. 'type-row-indent' => $index === 'account_name',
  67. ])
  68. >
  69. {{ $header }}
  70. </td>
  71. @endforeach
  72. </tr>
  73. <!-- Type Data -->
  74. @foreach($type->data as $typeRow)
  75. <tr class="type-data-row">
  76. @foreach($typeRow as $index => $cell)
  77. <td @class([
  78. $report->getAlignmentClass($index),
  79. 'whitespace-normal type-row-indent' => $index === 'account_name',
  80. 'whitespace-nowrap' => $index !== 'account_name',
  81. ])
  82. >
  83. @if(is_array($cell) && isset($cell['name']))
  84. {{ $cell['name'] }}
  85. @else
  86. {{ $cell }}
  87. @endif
  88. </td>
  89. @endforeach
  90. </tr>
  91. @endforeach
  92. <!-- Type Summary -->
  93. <tr class="type-summary-row">
  94. @foreach($type->summary as $index => $cell)
  95. <td @class([
  96. $report->getAlignmentClass($index),
  97. 'type-row-indent' => $index === 'account_name',
  98. ])
  99. >
  100. {{ $cell }}
  101. </td>
  102. @endforeach
  103. </tr>
  104. @endforeach
  105. <tr class="category-summary-row">
  106. @foreach($category->summary as $index => $cell)
  107. <td @class([
  108. $report->getAlignmentClass($index),
  109. 'underline-bold' => $loop->last,
  110. ])
  111. >
  112. {{ $cell }}
  113. </td>
  114. @endforeach
  115. </tr>
  116. @unless($loop->last && empty($report->getOverallTotals()))
  117. <tr class="spacer-row">
  118. <td colspan="{{ count($report->getHeaders()) }}"></td>
  119. </tr>
  120. @endunless
  121. </tbody>
  122. @endforeach
  123. <tfoot>
  124. <tr class="table-footer-row">
  125. @foreach ($report->getOverallTotals() as $index => $total)
  126. <td class="{{ $report->getAlignmentClass($index) }}">
  127. {{ $total }}
  128. </td>
  129. @endforeach
  130. </tr>
  131. </tfoot>
  132. </table>
  133. <!-- Second Overview Table -->
  134. <table class="table-class" style="margin-top: 40px;">
  135. <colgroup>
  136. @if(array_key_exists('account_code', $report->getHeaders()))
  137. <col span="1" style="width: 20%;">
  138. <col span="1" style="width: 55%;">
  139. <col span="1" style="width: 25%;">
  140. @else
  141. <col span="1" style="width: 65%;">
  142. <col span="1" style="width: 35%;">
  143. @endif
  144. </colgroup>
  145. <thead class="table-head">
  146. <tr>
  147. @foreach($report->getOverviewHeaders() as $index => $header)
  148. <th class="{{ $report->getAlignmentClass($index) }}">
  149. {{ $header }}
  150. </th>
  151. @endforeach
  152. </tr>
  153. </thead>
  154. <!-- Overview Content -->
  155. @foreach($report->getOverview() as $overviewCategory)
  156. <tbody>
  157. <tr class="category-header-row">
  158. @foreach($overviewCategory->header as $index => $header)
  159. <td class="{{ $report->getAlignmentClass($index) }}">
  160. {{ $header }}
  161. </td>
  162. @endforeach
  163. </tr>
  164. @foreach($overviewCategory->data as $overviewAccount)
  165. <tr>
  166. @foreach($overviewAccount as $index => $cell)
  167. <td @class([
  168. $report->getAlignmentClass($index),
  169. 'whitespace-normal' => $index === 'account_name',
  170. 'whitespace-nowrap' => $index !== 'account_name',
  171. ])
  172. >
  173. @if(is_array($cell) && isset($cell['name']))
  174. {{ $cell['name'] }}
  175. @else
  176. {{ $cell }}
  177. @endif
  178. </td>
  179. @endforeach
  180. </tr>
  181. @endforeach
  182. <!-- Summary Row -->
  183. <tr class="category-summary-row">
  184. @foreach($overviewCategory->summary as $index => $summaryCell)
  185. <td class="{{ $report->getAlignmentClass($index) }}">
  186. {{ $summaryCell }}
  187. </td>
  188. @endforeach
  189. </tr>
  190. @if($overviewCategory->header['account_name'] === 'Starting Balance')
  191. @foreach($report->getOverviewAlignedWithColumns() as $summaryRow)
  192. <tr>
  193. @foreach($summaryRow as $index => $summaryCell)
  194. <td @class([
  195. $report->getAlignmentClass($index),
  196. 'font-bold' => $loop->parent->last,
  197. 'underline-thin' => $loop->parent->remaining === 1 && $index === 'net_movement',
  198. 'underline-bold' => $loop->parent->last && $index === 'net_movement',
  199. ])
  200. >
  201. {{ $summaryCell }}
  202. </td>
  203. @endforeach
  204. </tr>
  205. @endforeach
  206. @endif
  207. </tbody>
  208. @endforeach
  209. </table>
  210. @endsection