sale.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. use App\Enums\Currencies;
  4. use App\Enums\SaleStatuses;
  5. use App\Helpers\HtmlHelper;
  6. /**
  7. * @var Sale $sale
  8. */
  9. ?>
  10. <section class="mb-4">
  11. <h3><?=htmlspecialchars($sale->getTitle())?></h3>
  12. <form class="mb-4" action="<?=htmlspecialchars($sale->getUrl())?>/submit" method="post">
  13. <div class="row">
  14. <div class="col-xl-6">
  15. <h4><?=htmlspecialchars(__("Main Details"))?></h4>
  16. <div class="mb-3">
  17. <label class="form-label" for="currency"><?=htmlspecialchars(__("Currency"))?></label>
  18. <select class="form-control" name="currency" id="currency">
  19. <?php
  20. HtmlHelper::renderOptions(Currencies::options(), $sale->currency);
  21. ?>
  22. </select>
  23. </div>
  24. <div class="mb-3">
  25. <label class="form-label" for="status">
  26. <?=htmlspecialchars(__("Status"))?>
  27. </label>
  28. <select class="form-control" name="status" id="status">
  29. <?php
  30. HtmlHelper::renderOptions(SaleStatuses::options(), $sale->status);
  31. ?>
  32. </select>
  33. </div>
  34. <div class="mb-3">
  35. <label for="tax-rate" class="form-label">
  36. <?=htmlspecialchars(__("Tax Rate (%)"))?>
  37. </label>
  38. <input class="form-control" type="number" name="tax_rate" id="tax-rate" value="<?=$sale->tax_rate?>" min="0" max="100.00" step="0.01" placeholder="Type tax rate" required />
  39. </div>
  40. </div>
  41. <div class="col-xl-6">
  42. <h4><?=htmlspecialchars(__("Additional Details"))?></h4>
  43. <dl>
  44. <dt><?=htmlspecialchars(__("Company"))?></dt>
  45. <dd><?=htmlspecialchars($sale->getCompany()->name)?></dd>
  46. <dt><?=htmlspecialchars(__("Location"))?></dt>
  47. <dd><?=htmlspecialchars($sale->getLocation()->getDisplayName())?></dd>
  48. <dt><?=htmlspecialchars(__("Created By"))?></dt>
  49. <dd><?=htmlspecialchars($sale->getUser()->getDisplayName())?></dd>
  50. <dt><?=htmlspecialchars(__("Created Date/Time"))?></dt>
  51. <dd><?=htmlspecialchars($sale->getDateTimeCreated()->format("d/m/Y H:i"))?></dd>
  52. </dl>
  53. </div>
  54. </div>
  55. <button type="submit" class="btn btn-primary">
  56. <i class="fa fa-fw fa-save"></i>
  57. <?=htmlspecialchars(__("Save Sale"))?>
  58. </button>
  59. </form>
  60. </section>
  61. <?php
  62. View::include("sale_items_section", compact("sale"));
  63. View::include("sale_invoices_section", compact("sale"));
  64. View::include("sale_notes_section", compact("sale"));
  65. ?>
  66. <section class="mb-4">
  67. <h3><?=htmlspecialchars(__("Tickets"))?></h3>
  68. <?php
  69. $tickets = $sale->getTickets();
  70. if(empty($tickets)) {
  71. HtmlHelper::renderInfoAlert(__("No tickets to display."));
  72. }
  73. else {
  74. }
  75. ?>
  76. </section>