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

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