Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

account-transactions-report-pdf.blade.php 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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: bold;
  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: bold;
  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. <td colspan="{{ count($report->getHeaders()) }}">
  95. <div>
  96. @foreach($category->header as $headerRow)
  97. <div>
  98. @foreach($headerRow as $headerValue)
  99. @if (!empty($headerValue))
  100. {{ $headerValue }}
  101. @endif
  102. @endforeach
  103. </div>
  104. @endforeach
  105. </div>
  106. </td>
  107. </tr>
  108. @foreach($category->data as $dataIndex => $transaction)
  109. <tr
  110. @class([
  111. 'category-header-row' => $loop->first || $loop->last || $loop->remaining === 1,
  112. ])>
  113. @foreach($transaction as $cellIndex => $cell)
  114. <td class="{{ $report->getAlignmentClass($cellIndex) }} {{ $cellIndex === 1 ? 'whitespace-normal' : 'whitespace-nowrap' }}">
  115. @if(is_array($cell) && isset($cell['description']))
  116. {{ $cell['description'] }}
  117. @else
  118. {{ $cell }}
  119. @endif
  120. </td>
  121. @endforeach
  122. </tr>
  123. @endforeach
  124. @unless($loop->last)
  125. <tr class="spacer-row">
  126. <td colspan="{{ count($report->getHeaders()) }}"></td>
  127. </tr>
  128. @endunless
  129. </tbody>
  130. @endforeach
  131. </table>
  132. </body>
  133. </html>