mutation-report.blade.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <table>
  2. <thead>
  3. <tr>
  4. <th colspan="5">Laporan Mutasi</th>
  5. </tr>
  6. <tr>
  7. <th colspan="5" rowspan="2">Periode {{ $mutations->first()->created_at }} -
  8. {{ $mutations->last()->created_at }} </th>
  9. </tr>
  10. <tr></tr>
  11. <tr>
  12. <th>#</th>
  13. <th>Tanggal</th>
  14. <th>Tipe</th>
  15. <th>Nilai</th>
  16. <th>Outlet</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. @foreach ($mutations->chunk(100) as $chunk)
  21. @foreach ($chunk as $index => $mutation)
  22. <tr>
  23. <td>{{ ++$index }}</td>
  24. <td>{{ $mutation->created_at }}</td>
  25. <td>{{ $mutation->type }}</td>
  26. <td>{{ $mutation->amount }}</td>
  27. <td>{{ $mutation->outlet->name }}</td>
  28. </tr>
  29. @endforeach
  30. @endforeach
  31. <tr>
  32. <td colspan="3">Total</td>
  33. </tr>
  34. <tr>
  35. <td colspan="3">Pendapatan</td>
  36. <td>{{ (new App\Services\MutationService)->totalIncomeAsString($mutations) }}</td>
  37. </tr>
  38. <tr>
  39. <td colspan="3">Pengeluran</td>
  40. <td>{{ (new App\Services\MutationService)->totalExpenseAsString($mutations) }}</td>
  41. </tr>
  42. <tr>
  43. <td colspan="3">Jumlah</td>
  44. <td>{{ (new App\Services\MutationService)->totalAmount($mutations) }}</td>
  45. </tr>
  46. </tbody>
  47. </table>