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.

macros.html.twig 11KB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. {% trans_default_domain 'lcshop' %}
  2. {% macro tableHead() %}
  3. <table id="order-products-list" class="table table-striped">
  4. <thead>
  5. <tr>
  6. <th colspan="2">
  7. <span>Produits / Producteurs</span>
  8. </th>
  9. <th>
  10. <span>Prix HT à l'unité</span>
  11. </th>
  12. <th>
  13. <span>Prix TTC à l'unité </span>
  14. </th>
  15. <th>
  16. <span>Disponibilité</span>
  17. </th>
  18. <th>
  19. <span>Quantité</span>
  20. </th>
  21. <th>
  22. <span>Total</span>
  23. </th>
  24. </tr>
  25. </thead>
  26. {% endmacro %}
  27. {% macro products(form_order_products) %}
  28. <tbody>
  29. <template v-for="(orderProduct, key) in orderProducts">
  30. <order-product ref="orderProductBLOP" :order-product="orderProduct" :template="templateTest"
  31. :key-item="key"></order-product>
  32. </template>
  33. </tbody>
  34. {% endmacro %}
  35. {% macro productsTemplate(form_order_products) %}
  36. <tr class="order-product-item">
  37. <td colspan="2">{% verbatim %}{{orderProduct.title}}{% endverbatim %}</td>
  38. <td>
  39. {% verbatim %}{{orderProduct.price}}{% endverbatim %}€
  40. </td>
  41. <td>
  42. {% verbatim %}{{orderProduct.priceWithTax}}{% endverbatim %}€
  43. </td>
  44. <td></td>
  45. <td>
  46. {{ form_widget(form_order_products.orderProducts.vars.prototype.quantityOrder, {'attr' : {'ref': 'fieldQuantity', 'v-model' : 'orderProduct.quantityOrder', '@change' : 'updateOrderProducts'}}) }}
  47. {{ form_widget(form_order_products.orderProducts.vars.prototype.product, {'attr' : {'ref' : 'fieldProduct', 'v-model' : 'orderProduct.product'}}) }}
  48. {#{{ form_widget(form_order_products.orderProducts.vars.prototype.id, {'attr' : {'ref' : 'fieldId', 'v-model' : 'orderProduct.id'}}) }}#}
  49. <button type="button" class="btn-remove-product btn btn-default" @click="deleteOrderProduct()">
  50. <i class="fa fa-trash"></i>
  51. </button>
  52. </td>
  53. <td>
  54. {% verbatim %}{{orderProduct.totalWithTaxAndReduction}}{% endverbatim %}€
  55. </td>
  56. </tr>
  57. {% endmacro %}
  58. {% macro tableTotal() %}
  59. </table>
  60. <div class="clearfix"></div>
  61. <div class="row">
  62. <div class="col-7">
  63. <button type="button" class="btn btn-success" data-toggle="modal" data-target="#modal-add-product-to-order">
  64. <i class="fa fa-plus"></i> {{ "action.order.addOrderProduct"|trans }}
  65. </button>
  66. <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#modal-add-reduction-cart">
  67. <i class="fa fa-shopping-basket"></i> {{ "action.order.addReductionCart"|trans }}
  68. </button>
  69. <button type="button" class="btn btn-warning" data-toggle="modal" data-target="#modal-add-reduction-credit">
  70. <i class="fa fa-backspace"></i> {{ "action.order.addReductionCredit"|trans }}
  71. </button>
  72. </div>
  73. <div class="col-5">
  74. <div class="table-responsive">
  75. <table class="table">
  76. <tbody>
  77. <tr>
  78. <th>Total produits TTC </th>
  79. <td>${order.totalOrderProductsWithTax}€</td>
  80. </tr>
  81. <template v-for="(orderReductionCart, key) in order.orderReductionCarts">
  82. <tr>
  83. <th>
  84. ${orderReductionCart.title}
  85. <button type="button" class="btn-sm btn-danger" @click="modalOrderReductionCart(orderReductionCart.id)">
  86. <i class="fa fa-trash"></i>
  87. </button>
  88. </th>
  89. <td>${orderReductionCart.amount}€</td>
  90. </tr>
  91. </template>
  92. <template v-for="(orderReductionCredit, key) in order.orderReductionCredits">
  93. <tr>
  94. <th>${orderReductionCredit.title}
  95. <button type="button" class="btn-sm btn-danger" @click="modalOrderReductionCredit(orderReductionCredit.id)">
  96. <i class="fa fa-trash"></i>
  97. </button>
  98. </th>
  99. <td>${orderReductionCredit.amount}€</td>
  100. </tr>
  101. </template>
  102. <tr>
  103. <th>Total produits après réductions TTC </th>
  104. <td>${order.totalOrderProductsWithTaxAndReductions}€</td>
  105. </tr>
  106. <tr>
  107. <th>Frais de livraisons TTC </th>
  108. <td>${order.deliveryPriceWithTaxAndReduction}€</td>
  109. </tr>
  110. {# <tr>
  111. <th>Total Taxes </th>
  112. <td>${order.totalWithTax}€</td>
  113. </tr>
  114. #}
  115. <tr>
  116. <th>Total TTC </th>
  117. <td>${order.totalWithTax}€</td>
  118. </tr>
  119. </tbody>
  120. </table>
  121. </div>
  122. </div>
  123. </div>
  124. {% endmacro %}
  125. {% macro mainInfo() %}
  126. {#${order.id}#}
  127. <div class="col-3">
  128. <div class="info-box">
  129. <span class="info-box-icon bg-info">
  130. <i class="far fa-user"></i></span>
  131. <div class="info-box-content">
  132. <span class="info-box-text">{{ "field.default.user"|trans({}, 'lcshop') }}</span>
  133. <strong v-if="order.user" v-html="order.user"></strong>
  134. <strong v-else v-html="order.visitor"></strong>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="col-3">
  139. <div class="info-box">
  140. <span class="info-box-icon bg-success">
  141. <i class="far fa-calendar"></i></span>
  142. <div class="info-box-content">
  143. <span class="info-box-text">{{ "field.default.date"|trans({}, 'lcshop') }}</span>
  144. <span class="info-box-number" v-if="order.createdAt"> ${order.createdAt}</span>
  145. <span class="info-box-number" v-else> ${order.createdAt}</span>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="col-3">
  150. <div class="info-box">
  151. <span class="info-box-icon bg-warning">
  152. <i class="fa fa-euro-sign"></i></span>
  153. <div class="info-box-content">
  154. <span class="info-box-text">{{ "field.OrderShop.total"|trans({}, 'lcshop') }}</span>
  155. <strong> ${order.totalWithTaxAndReduction} €</strong>
  156. <strong> ${order.countProducts}</strong>
  157. </div>
  158. </div>
  159. </div>
  160. <div class="col-3">
  161. <div class="info-box">
  162. <span class="info-box-icon bg-danger">
  163. <i class="fa fa-info"></i></span>
  164. <div class="info-box-content">
  165. <span class="info-box-text">{{ "field.OrderShop.status"|trans({}, 'lcshop') }}</span>
  166. <strong> ${order.orderStatus}</strong>
  167. <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-status">
  168. {{ "action.edit"|trans }}
  169. </button>
  170. </div>
  171. </div>
  172. </div>
  173. {#
  174. <div class="col-3">
  175. <strong>{{ "field.OrderShop.status"|trans }} </strong><br/>
  176. <span>${order.orderStatus}</span>
  177. <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-status">
  178. {{ "action.edit"|trans }}
  179. </button>
  180. </div>#}
  181. {% endmacro mainInfo %}
  182. {% macro addressInfo() %}
  183. <div class="col-4">
  184. <div class="info-box">
  185. <span class="info-box-icon bg-info">
  186. <i class="fa fa-address-card"></i></span>
  187. <div class="info-box-content">
  188. <strong>{{ "field.default.invoiceAddress"|trans({}, 'lcshop') }}</strong>
  189. <address v-html="order.invoiceAddress">
  190. </address>
  191. <button type="button" class="btn btn-default" data-toggle="modal"
  192. data-target="#modal-order-invoice-address">
  193. {{ "action.edit"|trans }}
  194. </button>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="col-4">
  199. <div class="info-box">
  200. <span class="info-box-icon bg-success">
  201. <i class="fa fa-map-marked-alt"></i></span>
  202. <div class="info-box-content">
  203. <div v-if="order.deliveryType == 'home'">
  204. <strong>{{ "field.default.deliveryAddress"|trans({}, 'lcshop') }}</strong>
  205. <address v-html="order.deliveryAddress">
  206. </address>
  207. </div>
  208. <div v-else-if="order.deliveryType == 'point-sale'">
  209. <h6><strong>{{ "field.default.deliveryPointSale"|trans({}, 'lcshop') }} : </strong></h6>
  210. <address v-html="order.deliveryPointSale">
  211. </address>
  212. </div>
  213. <div v-else>
  214. Aucun lieu de livraison défini.
  215. </div>
  216. <button type="button" class="btn btn-default" data-toggle="modal"
  217. data-target="#modal-order-delivery-address">
  218. {{ "action.edit"|trans }}
  219. </button>
  220. </div>
  221. </div>
  222. </div>
  223. <div class="col-4">
  224. <div class="info-box">
  225. <span class="info-box-icon bg-danger">
  226. <i class="fa fa-clock"></i></span>
  227. <div class="info-box-content">
  228. <h6><strong>{{ "field.default.deliveryAvailabilty"|trans({}, 'lcshop') }} : </strong></h6>
  229. <div v-if="order.deliveryType == 'home'">
  230. <div v-html="order.deliveryAvailabilityZone">
  231. </div>
  232. </div>
  233. <div v-else-if="order.deliveryType == 'point-sale'">
  234. <div v-html="order.deliveryAvailabilityPointSale">
  235. </div>
  236. </div>
  237. <button type="button" class="btn btn-default" data-toggle="modal"
  238. data-target="#modal-order-delivery-availability">
  239. {{ "action.edit"|trans }}
  240. </button>
  241. </div>
  242. </div>
  243. </div>
  244. {% endmacro addressInfo %}