customer-report.blade.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <table>
  2. <thead>
  3. <tr>
  4. <th colspan="7">Detail History Transaksi Customer</th>
  5. </tr>
  6. <tr></tr>
  7. <tr>
  8. <th>#</th>
  9. <th>Id Customer</th>
  10. <th>Nama</th>
  11. <th>HP</th>
  12. <th>Total Transaksi</th>
  13. <th>Total Nilai</th>
  14. <th>Total Diskon didapat</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. @foreach ($customers->chunk(100) as $chunk)
  19. @foreach ($chunk as $index => $customer)
  20. <tr>
  21. <td>{{ ++$index }}</td>
  22. <td>{{ $customer->customer_number }}</td>
  23. <td>{{ $customer->name }}</td>
  24. <td>{{ $customer->phone }}</td>
  25. <td>{{ $customer->transaction->count() }}</td>
  26. <td>
  27. {{ (new App\Services\TransactionService())->totalPriceGroupAsString($customer->fresh()->transaction) }}
  28. </td>
  29. <td>
  30. {{ (new App\Services\TransactionService())->totalDiscountGivenGroupAsString($customer->fresh()->transaction) }}
  31. </td>
  32. </tr>
  33. @endforeach
  34. @endforeach
  35. </tbody>
  36. </table>