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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. @page {
  9. size: A4;
  10. margin: 8.5mm 8.5mm 30mm 8.5mm;
  11. }
  12. .header {
  13. color: #374151;
  14. margin-bottom: 1rem;
  15. }
  16. .table-head {
  17. display: table-row-group;
  18. }
  19. .text-left {
  20. text-align: left;
  21. }
  22. .text-right {
  23. text-align: right;
  24. }
  25. .text-center {
  26. text-align: center;
  27. }
  28. .table-class th,
  29. .table-class td {
  30. color: #374151;
  31. }
  32. .header .title,
  33. .header .company-name,
  34. .header .date-range {
  35. margin-bottom: 0.125rem; /* Uniform space between header elements */
  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: 600;
  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) }}">
  104. {{ $cell }}
  105. </td>
  106. @endforeach
  107. </tr>
  108. @endforeach
  109. <tr class="category-summary-row">
  110. @foreach($category->summary as $index => $cell)
  111. <td class="{{ $report->getAlignmentClass($index) }}">
  112. {{ $cell }}
  113. </td>
  114. @endforeach
  115. </tr>
  116. <tr class="spacer-row">
  117. <td colspan="{{ count($report->getHeaders()) }}"></td>
  118. </tr>
  119. </tbody>
  120. @endforeach
  121. <tfoot>
  122. <tr class="table-footer-row">
  123. @foreach ($report->getOverallTotals() as $index => $total)
  124. <td class="{{ $report->getAlignmentClass($index) }}">
  125. {{ $total }}
  126. </td>
  127. @endforeach
  128. </tr>
  129. </tfoot>
  130. </table>
  131. </body>
  132. </html>