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.

298 lines
12KB

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