Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

report-pdf.blade.php 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. .header {
  9. color: #374151;
  10. margin-bottom: 1rem;
  11. }
  12. .header > * + * {
  13. margin-top: 0.5rem;
  14. }
  15. .table-head {
  16. display: table-row-group;
  17. }
  18. .text-left {
  19. text-align: left;
  20. }
  21. .text-right {
  22. text-align: right;
  23. }
  24. .text-center {
  25. text-align: center;
  26. }
  27. .table-class th,
  28. .table-class td {
  29. color: #374151;
  30. }
  31. .whitespace-normal {
  32. white-space: normal;
  33. }
  34. .whitespace-nowrap {
  35. white-space: nowrap;
  36. }
  37. .title {
  38. font-size: 1.5rem;
  39. }
  40. .company-name {
  41. font-size: 1.125rem;
  42. font-weight: bold;
  43. }
  44. .date-range {
  45. font-size: 0.875rem;
  46. }
  47. .table-class {
  48. width: 100%;
  49. border-collapse: collapse;
  50. }
  51. .table-class th,
  52. .table-class td {
  53. padding: 0.75rem;
  54. font-size: 0.75rem;
  55. line-height: 1rem;
  56. border-bottom: 1px solid #d1d5db; /* Gray border for all rows */
  57. }
  58. .category-header-row > td,
  59. .type-header-row > td {
  60. background-color: #f3f4f6; /* Gray background for category names */
  61. font-weight: bold;
  62. }
  63. .type-header-row > td,
  64. .type-data-row > td,
  65. .type-summary-row > td {
  66. padding-left: 1.5rem; /* Indentation for type rows */
  67. }
  68. .table-body tr {
  69. background-color: #ffffff; /* White background for other rows */
  70. }
  71. .spacer-row > td {
  72. height: 0.75rem;
  73. }
  74. .category-summary-row > td,
  75. .type-summary-row > td,
  76. .table-footer-row > td {
  77. font-weight: bold;
  78. background-color: #ffffff; /* White background for footer */
  79. }
  80. </style>
  81. </head>
  82. <body>
  83. <div class="header">
  84. <div class="title">{{ $report->getTitle() }}</div>
  85. <div class="company-name">{{ $company->name }}</div>
  86. @if($startDate && $endDate)
  87. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  88. @else
  89. <div class="date-range">As of {{ $endDate }}</div>
  90. @endif
  91. </div>
  92. <table class="table-class">
  93. <thead class="table-head">
  94. <tr>
  95. @foreach($report->getHeaders() as $index => $header)
  96. <th class="{{ $report->getAlignmentClass($index) }}">
  97. {{ $header }}
  98. </th>
  99. @endforeach
  100. </tr>
  101. </thead>
  102. @foreach($report->getCategories() as $category)
  103. <tbody>
  104. <tr class="category-header-row">
  105. @foreach($category->header as $index => $header)
  106. <td class="{{ $report->getAlignmentClass($index) }}">
  107. {{ $header }}
  108. </td>
  109. @endforeach
  110. </tr>
  111. @foreach($category->data as $account)
  112. <tr>
  113. @foreach($account as $index => $cell)
  114. <td class="{{ $report->getAlignmentClass($index) }} {{ $index === 1 ? 'whitespace-normal' : 'whitespace-nowrap' }}">
  115. @if(is_array($cell) && isset($cell['name']))
  116. {{ $cell['name'] }}
  117. @else
  118. {{ $cell }}
  119. @endif
  120. </td>
  121. @endforeach
  122. </tr>
  123. @endforeach
  124. <!-- Category Types -->
  125. @foreach($category->types ?? [] as $type)
  126. <!-- Type Header -->
  127. <tr class="type-header-row">
  128. @foreach($type->header as $index => $header)
  129. <td class="{{ $report->getAlignmentClass($index) }}">
  130. {{ $header }}
  131. </td>
  132. @endforeach
  133. </tr>
  134. <!-- Type Data -->
  135. @foreach($type->data as $typeRow)
  136. <tr class="type-data-row">
  137. @foreach($typeRow as $index => $cell)
  138. <td class="{{ $report->getAlignmentClass($index) }} {{ $index === 'account_name' ? 'whitespace-normal' : 'whitespace-nowrap' }}">
  139. @if(is_array($cell) && isset($cell['name']))
  140. {{ $cell['name'] }}
  141. @else
  142. {{ $cell }}
  143. @endif
  144. </td>
  145. @endforeach
  146. </tr>
  147. @endforeach
  148. <!-- Type Summary -->
  149. <tr class="type-summary-row">
  150. @foreach($type->summary as $index => $cell)
  151. <td class="{{ $report->getAlignmentClass($index) }}">
  152. {{ $cell }}
  153. </td>
  154. @endforeach
  155. </tr>
  156. @endforeach
  157. <tr class="category-summary-row">
  158. @foreach($category->summary as $index => $cell)
  159. <td class="{{ $report->getAlignmentClass($index) }}">
  160. {{ $cell }}
  161. </td>
  162. @endforeach
  163. </tr>
  164. <tr class="spacer-row">
  165. <td colspan="{{ count($report->getHeaders()) }}"></td>
  166. </tr>
  167. </tbody>
  168. @endforeach
  169. <tbody>
  170. <tr class="table-footer-row">
  171. @foreach ($report->getOverallTotals() as $index => $total)
  172. <td class="{{ $report->getAlignmentClass($index) }}">
  173. {{ $total }}
  174. </td>
  175. @endforeach
  176. </tr>
  177. </tbody>
  178. </table>
  179. </body>
  180. </html>