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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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: auto;
  10. margin: 10mm 7.5mm;
  11. }
  12. .header {
  13. color: #374151;
  14. margin-bottom: 1rem;
  15. }
  16. .header > * + * {
  17. margin-top: 0.5rem;
  18. }
  19. .table-head {
  20. display: table-row-group;
  21. }
  22. .text-left {
  23. text-align: left;
  24. }
  25. .text-right {
  26. text-align: right;
  27. }
  28. .text-center {
  29. text-align: center;
  30. }
  31. .table-class th,
  32. .table-class td {
  33. color: #374151;
  34. }
  35. .title {
  36. font-size: 1.5rem;
  37. }
  38. .company-name {
  39. font-size: 1.125rem;
  40. font-weight: 600;
  41. }
  42. .date-range {
  43. font-size: 0.875rem;
  44. }
  45. .table-class {
  46. width: 100%;
  47. border-collapse: collapse;
  48. }
  49. .table-class th,
  50. .table-class td {
  51. padding: 0.75rem;
  52. font-size: 0.75rem;
  53. line-height: 1rem;
  54. border-bottom: 1px solid #d1d5db; /* Gray border for all rows */
  55. }
  56. .category-header-row > td {
  57. background-color: #f3f4f6; /* Gray background for category names */
  58. font-weight: 600;
  59. }
  60. .table-body tr {
  61. background-color: #ffffff; /* White background for other rows */
  62. }
  63. .spacer-row > td {
  64. height: 0.75rem;
  65. }
  66. .category-summary-row > td,
  67. .table-footer-row > td {
  68. font-weight: 600;
  69. background-color: #ffffff; /* White background for footer */
  70. }
  71. </style>
  72. </head>
  73. <body>
  74. <div class="header">
  75. <div class="title">{{ $report->getTitle() }}</div>
  76. <div class="company-name">{{ $company->name }}</div>
  77. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  78. </div>
  79. <table class="table-class">
  80. <thead class="table-head">
  81. <tr>
  82. @foreach($report->getHeaders() as $index => $header)
  83. <th class="{{ $report->getAlignmentClass($index) }}">
  84. {{ $header }}
  85. </th>
  86. @endforeach
  87. </tr>
  88. </thead>
  89. @foreach($report->getCategories() as $category)
  90. <tbody>
  91. <tr class="category-header-row">
  92. @foreach($category->header as $index => $header)
  93. <td class="{{ $report->getAlignmentClass($index) }}">
  94. {{ $header }}
  95. </td>
  96. @endforeach
  97. </tr>
  98. @foreach($category->data as $account)
  99. <tr>
  100. @foreach($account as $index => $cell)
  101. <td class="{{ $report->getAlignmentClass($index) }}">
  102. {{ $cell }}
  103. </td>
  104. @endforeach
  105. </tr>
  106. @endforeach
  107. <tr class="category-summary-row">
  108. @foreach($category->summary as $index => $cell)
  109. <td class="{{ $report->getAlignmentClass($index) }}">
  110. {{ $cell }}
  111. </td>
  112. @endforeach
  113. </tr>
  114. <tr class="spacer-row">
  115. <td colspan="{{ count($report->getHeaders()) }}"></td>
  116. </tr>
  117. </tbody>
  118. @endforeach
  119. <tfoot>
  120. <tr class="table-footer-row">
  121. @foreach ($report->getOverallTotals() as $index => $total)
  122. <td class="{{ $report->getAlignmentClass($index) }}">
  123. {{ $total }}
  124. </td>
  125. @endforeach
  126. </tr>
  127. </tfoot>
  128. </table>
  129. </body>
  130. </html>