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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. @extends('components.company.reports.layout')
  2. @section('content')
  3. <div class="header">
  4. <div class="title">{{ $report->getTitle() }}</div>
  5. <div class="company-name">{{ $company->name }}</div>
  6. @if($startDate && $endDate)
  7. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  8. @else
  9. <div class="date-range">As of {{ $endDate }}</div>
  10. @endif
  11. </div>
  12. <table class="table-class">
  13. <thead class="table-head">
  14. <tr>
  15. @foreach($report->getHeaders() as $index => $header)
  16. <th class="{{ $report->getAlignmentClass($index) }}">
  17. {{ $header }}
  18. </th>
  19. @endforeach
  20. </tr>
  21. </thead>
  22. @foreach($report->getCategories() as $category)
  23. <tbody>
  24. <tr class="category-header-row">
  25. @foreach($category->header as $index => $header)
  26. <td class="{{ $report->getAlignmentClass($index) }}">
  27. {{ $header }}
  28. </td>
  29. @endforeach
  30. </tr>
  31. @foreach($category->data as $account)
  32. <tr>
  33. @foreach($account as $index => $cell)
  34. <td @class([
  35. $report->getAlignmentClass($index),
  36. 'whitespace-normal' => $index === 'account_name',
  37. 'whitespace-nowrap' => $index !== 'account_name',
  38. ])
  39. >
  40. @if(is_array($cell) && isset($cell['name']))
  41. {{ $cell['name'] }}
  42. @else
  43. {{ $cell }}
  44. @endif
  45. </td>
  46. @endforeach
  47. </tr>
  48. @endforeach
  49. <!-- Category Types -->
  50. @foreach($category->types ?? [] as $type)
  51. <!-- Type Header -->
  52. <tr class="type-header-row">
  53. @foreach($type->header as $index => $header)
  54. <td @class([
  55. $report->getAlignmentClass($index),
  56. 'type-row-indent' => $index === 'account_name',
  57. ])
  58. >
  59. {{ $header }}
  60. </td>
  61. @endforeach
  62. </tr>
  63. <!-- Type Data -->
  64. @foreach($type->data as $typeRow)
  65. <tr class="type-data-row">
  66. @foreach($typeRow as $index => $cell)
  67. <td @class([
  68. $report->getAlignmentClass($index),
  69. 'whitespace-normal type-row-indent' => $index === 'account_name',
  70. 'whitespace-nowrap' => $index !== 'account_name',
  71. ])
  72. >
  73. @if(is_array($cell) && isset($cell['name']))
  74. {{ $cell['name'] }}
  75. @else
  76. {{ $cell }}
  77. @endif
  78. </td>
  79. @endforeach
  80. </tr>
  81. @endforeach
  82. <!-- Type Summary -->
  83. <tr class="type-summary-row">
  84. @foreach($type->summary as $index => $cell)
  85. <td @class([
  86. $report->getAlignmentClass($index),
  87. 'type-row-indent' => $index === 'account_name',
  88. ])
  89. >
  90. {{ $cell }}
  91. </td>
  92. @endforeach
  93. </tr>
  94. @endforeach
  95. <tr class="category-summary-row">
  96. @foreach($category->summary as $index => $cell)
  97. <td class="{{ $report->getAlignmentClass($index) }}">
  98. {{ $cell }}
  99. </td>
  100. @endforeach
  101. </tr>
  102. @unless($loop->last && empty($report->getOverallTotals()))
  103. <tr class="spacer-row">
  104. <td colspan="{{ count($report->getHeaders()) }}"></td>
  105. </tr>
  106. @endunless
  107. </tbody>
  108. @endforeach
  109. <tfoot>
  110. <tr class="table-footer-row">
  111. @foreach ($report->getOverallTotals() as $index => $total)
  112. <td class="{{ $report->getAlignmentClass($index) }}">
  113. {{ $total }}
  114. </td>
  115. @endforeach
  116. </tr>
  117. </tfoot>
  118. </table>
  119. @endsection