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.

231 lines
8.5KB

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