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 9.9KB

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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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-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-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>${orderReductionCart.title}</th>
  84. <td>${orderReductionCart.amount}€</td>
  85. </tr>
  86. </template>
  87. <template v-for="(orderReductionCredit, key) in order.orderReductionCredits">
  88. <tr>
  89. <th>${orderReductionCredit.title}</th>
  90. <td>${orderReductionCredit.amount}€</td>
  91. </tr>
  92. </template>
  93. <tr>
  94. <th>Total produits après réductions TTC </th>
  95. <td>${order.totalOrderProductsWithTaxAndReductions}€</td>
  96. </tr>
  97. <tr>
  98. <th>Frais de livraisons TTC </th>
  99. <td>${order.deliveryPriceWithTaxAndReduction}€</td>
  100. </tr>
  101. {# <tr>
  102. <th>Total Taxes </th>
  103. <td>${order.totalWithTax}€</td>
  104. </tr>
  105. #}
  106. <tr>
  107. <th>Total TTC </th>
  108. <td>${order.totalWithTax}€</td>
  109. </tr>
  110. </tbody>
  111. </table>
  112. </div>
  113. </div>
  114. </div>
  115. {% endmacro %}
  116. {% macro mainInfo() %}
  117. {#${order.id}#}
  118. <div class="col-3">
  119. <div class="info-box">
  120. <span class="info-box-icon bg-info">
  121. <i class="far fa-user"></i></span>
  122. <div class="info-box-content">
  123. <span class="info-box-text">{{ "field.default.user"|trans({}, 'lcshop') }}</span>
  124. <strong v-if="order.user" v-html="order.user"></strong>
  125. <strong v-else v-html="order.visitor"></strong>
  126. </div>
  127. </div>
  128. </div>
  129. <div class="col-3">
  130. <div class="info-box">
  131. <span class="info-box-icon bg-success">
  132. <i class="far fa-calendar"></i></span>
  133. <div class="info-box-content">
  134. <span class="info-box-text">{{ "field.default.date"|trans({}, 'lcshop') }}</span>
  135. <span class="info-box-number" v-if="order.createdAt"> ${order.createdAt}</span>
  136. <span class="info-box-number" v-else> ${order.createdAt}</span>
  137. </div>
  138. </div>
  139. </div>
  140. <div class="col-3">
  141. <div class="info-box">
  142. <span class="info-box-icon bg-warning">
  143. <i class="fa fa-euro-sign"></i></span>
  144. <div class="info-box-content">
  145. <span class="info-box-text">{{ "field.OrderShop.total"|trans({}, 'lcshop') }}</span>
  146. <strong> ${order.totalWithTaxAndReduction} €</strong>
  147. <strong> ${order.countProducts}</strong>
  148. </div>
  149. </div>
  150. </div>
  151. <div class="col-3">
  152. <div class="info-box">
  153. <span class="info-box-icon bg-danger">
  154. <i class="fa fa-info"></i></span>
  155. <div class="info-box-content">
  156. <span class="info-box-text">{{ "field.OrderShop.status"|trans({}, 'lcshop') }}</span>
  157. <strong> ${order.orderStatus}</strong>
  158. <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-status">
  159. {{ "action.edit"|trans }}
  160. </button>
  161. </div>
  162. </div>
  163. </div>
  164. {#
  165. <div class="col-3">
  166. <strong>{{ "field.OrderShop.status"|trans }} </strong><br/>
  167. <span>${order.orderStatus}</span>
  168. <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal-order-status">
  169. {{ "action.edit"|trans }}
  170. </button>
  171. </div>#}
  172. {% endmacro mainInfo %}
  173. {% macro addressInfo() %}
  174. <div class="col-4">
  175. <div class="info-box">
  176. <span class="info-box-icon bg-info">
  177. <i class="fa fa-address-card"></i></span>
  178. <div class="info-box-content">
  179. <strong>{{ "field.default.invoiceAddress"|trans({}, 'lcshop') }}</strong>
  180. <address v-html="order.invoiceAddress">
  181. </address>
  182. <button type="button" class="btn btn-default" data-toggle="modal"
  183. data-target="#modal-order-invoice-address">
  184. {{ "action.edit"|trans }}
  185. </button>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="col-4">
  190. <div class="info-box">
  191. <span class="info-box-icon bg-success">
  192. <i class="fa fa-map-marked-alt"></i></span>
  193. <div class="info-box-content">
  194. <div v-if="order.deliveryType == 'home'">
  195. <strong>{{ "field.default.deliveryAddress"|trans({}, 'lcshop') }}</strong>
  196. <address v-html="order.deliveryAddress">
  197. </address>
  198. </div>
  199. <div v-else-if="order.deliveryType == 'point-sale'">
  200. <h6><strong>{{ "field.default.deliveryPointSale"|trans({}, 'lcshop') }} : </strong></h6>
  201. <address v-html="order.deliveryPointSale">
  202. </address>
  203. </div>
  204. <div v-else>
  205. Aucun lieu de livraison défini.
  206. </div>
  207. <button type="button" class="btn btn-default" data-toggle="modal"
  208. data-target="#modal-order-delivery-address">
  209. {{ "action.edit"|trans }}
  210. </button>
  211. </div>
  212. </div>
  213. </div>
  214. <div class="col-4">
  215. <div class="info-box">
  216. <span class="info-box-icon bg-danger">
  217. <i class="fa fa-clock"></i></span>
  218. <div class="info-box-content">
  219. <h6><strong>{{ "field.default.deliveryAvailabilty"|trans({}, 'lcshop') }} : </strong></h6>
  220. <div v-if="order.deliveryType == 'home'">
  221. <div v-html="order.deliveryAvailabilityZone">
  222. </div>
  223. </div>
  224. <div v-else-if="order.deliveryType == 'point-sale'">
  225. <div v-html="order.deliveryAvailabilityPointSale">
  226. </div>
  227. </div>
  228. <button type="button" class="btn btn-default" data-toggle="modal"
  229. data-target="#modal-order-delivery-availability">
  230. {{ "action.edit"|trans }}
  231. </button>
  232. </div>
  233. </div>
  234. </div>
  235. {% endmacro addressInfo %}