sale_invoices_section.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App;
  3. /**
  4. * @var Sale $sale
  5. */
  6. use App\Helpers\HtmlHelper;
  7. ?>
  8. <section class="mb-4">
  9. <h3><?=htmlspecialchars(__("Invoices"))?></h3>
  10. <?php
  11. $invoices = $sale->getInvoices();
  12. if(empty($invoices)) {
  13. HtmlHelper::renderInfoAlert(__("No invoices to display."));
  14. }
  15. else {
  16. ?>
  17. <table class="table table-bordered table-hover">
  18. <thead>
  19. <tr>
  20. <th><?=htmlspecialchars(__("Number"))?></th>
  21. <th><?=htmlspecialchars(__("Status"))?></th>
  22. <th><?=htmlspecialchars(__("Total"))?></th>
  23. <th><?=htmlspecialchars(__("Actions"))?></th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. <?php
  28. foreach($invoices as $invoice) {
  29. ?>
  30. <tr>
  31. <td class="text-end">
  32. <?=$invoice->number?>
  33. </td>
  34. <td>
  35. <?=htmlspecialchars($invoice->getDisplayInvoiceStatus())?>
  36. </td>
  37. <td class="text-end">
  38. <?=htmlspecialchars($invoice->getDisplayTotal())?>
  39. </td>
  40. <td class="p-1">
  41. <a href="<?=htmlspecialchars($invoice->getUrl())?>" class="btn btn-sm btn-primary">
  42. <?=htmlspecialchars(__("View"))?>
  43. </a>
  44. </td>
  45. </tr>
  46. <?php
  47. }
  48. ?>
  49. </tbody>
  50. </table>
  51. <?php
  52. }
  53. ?>
  54. </section>