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.6KB

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