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.

account-balances.blade.php 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5. <title>Account Balances</title>
  6. <style>
  7. @page {
  8. margin: 0.25in 0.25in 1in 0.25in;
  9. }
  10. .header {
  11. color: #374151;
  12. }
  13. .table-class th,
  14. .table-class td {
  15. text-align: right;
  16. color: #374151;
  17. }
  18. /* Align the first column header and data to the left */
  19. .table-class th:first-child, .table-class td:first-child {
  20. text-align: left;
  21. }
  22. .header {
  23. margin-bottom: 1rem; /* Space between header and table */
  24. }
  25. .header .title,
  26. .header .company-name,
  27. .header .date-range {
  28. margin-bottom: 0.125rem; /* Uniform space between header elements */
  29. }
  30. .title { font-size: 1.5rem; }
  31. .company-name { font-size: 1.125rem; font-weight: 600; }
  32. .date-range { font-size: 0.875rem; }
  33. .table-class {
  34. width: 100%;
  35. border-collapse: collapse;
  36. }
  37. .table-class th,
  38. .table-class td {
  39. padding: 0.75rem;
  40. font-size: 0.75rem;
  41. line-height: 1rem;
  42. border-bottom: 1px solid #d1d5db; /* Gray border for all rows */
  43. }
  44. .category-row > td {
  45. background-color: #f3f4f6; /* Gray background for category names */
  46. font-weight: 600;
  47. }
  48. .table-body tr { background-color: #ffffff; /* White background for other rows */ }
  49. .spacer-row > td { height: 0.75rem; }
  50. .summary-row > td,
  51. .table-footer-row > td {
  52. font-weight: 600;
  53. background-color: #ffffff; /* White background for footer */
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <div class="header">
  59. <div class="title">Account Balances</div>
  60. <div class="company-name">{{ auth()->user()->currentCompany->name }}</div>
  61. <div class="date-range">Date Range: {{ $startDate }} to {{ $endDate }}</div>
  62. </div>
  63. <table class="table-class">
  64. <thead class="table-head" style="display: table-row-group;">
  65. <tr>
  66. <th>Account</th>
  67. <th>Starting Balance</th>
  68. <th>Debit</th>
  69. <th>Credit</th>
  70. <th>Net Movement</th>
  71. <th>Ending Balance</th>
  72. </tr>
  73. </thead>
  74. @foreach($accountBalanceReport->categories as $accountCategoryName => $accountCategory)
  75. <tbody>
  76. <tr class="category-row">
  77. <td colspan="6">{{ $accountCategoryName }}</td>
  78. </tr>
  79. @foreach($accountCategory->accounts as $account)
  80. <tr>
  81. <td>{{ $account->accountName }}</td>
  82. <td>{{ $account->balance->startingBalance ?? '' }}</td>
  83. <td>{{ $account->balance->debitBalance }}</td>
  84. <td>{{ $account->balance->creditBalance }}</td>
  85. <td>{{ $account->balance->netMovement }}</td>
  86. <td>{{ $account->balance->endingBalance ?? '' }}</td>
  87. </tr>
  88. @endforeach
  89. <tr class="summary-row">
  90. <td>Total {{ $accountCategoryName }}</td>
  91. <td>{{ $accountCategory->summary->startingBalance ?? '' }}</td>
  92. <td>{{ $accountCategory->summary->debitBalance }}</td>
  93. <td>{{ $accountCategory->summary->creditBalance }}</td>
  94. <td>{{ $accountCategory->summary->netMovement }}</td>
  95. <td>{{ $accountCategory->summary->endingBalance ?? '' }}</td>
  96. </tr>
  97. <tr class="spacer-row">
  98. <td colspan="6"></td>
  99. </tr>
  100. </tbody>
  101. @endforeach
  102. <tfoot>
  103. <tr class="table-footer-row">
  104. <td>Total for all accounts</td>
  105. <td></td>
  106. <td>{{ $accountBalanceReport->overallTotal->debitBalance }}</td>
  107. <td>{{ $accountBalanceReport->overallTotal->creditBalance }}</td>
  108. <td></td>
  109. <td></td>
  110. </tr>
  111. </tfoot>
  112. </table>
  113. <script type="text/php">
  114. if (isset($pdf)) {
  115. $font = $fontMetrics->getFont("Inter, sans-serif", "normal");
  116. $size = 8;
  117. $pageText = "Page {PAGE_NUM} of {PAGE_COUNT}";
  118. $x = 533;
  119. $y = 820;
  120. $pdf->page_text($x, $y, $pageText, $font, $size);
  121. }
  122. </script>
  123. </body>