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.

138 lines
3.3 KiB

  1. ::use 'design.mtt'::
  2. <div id="content" class="col-md-8">
  3. <div class="article">
  4. <h2>::_("Order"):: ::c.name::</h2>
  5. ::if distribution!=null::
  6. ::_("For the delivery of the"):: <b>::hDate(distribution.date)::</b>
  7. ::end::
  8. <p>
  9. ::raw _("As long as orders are open, you can come back on this page and modify your order.<br/>You can check any time your current orders on the following page <a href='/contract'>my account</a>.")::
  10. </p>
  11. <form name="order" id="order" method="POST" action="">
  12. <input type="hidden" name="token" value="::token::"/>
  13. ::if distribution!=null::
  14. <input type="hidden" name="distribution" value="::distribution.id::"/>
  15. ::end::
  16. <table class="table table-bordered">
  17. <tr>
  18. <td></td>
  19. <th>::_("Product")::</th>
  20. <th>::_("Price")::</th>
  21. ::foreach d userOrders::
  22. ::if d.distrib==null::
  23. <th>::_("Qty")::</th>
  24. ::else::
  25. <th>::dDate(d.distrib.date)::</th>
  26. ::end::
  27. ::end::
  28. </tr>
  29. ::if userOrders.length>0::
  30. ::foreach uo userOrders[0].datas::
  31. <tr>
  32. <td>
  33. <img src="::uo.product.getImage()::" style="width:32px;height:32px;" />
  34. </td>
  35. <td>
  36. <span ::cond uo.product.organic:: title ="Agriculture biologique" data-toggle="tooltip" data-placement="bottom">
  37. <img src="/img/AB.png"/>&nbsp;
  38. </span>
  39. <a href="#" onclick="_.overlay('/shop/productInfo/::uo.product.id::','::escapeJS(uo.product.getName())::')">
  40. ::uo.product.getName()::
  41. </a>
  42. </td>
  43. <td>
  44. ::set price = uo.product.price + uo.product._contract.computeFees(uo.product.price)::
  45. ::formatNum(price)::&nbsp;::currency()::
  46. </td>
  47. ::set i = repeat.uo.index::
  48. ::foreach d userOrders::
  49. <td>
  50. ::set o = d.datas[i]::
  51. ::if o.order==null::
  52. ::set q = ""::
  53. ::else::
  54. ::set q = o.order.quantity::
  55. ::end::
  56. ::if d.distrib==null::
  57. <!-- contrat amap-->
  58. <input type="text" class="form-control" name="::"d-p"+o.product.id::" id="product::o.product.id::" value="::q::" />
  59. ::else::
  60. <input type="text" class="form-control" name="::"d"+d.distrib.id+"-p"+o.product.id::" id="product::o.product.id::" value="::q::" />
  61. ::end::
  62. </td>
  63. ::end::
  64. </tr>
  65. ::end::
  66. ::else::
  67. <tr>
  68. <td colspan="4">::_("There is currently no open order")::</td>
  69. </tr>
  70. ::end::
  71. <tr>
  72. <th colspan="3" class="text-right">Total</th>
  73. ::foreach d userOrders::
  74. <th>
  75. ::set total=0::
  76. ::foreach o d.datas::
  77. ::if o.order!=null::
  78. ::set q = o.order.quantity::
  79. ::set price = o.product.price + o.product._contract.computeFees(o.product.price)::
  80. ::set total = total+(q*price)::
  81. ::end::
  82. ::end::
  83. ::formatNum(total)::&nbsp;::currency()::
  84. </th>
  85. ::end::
  86. </tr>
  87. </table>
  88. <i>::_("Tip: to remove an order please key-in the quantity 0")::</i><br/><br/>
  89. <input type="submit" class="btn btn-primary" value="::_("Validate the order")::" name="submit" id="submit" />
  90. </form>
  91. </div>
  92. </div>
  93. <div class="col-md-4">
  94. <div class="article">
  95. ::_("Supplier:"):: <b>::c._vendor.name::</b>
  96. <br/>
  97. <br/>
  98. ::_("Contact in charge:"):: $$contact(::c._contact::)
  99. </div>
  100. </div>
  101. ::end::