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.

report-pdf.blade.php 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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: 600;
  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. background-color: #f3f4f6; /* Gray background for category names */
  60. font-weight: 600;
  61. }
  62. .table-body tr {
  63. background-color: #ffffff; /* White background for other rows */
  64. }
  65. .spacer-row > td {
  66. height: 0.75rem;
  67. }
  68. .category-summary-row > td,
  69. .table-footer-row > td {
  70. font-weight: bold;
  71. background-color: #ffffff; /* White background for footer */
  72. }
  73. </style>
  74. </head>
  75. <body>
  76. <div class="header">
  77. <div class="title">{{ $report->getTitle() }}</div>
  78. <div class="company-name">{{ $company->name }}</div>
  79. @if($startDate && $endDate)
  80. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  81. @else
  82. <div class="date-range">As of {{ $endDate }}</div>
  83. @endif
  84. </div>
  85. <table class="table-class">
  86. <thead class="table-head">
  87. <tr>
  88. @foreach($report->getHeaders() as $index => $header)
  89. <th class="{{ $report->getAlignmentClass($index) }}">
  90. {{ $header }}
  91. </th>
  92. @endforeach
  93. </tr>
  94. </thead>
  95. @foreach($report->getCategories() as $category)
  96. <tbody>
  97. <tr class="category-header-row">
  98. @foreach($category->header as $index => $header)
  99. <td class="{{ $report->getAlignmentClass($index) }}">
  100. {{ $header }}
  101. </td>
  102. @endforeach
  103. </tr>
  104. @foreach($category->data as $account)
  105. <tr>
  106. @foreach($account as $index => $cell)
  107. <td class="{{ $report->getAlignmentClass($index) }} {{ $index === 1 ? 'whitespace-normal' : 'whitespace-nowrap' }}">
  108. @if(is_array($cell) && isset($cell['name']))
  109. {{ $cell['name'] }}
  110. @else
  111. {{ $cell }}
  112. @endif
  113. </td>
  114. @endforeach
  115. </tr>
  116. @endforeach
  117. <tr class="category-summary-row">
  118. @foreach($category->summary as $index => $cell)
  119. <td class="{{ $report->getAlignmentClass($index) }}">
  120. {{ $cell }}
  121. </td>
  122. @endforeach
  123. </tr>
  124. <tr class="spacer-row">
  125. <td colspan="{{ count($report->getHeaders()) }}"></td>
  126. </tr>
  127. </tbody>
  128. @endforeach
  129. <tbody>
  130. <tr class="table-footer-row">
  131. @foreach ($report->getOverallTotals() as $index => $total)
  132. <td class="{{ $report->getAlignmentClass($index) }}">
  133. {{ $total }}
  134. </td>
  135. @endforeach
  136. </tr>
  137. </tbody>
  138. </table>
  139. </body>
  140. </html>