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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  80. </div>
  81. <table class="table-class">
  82. <thead class="table-head">
  83. <tr>
  84. @foreach($report->getHeaders() as $index => $header)
  85. <th class="{{ $report->getAlignmentClass($index) }}">
  86. {{ $header }}
  87. </th>
  88. @endforeach
  89. </tr>
  90. </thead>
  91. @foreach($report->getCategories() as $category)
  92. <tbody>
  93. <tr class="category-header-row">
  94. @foreach($category->header as $index => $header)
  95. <td class="{{ $report->getAlignmentClass($index) }}">
  96. {{ $header }}
  97. </td>
  98. @endforeach
  99. </tr>
  100. @foreach($category->data as $account)
  101. <tr>
  102. @foreach($account as $index => $cell)
  103. <td class="{{ $report->getAlignmentClass($index) }} {{ $index === 1 ? 'whitespace-normal' : 'whitespace-nowrap' }}">
  104. @if(is_array($cell) && isset($cell['name']))
  105. {{ $cell['name'] }}
  106. @else
  107. {{ $cell }}
  108. @endif
  109. </td>
  110. @endforeach
  111. </tr>
  112. @endforeach
  113. <tr class="category-summary-row">
  114. @foreach($category->summary as $index => $cell)
  115. <td class="{{ $report->getAlignmentClass($index) }}">
  116. {{ $cell }}
  117. </td>
  118. @endforeach
  119. </tr>
  120. <tr class="spacer-row">
  121. <td colspan="{{ count($report->getHeaders()) }}"></td>
  122. </tr>
  123. </tbody>
  124. @endforeach
  125. <tbody>
  126. <tr class="table-footer-row">
  127. @foreach ($report->getOverallTotals() as $index => $total)
  128. <td class="{{ $report->getAlignmentClass($index) }}">
  129. {{ $total }}
  130. </td>
  131. @endforeach
  132. </tr>
  133. </tbody>
  134. </table>
  135. </body>
  136. </html>