您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

report-pdf.blade.php 6.5KB

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