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.

136 lines
3.4 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. <hr/>-->
  9. <p>
  10. ::raw _("Key-in here your orders in advance for this supplier.<br/>You can check your current orders any time on the following page <a href=\"/contract\">my account</a>.<br/>Tip: to remove an order please key-in the quantity 0")::
  11. </p>
  12. <form name="order" id="order" method="POST" action="">
  13. <input type="hidden" name="token" value="::token::"/>
  14. <!--::if distribution!=null::
  15. <input type="hidden" name="distribution" value="::distribution.id::"/>
  16. ::end::-->
  17. <table class="table table-bordered table-striped" style="background:white;" >
  18. <tr>
  19. <td></td>
  20. <th>::_("Product")::</th>
  21. <th>::_("Price")::</th>
  22. ::foreach d userOrders::
  23. ::if d.distrib==null::
  24. <th>::_("Qty")::</th>
  25. ::else::
  26. <th class="text-center">::dDate(d.distrib.date)::</th>
  27. ::end::
  28. ::end::
  29. </tr>
  30. ::if userOrders.length>0::
  31. ::foreach uo userOrders[0].datas::
  32. <tr>
  33. <td>
  34. <img src="::uo.product.getImage()::" style="width:32px;height:32px;" />
  35. </td>
  36. <td>
  37. <span ::cond uo.product.organic:: title ="Agriculture biologique" data-toggle="tooltip" data-placement="bottom">
  38. <img src="/img/AB.png"/>&nbsp;
  39. </span>
  40. <a href="#" onclick="_.overlay('/shop/productInfo/::uo.product.id::','::escapeJS(uo.product.getName())::')">
  41. ::uo.product.getName()::
  42. </a>
  43. </td>
  44. <td>
  45. ::set price = uo.product.price + uo.product._contract.computeFees(uo.product.price)::
  46. ::formatNum(price)::&nbsp;::currency()::
  47. </td>
  48. ::set i = repeat.uo.index::
  49. ::foreach d userOrders::
  50. <td class="text-center">
  51. ::set o = d.datas[i]::
  52. ::if o.order==null::
  53. ::if d.distrib==null::
  54. <!-- contrat amap-->
  55. <input type="text" class="form-control" name="::"d-p"+o.product.id::" id="product::o.product.id::" value="" />
  56. ::else::
  57. <input type="text" class="form-control" name="::"d"+d.distrib.id+"-p"+o.product.id::" id="product::o.product.id::" value="" />
  58. ::end::
  59. ::else::
  60. ::o.order.quantity::
  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. <input type="submit" class="btn btn-primary" value="::_("Validate the order")::" name="submit" id="submit" />
  89. </form>
  90. </div>
  91. </div>
  92. <div class="col-md-4">
  93. <div class="article">
  94. <p>
  95. ::_("Supplier:"):: <b>::c._vendor.name::</b>
  96. </p>
  97. <p>
  98. ::_("Contact in charge:"):: $$contact(::c._contact::)
  99. </p>
  100. </div>
  101. </div>
  102. ::end::