Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

report-pdf.blade.php 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. @if(! empty($category->header))
  25. <tr class="category-header-row">
  26. @foreach($category->header as $index => $header)
  27. <td class="{{ $report->getAlignmentClass($index) }}">
  28. {{ $header }}
  29. </td>
  30. @endforeach
  31. </tr>
  32. @endif
  33. @foreach($category->data as $account)
  34. <tr>
  35. @foreach($account as $index => $cell)
  36. <td @class([
  37. $report->getAlignmentClass($index),
  38. 'whitespace-normal' => $index === 'account_name',
  39. 'whitespace-nowrap' => $index !== 'account_name',
  40. ])
  41. >
  42. @if(is_array($cell) && isset($cell['name']))
  43. {{ $cell['name'] }}
  44. @else
  45. {{ $cell }}
  46. @endif
  47. </td>
  48. @endforeach
  49. </tr>
  50. @endforeach
  51. <!-- Category Types -->
  52. @foreach($category->types ?? [] as $type)
  53. <!-- Type Header -->
  54. <tr class="type-header-row">
  55. @foreach($type->header as $index => $header)
  56. <td @class([
  57. $report->getAlignmentClass($index),
  58. 'type-row-indent' => $index === 'account_name',
  59. ])
  60. >
  61. {{ $header }}
  62. </td>
  63. @endforeach
  64. </tr>
  65. <!-- Type Data -->
  66. @foreach($type->data as $typeRow)
  67. <tr class="type-data-row">
  68. @foreach($typeRow as $index => $cell)
  69. <td @class([
  70. $report->getAlignmentClass($index),
  71. 'whitespace-normal type-row-indent' => $index === 'account_name',
  72. 'whitespace-nowrap' => $index !== 'account_name',
  73. ])
  74. >
  75. @if(is_array($cell) && isset($cell['name']))
  76. {{ $cell['name'] }}
  77. @else
  78. {{ $cell }}
  79. @endif
  80. </td>
  81. @endforeach
  82. </tr>
  83. @endforeach
  84. <!-- Type Summary -->
  85. <tr class="type-summary-row">
  86. @foreach($type->summary as $index => $cell)
  87. <td @class([
  88. $report->getAlignmentClass($index),
  89. 'type-row-indent' => $index === 'account_name',
  90. ])
  91. >
  92. {{ $cell }}
  93. </td>
  94. @endforeach
  95. </tr>
  96. @endforeach
  97. @if(! empty($category->summary))
  98. <tr class="category-summary-row">
  99. @foreach($category->summary as $index => $cell)
  100. <td class="{{ $report->getAlignmentClass($index) }}">
  101. {{ $cell }}
  102. </td>
  103. @endforeach
  104. </tr>
  105. @unless($loop->last && empty($report->getOverallTotals()))
  106. <tr class="spacer-row">
  107. <td colspan="{{ count($report->getHeaders()) }}"></td>
  108. </tr>
  109. @endunless
  110. @endif
  111. </tbody>
  112. @endforeach
  113. <tfoot>
  114. <tr class="table-footer-row">
  115. @foreach ($report->getOverallTotals() as $index => $total)
  116. <td class="{{ $report->getAlignmentClass($index) }}">
  117. {{ $total }}
  118. </td>
  119. @endforeach
  120. </tr>
  121. </tfoot>
  122. </table>
  123. @endsection