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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>{{ $report->getTitle() }}</title>
  7. <style>
  8. .font-bold {
  9. font-weight: bold;
  10. }
  11. .category-header-row > td,
  12. .type-header-row > td {
  13. background-color: #f3f4f6;
  14. font-weight: bold;
  15. }
  16. .category-summary-row > td,
  17. .table-footer-row > td,
  18. .type-summary-row > td {
  19. background-color: #ffffff;
  20. font-weight: bold;
  21. }
  22. .cell {
  23. padding-bottom: 5px;
  24. position: relative;
  25. }
  26. .company-name {
  27. font-size: 1.125rem;
  28. font-weight: bold;
  29. }
  30. .date-range {
  31. font-size: 0.875rem;
  32. }
  33. .header {
  34. color: #374151;
  35. margin-bottom: 1rem;
  36. }
  37. .header div + div {
  38. margin-top: 0.5rem;
  39. }
  40. .spacer-row > td {
  41. height: 0.75rem;
  42. }
  43. .table-body tr {
  44. background-color: #ffffff;
  45. }
  46. .table-class {
  47. border-collapse: collapse;
  48. table-layout: fixed;
  49. width: 100%;
  50. }
  51. .table-class .type-row-indent {
  52. padding-left: 1.5rem;
  53. }
  54. .table-class td,
  55. .table-class th {
  56. border-bottom: 1px solid #d1d5db;
  57. color: #374151;
  58. font-size: 0.75rem;
  59. line-height: 1rem;
  60. padding: 0.75rem;
  61. }
  62. .table-head {
  63. display: table-row-group;
  64. }
  65. .text-center {
  66. text-align: center;
  67. }
  68. .text-left {
  69. text-align: left;
  70. }
  71. .text-right {
  72. text-align: right;
  73. }
  74. .title {
  75. font-size: 1.5rem;
  76. }
  77. .table-class .underline-bold {
  78. border-bottom: 2px solid #374151;
  79. }
  80. .table-class .underline-thin {
  81. border-bottom: 1px solid #374151;
  82. }
  83. .whitespace-normal {
  84. white-space: normal;
  85. }
  86. .whitespace-nowrap {
  87. white-space: nowrap;
  88. }
  89. table tfoot {
  90. display: table-row-group;
  91. }
  92. </style>
  93. </head>
  94. <body>
  95. <div class="header">
  96. <div class="title">{{ $report->getTitle() }}</div>
  97. <div class="company-name">{{ $company->name }}</div>
  98. @if($startDate && $endDate)
  99. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  100. @else
  101. <div class="date-range">As of {{ $endDate }}</div>
  102. @endif
  103. </div>
  104. <table class="table-class">
  105. <colgroup>
  106. @if(array_key_exists('account_code', $report->getHeaders()))
  107. <col span="1" style="width: 20%;">
  108. <col span="1" style="width: 55%;">
  109. <col span="1" style="width: 25%;">
  110. @else
  111. <col span="1" style="width: 65%;">
  112. <col span="1" style="width: 35%;">
  113. @endif
  114. </colgroup>
  115. <thead class="table-head">
  116. <tr>
  117. @foreach($report->getHeaders() as $index => $header)
  118. <th class="{{ $report->getAlignmentClass($index) }}">
  119. {{ $header }}
  120. </th>
  121. @endforeach
  122. </tr>
  123. </thead>
  124. @foreach($report->getCategories() as $category)
  125. <tbody>
  126. <tr class="category-header-row">
  127. @foreach($category->header as $index => $header)
  128. <td class="{{ $report->getAlignmentClass($index) }}">
  129. {{ $header }}
  130. </td>
  131. @endforeach
  132. </tr>
  133. @foreach($category->data as $account)
  134. <tr>
  135. @foreach($account as $index => $cell)
  136. <td @class([
  137. $report->getAlignmentClass($index),
  138. 'whitespace-normal' => $index === 'account_name',
  139. 'whitespace-nowrap' => $index !== 'account_name',
  140. ])
  141. >
  142. @if(is_array($cell) && isset($cell['name']))
  143. {{ $cell['name'] }}
  144. @else
  145. {{ $cell }}
  146. @endif
  147. </td>
  148. @endforeach
  149. </tr>
  150. @endforeach
  151. <!-- Category Types -->
  152. @foreach($category->types ?? [] as $type)
  153. <!-- Type Header -->
  154. <tr class="type-header-row">
  155. @foreach($type->header as $index => $header)
  156. <td @class([
  157. $report->getAlignmentClass($index),
  158. 'type-row-indent' => $index === 'account_name',
  159. ])
  160. >
  161. {{ $header }}
  162. </td>
  163. @endforeach
  164. </tr>
  165. <!-- Type Data -->
  166. @foreach($type->data as $typeRow)
  167. <tr class="type-data-row">
  168. @foreach($typeRow as $index => $cell)
  169. <td @class([
  170. $report->getAlignmentClass($index),
  171. 'whitespace-normal type-row-indent' => $index === 'account_name',
  172. 'whitespace-nowrap' => $index !== 'account_name',
  173. ])
  174. >
  175. @if(is_array($cell) && isset($cell['name']))
  176. {{ $cell['name'] }}
  177. @else
  178. {{ $cell }}
  179. @endif
  180. </td>
  181. @endforeach
  182. </tr>
  183. @endforeach
  184. <!-- Type Summary -->
  185. <tr class="type-summary-row">
  186. @foreach($type->summary as $index => $cell)
  187. <td @class([
  188. $report->getAlignmentClass($index),
  189. 'type-row-indent' => $index === 'account_name',
  190. ])
  191. >
  192. {{ $cell }}
  193. </td>
  194. @endforeach
  195. </tr>
  196. @endforeach
  197. <tr class="category-summary-row">
  198. @foreach($category->summary as $index => $cell)
  199. <td @class([
  200. 'cell',
  201. $report->getAlignmentClass($index),
  202. 'underline-bold' => $loop->last,
  203. ])
  204. >
  205. {{ $cell }}
  206. </td>
  207. @endforeach
  208. </tr>
  209. @unless($loop->last && empty($report->getOverallTotals()))
  210. <tr class="spacer-row">
  211. <td colspan="{{ count($report->getHeaders()) }}"></td>
  212. </tr>
  213. @endunless
  214. </tbody>
  215. @endforeach
  216. <tfoot>
  217. <tr class="table-footer-row">
  218. @foreach ($report->getOverallTotals() as $index => $total)
  219. <td class="{{ $report->getAlignmentClass($index) }}">
  220. {{ $total }}
  221. </td>
  222. @endforeach
  223. </tr>
  224. </tfoot>
  225. </table>
  226. <!-- Second Overview Table -->
  227. <table class="table-class">
  228. <colgroup>
  229. @if(array_key_exists('account_code', $report->getHeaders()))
  230. <col span="1" style="width: 20%;">
  231. <col span="1" style="width: 55%;">
  232. <col span="1" style="width: 25%;">
  233. @else
  234. <col span="1" style="width: 65%;">
  235. <col span="1" style="width: 35%;">
  236. @endif
  237. </colgroup>
  238. <thead class="table-head">
  239. <tr>
  240. @foreach($report->getOverviewHeaders() as $index => $header)
  241. <th class="{{ $report->getAlignmentClass($index) }}">
  242. {{ $header }}
  243. </th>
  244. @endforeach
  245. </tr>
  246. </thead>
  247. <!-- Overview Content -->
  248. @foreach($report->getOverview() as $overviewCategory)
  249. <tbody>
  250. <tr class="category-header-row">
  251. @foreach($overviewCategory->header as $index => $header)
  252. <td class="{{ $report->getAlignmentClass($index) }}">
  253. {{ $header }}
  254. </td>
  255. @endforeach
  256. </tr>
  257. @foreach($overviewCategory->data as $overviewAccount)
  258. <tr>
  259. @foreach($overviewAccount as $index => $cell)
  260. <td @class([
  261. $report->getAlignmentClass($index),
  262. 'whitespace-normal' => $index === 'account_name',
  263. 'whitespace-nowrap' => $index !== 'account_name',
  264. ])
  265. >
  266. @if(is_array($cell) && isset($cell['name']))
  267. {{ $cell['name'] }}
  268. @else
  269. {{ $cell }}
  270. @endif
  271. </td>
  272. @endforeach
  273. </tr>
  274. @endforeach
  275. <!-- Summary Row -->
  276. <tr class="category-summary-row">
  277. @foreach($overviewCategory->summary as $index => $summaryCell)
  278. <td class="{{ $report->getAlignmentClass($index) }}">
  279. {{ $summaryCell }}
  280. </td>
  281. @endforeach
  282. </tr>
  283. @if($overviewCategory->header['account_name'] === 'Starting Balance')
  284. @foreach($report->getOverviewAlignedWithColumns() as $summaryRow)
  285. <tr>
  286. @foreach($summaryRow as $index => $summaryCell)
  287. <td @class([
  288. 'cell',
  289. $report->getAlignmentClass($index),
  290. 'font-bold' => $loop->parent->last,
  291. 'underline-thin' => $loop->parent->remaining === 1 && $index === 'net_movement',
  292. 'underline-bold' => $loop->parent->last && $index === 'net_movement',
  293. ])
  294. >
  295. {{ $summaryCell }}
  296. </td>
  297. @endforeach
  298. </tr>
  299. @endforeach
  300. @endif
  301. </tbody>
  302. @endforeach
  303. </table>
  304. </body>
  305. </html>