Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

macros.html.twig 23KB

4 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. {% trans_default_domain 'lcshop' %}
  2. {% macro tableHead() %}
  3. <table id="order-products-list" class="table table-striped">
  4. <thead>
  5. <tr>
  6. <th :class="editionMode ? '' : 'hidden'">
  7. </th>
  8. <th colspan="2">
  9. <span>Produits / Producteurs</span>
  10. </th>
  11. <th>
  12. <span v-if="order.countComplementaryOrderShops > 0">Compléments</span>
  13. </th>
  14. <th>
  15. <span>Prix achat HT </span>
  16. </th>
  17. <th>
  18. <span>Prix HT</span>
  19. </th>
  20. <th>
  21. <span>Prix TTC </span>
  22. </th>
  23. <th>
  24. <span>Marge </span>
  25. </th>
  26. <th>
  27. <span>Disponibilité</span>
  28. </th>
  29. <th>
  30. <span>Quantité</span>
  31. </th>
  32. <th>
  33. <span>Total</span>
  34. </th>
  35. <th :class="editionMode ? '' : 'hidden'">
  36. Actions
  37. </th>
  38. </tr>
  39. </thead>
  40. {% endmacro %}
  41. {% macro products() %}
  42. <tbody>
  43. <template v-for="(orderProduct, key) in orderProducts">
  44. <order-product ref="orderProductBLOP" :order-product="orderProduct" :edition-mode="editionMode"
  45. :template="templateTest"
  46. :key-item="key"></order-product>
  47. </template>
  48. </tbody>
  49. {% endmacro %}
  50. {% macro productsTemplate(form_order_products=null) %}
  51. <tr :class=" orderProduct.isRedelivery ? 'redelivery order-product-item' : 'order-product-item'">
  52. <td :class="editionMode ? '' : 'hidden'">
  53. <input type="checkbox" :value="orderProduct.id" class="order-product-checkbox"/>
  54. </td>
  55. <td colspan="2">
  56. <a :href="orderProduct.editLink" target="_blank">
  57. <img :src="orderProduct.image" :alt="orderProduct.title"/>
  58. {% verbatim %}{{orderProduct.title}}{% endverbatim %}
  59. <span v-show="orderProduct.hasRedelivery">
  60. - <i class="fa fa-undo" data-toggle="tooltip" :title="orderProduct.redeliveryOrderShop"></i>
  61. </span>
  62. <span v-show="orderProduct.isRedelivery">
  63. - <i class="fa fa-undo" data-toggle="tooltip" title="Ce produit est une relivraison"></i>
  64. </span>
  65. </a>
  66. </td>
  67. <td>
  68. <span v-if="orderProduct.complementaryReference"> {% verbatim %}{{orderProduct.complementaryReference}}{% endverbatim %}</span>
  69. </td>
  70. <td>
  71. {% verbatim %}{{orderProduct.buyingPrice}}{% endverbatim %} €
  72. </td>
  73. <td>
  74. {% verbatim %}{{orderProduct.price}}{% endverbatim %}€
  75. </td>
  76. <td>
  77. {% verbatim %}{{orderProduct.priceWithTax}}{% endverbatim %} €
  78. </td>
  79. <td>
  80. {% verbatim %}{{orderProduct.totalMargin}}{% endverbatim %} € /
  81. {% verbatim %}{{orderProduct.marginPercent}}{% endverbatim %} %
  82. </td>
  83. <td>
  84. {% verbatim %}{{orderProduct.availableQuantity}}{% endverbatim %}
  85. </td>
  86. <td>
  87. {% if form_order_products is not null %}
  88. <div :class="editionMode && orderProduct.isRedelivery ==false ? '' : 'hidden'">
  89. {{ form_widget(form_order_products.orderProducts.vars.prototype.quantityOrder, {'attr' : {'ref': 'fieldQuantity', 'v-model' : 'orderProduct.quantityOrder', '@change' : 'updateOrderProducts'}}) }}
  90. {{ form_widget(form_order_products.orderProducts.vars.prototype.product, {'attr' : {'ref' : 'fieldProduct', 'v-model' : 'orderProduct.product'}}) }}
  91. {#{{ form_widget(form_order_products.orderProducts.vars.prototype.id, {'attr' : {'ref' : 'fieldId', 'v-model' : 'orderProduct.id'}}) }}#}
  92. <button type="button" class="btn-remove-product btn btn-default" @click="deleteOrderProduct()">
  93. <i class="fa fa-trash"></i>
  94. </button>
  95. </div>
  96. <div :class="editionMode && orderProduct.isRedelivery ==false ? 'hidden' : ''">
  97. {% verbatim %}{{ orderProduct.quantityOrder }}{% endverbatim %}
  98. </div>
  99. {% else %}
  100. {% verbatim %}{{ orderProduct.quantityOrder }}{% endverbatim %}
  101. {% endif %}
  102. </td>
  103. <td>
  104. {% verbatim %}{{orderProduct.totalWithTaxAndReduction}}{% endverbatim %} €
  105. </td>
  106. <td :class="editionMode ? '' : 'hidden'">
  107. <div class="dropdown" :class="editionMode ? '' : 'hidden'">
  108. <button class="btn-sm btn-info dropdown-toggle" type="button" id="dropdownMenu"
  109. data-toggle="dropdown" aria-expanded="false">
  110. Actions
  111. </button>
  112. <div class="dropdown-menu" aria-labelledby="dropdownMenu">
  113. <button v-show="modalExist('#modal-add-redelivery-order-product') && orderProduct.hasRedelivery == false"
  114. type="button" class="dropdown-item" @click="modalAddRedeliveryOrderProduct">
  115. Générer une relivraison
  116. </button>
  117. <button v-show="modalExist('#modal-add-reduction-credit')" type="button" class="dropdown-item"
  118. @click="modalAddReductionCredit">
  119. Générer un avoir
  120. </button>
  121. </div>
  122. </div>
  123. </td>
  124. </tr>
  125. {% endmacro %}
  126. {% macro tableTotal() %}
  127. </table>
  128. <div class="clearfix"></div>
  129. <div class="row">
  130. <div class="col-6">
  131. <div class="row">
  132. <div class="col-12">
  133. {{ _self.order_modal_button('#modal-add-product-to-order', 'btn-success', "action.order.addOrderProduct", 'plus') }}
  134. {{ _self.order_modal_button('#modal-add-order-reduction-cart', 'btn-warning', "action.order.addReductionCart", 'shopping-basket') }}
  135. {{ _self.order_modal_button('#modal-add-order-reduction-credit', 'btn-warning', "action.order.addReductionCredit", 'backspace') }}
  136. </div>
  137. </div>
  138. </div>
  139. <div class="col-5">
  140. <div class="table-responsive">
  141. <table class="table">
  142. <tbody>
  143. <tr>
  144. <th>Total produits TTC</th>
  145. <td>${order.totalOrderProductsWithTax} €</td>
  146. </tr>
  147. <template v-for="(orderReductionCart, key) in order.orderReductionCarts">
  148. <tr>
  149. <th>
  150. ${orderReductionCart.title}
  151. <button v-show="editionMode && modalExist('#modal-delete-reduction-cart')" type="button"
  152. class="btn-sm btn-danger"
  153. @click="modalDeleteOrderReductionCart(orderReductionCart.id)">
  154. <i class="fa fa-trash"></i>
  155. </button>
  156. </th>
  157. <td>${orderReductionCart.amount} €</td>
  158. </tr>
  159. </template>
  160. <template v-for="(orderReductionCredit, key) in order.orderReductionCredits">
  161. <tr>
  162. <th>${orderReductionCredit.title}
  163. <button v-show="editionMode && modalExist('#modal-delete-reduction-credit')"
  164. type="button" class="btn-sm btn-danger"
  165. @click="modalDeleteOrderReductionCredit(orderReductionCredit.id)">
  166. <i class="fa fa-trash"></i>
  167. </button>
  168. </th>
  169. <td>${orderReductionCredit.amount} €</td>
  170. </tr>
  171. </template>
  172. <tr>
  173. <th>Total produits après réductions TTC</th>
  174. <td>${order.totalOrderProductsWithTaxAndReductions} €</td>
  175. </tr>
  176. <tr>
  177. <th>Total marge produits</th>
  178. <td>${order.totalMargin} € <br/> ${order.totalMarginPercent} %</td>
  179. </tr>
  180. <tr>
  181. <th>Frais de livraisons TTC</th>
  182. <td>${order.deliveryPriceWithTaxAndReduction} €</td>
  183. </tr>
  184. <tr>
  185. <th>Total TTC</th>
  186. <td>${order.totalWithTax} €</td>
  187. </tr>
  188. </tbody>
  189. </table>
  190. </div>
  191. </div>
  192. <div class="col"></div>
  193. <div class="col-12">
  194. {#<button v-show="order.user" type="button" class="btn btn-danger" @click="switchEditionMode">
  195. <template v-if="editionMode">
  196. <i class="fa fa-eye"></i> {{ "action.order.viewMode"|trans }}
  197. </template>
  198. <template v-else>
  199. <i class="fa fa-pen"></i> {{ "action.order.editionMode"|trans }}
  200. </template>
  201. </button>#}
  202. {{ _self.order_modal_button('#modal-order-send-payment-link', 'btn-info float-right', "action.order.sendPaymentLink", 'credit-card') }}
  203. </div>
  204. </div>
  205. {% endmacro %}
  206. {% macro box_reference() %}
  207. {% embed '@LcShop/backend/default/block/embed_box.twig' %}
  208. {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
  209. {% trans_default_domain 'lcshop' %}
  210. {% block class %}bg-info{% endblock %}
  211. {% block icon %}credit-card{% endblock %}
  212. {% block label %}{{ "field.OrderShop.reference"|trans({}, 'lcshop') }}{% endblock %}
  213. {% block value %}
  214. ${order.reference}<br/>
  215. <span v-if="order.countComplementaryOrderShops > 0">
  216. ${order.countComplementaryOrderShops} commande(s) complémentaire(s)
  217. </span>
  218. {% endblock %}
  219. {% endembed %}
  220. {% endmacro %}
  221. {% macro box_validation_date() %}
  222. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  223. {% set value = '<span class="info-box-number" v-if="order.createdAt"> ${order.createdAt}</span>
  224. <span class="info-box-number" v-else> ${order.createdAt}</span>' %}
  225. {{ macros.box_info('bg-warning', 'calendar',"field.default.date"|trans({}, 'lcshop'), value) }}
  226. {% endmacro %}
  227. {% macro box_total_order() %}
  228. {% embed '@LcShop/backend/default/block/embed_box.twig' %}
  229. {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
  230. {% trans_default_domain 'lcshop' %}
  231. {% block class %}bg-danger{% endblock %}
  232. {% block icon %}euro-sign{% endblock %}
  233. {% block infoBox %}
  234. <table style="width: 100%">
  235. <tr>
  236. <td>
  237. Total produits TTC :<i class="icon info" data-toggle="tooltip" title="Après reduction"></i>
  238. </td>
  239. <td>
  240. <strong class="float-right"> ${order.totalOrderProductsWithTaxAndReductions} €</strong><br/>
  241. </td>
  242. </tr>
  243. <tr>
  244. <td>
  245. Total marge produits :
  246. </td>
  247. <td>
  248. <strong class="float-right">${order.totalMargin} € / ${order.totalMarginPercent} %</strong><br/>
  249. </td>
  250. </tr>
  251. <tr>
  252. <td>
  253. Frais de livraisons TTC :
  254. </td>
  255. <td>
  256. <strong class="float-right">${order.deliveryPriceWithTaxAndReduction} €</strong><br/>
  257. </td>
  258. </tr>
  259. <tr>
  260. <td>
  261. Total commandes :
  262. </td>
  263. <td>
  264. <strong class="float-right"> ${order.totalWithTax} €</strong><br/>
  265. </td>
  266. </tr>
  267. </table>
  268. {% endblock %}
  269. {% endembed %}
  270. {% endmacro %}
  271. {% macro box_address_invoice() %}
  272. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  273. {% set value = '<span v-if="order.invoiceAddress!=false">
  274. <address v-html="order.invoiceAddress"></address>
  275. </span>
  276. <span v-else>
  277. Aucune adresse de facturation défini.
  278. </span>' %}
  279. {{ macros.box_info('bg-info', 'address-card',"field.default.invoiceAddress"|trans({}, 'lcshop'), value , _self.order_modal_button('#modal-order-invoice-address')) }}
  280. {% endmacro %}
  281. {% macro box_main_order() %}
  282. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  283. {% set value = '${order.mainOrder.reference} <a :href="order.mainOrder.link">[Afficher]</a>' %}
  284. {{ macros.box_info('bg-danger', 'link',"field.OrderShop.mainOrder"|trans({}, 'lcshop'), value) }}
  285. {% endmacro %}
  286. {% macro box_address_delivery() %}
  287. {% embed '@LcShop/backend/default/block/embed_box.twig' %}
  288. {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
  289. {% trans_default_domain 'lcshop' %}
  290. {% block class %}bg-success{% endblock %}
  291. {% block icon %}map-marked-alt{% endblock %}
  292. {% block label %}{{ "field.default.deliveryAddress"|trans({}, 'lcshop') }}{% endblock %}
  293. {% block value %}
  294. <div v-if="order.deliveryAddress">
  295. <address v-html="order.deliveryAddress">
  296. </address>
  297. </div>
  298. <div v-else>
  299. Aucun lieu de livraison défini.
  300. </div>
  301. {% endblock %}
  302. {% block button %}
  303. {{ order_macros.order_modal_button('#modal-order-delivery-address') }}
  304. {% endblock %}
  305. {% endembed %}
  306. {% endmacro %}
  307. {% macro box_delivery_slot() %}
  308. {% embed '@LcShop/backend/default/block/embed_box.twig' %}
  309. {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
  310. {% trans_default_domain 'lcshop' %}
  311. {% block class %}bg-success{% endblock %}
  312. {% block icon %}clock{% endblock %}
  313. {% block label %}{{ "field.default.deliveryAvailabilty"|trans({}, 'lcshop') }}{% endblock %}
  314. {% block value %}
  315. <div v-if="order.deliveryType == 'home'">
  316. <div v-html="order.deliveryAvailabilityZone != null ? order.deliveryAvailabilityZone : order.deliveryDate">
  317. </div>
  318. </div>
  319. <div v-else-if="order.deliveryType == 'point-sale'">
  320. <div v-html="order.deliveryAvailabilityPointSale != null ? order.deliveryAvailabilityPointSale : order.deliveryDate">
  321. </div>
  322. </div>
  323. <div v-else>
  324. Aucun créneau défini.
  325. </div>
  326. {% endblock %}
  327. {% block button %}
  328. {{ order_macros.order_modal_button('#modal-order-delivery-availability') }}
  329. {% endblock %}
  330. {% endembed %}
  331. {% endmacro %}
  332. {% macro box_step_reach() %}
  333. {% embed '@LcShop/backend/default/block/embed_box.twig' %}
  334. {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
  335. {% trans_default_domain 'lcshop' %}
  336. {% block class %}bg-info{% endblock %}
  337. {% block icon %}list-ol{% endblock %}
  338. {% block label %}Étape atteinte{% endblock %}
  339. {% block value %}
  340. <div v-if="order.hasReach == 1">
  341. Adresse de livraison
  342. </div>
  343. <div v-if="order.hasReach == 2">
  344. Adresse de facturation
  345. </div>
  346. <div v-if="order.hasReach == 3">
  347. Page de paiement
  348. </div>
  349. <div v-if="order.hasReach ==null">
  350. Aucune
  351. </div>
  352. {% endblock %}
  353. {% endembed %}
  354. {% endmacro %}
  355. {% macro box_payments() %}
  356. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  357. {% set tools = '<div v-show="order.isOrderPaid">
  358. <h5>
  359. <span class="badge badge-success">
  360. <i class="icon fas fa-check"></i> Commande soldé
  361. </span>
  362. </h5>
  363. </div>
  364. <div v-show="order.isOrderPaid==false" >
  365. <h5>
  366. <span class="badge badge-error">
  367. <i class="icon fas fa-check"></i> Commande non soldé
  368. </span>
  369. </h5>
  370. </div>' %}
  371. {{ macros.card_start("OrderShop.payment", 'danger card-outline', false, tools) }}
  372. <table class="table table-striped" style="margin-bottom: 15px">
  373. <tbody>
  374. <thead>
  375. <tr>
  376. <th v-if="order.countComplementaryOrderShops > 0">Référence</th>
  377. <th>Mode de règlement</th>
  378. <th>Date</th>
  379. <th>Montant</th>
  380. <th>Actions</th>
  381. </tr>
  382. </thead>
  383. <tbody>
  384. <template v-for="(orderPayment, i) in order.orderPayments">
  385. <tr>
  386. <td v-if="order.countComplementaryOrderShops > 0">
  387. ${orderPayment.orderReference}
  388. </td>
  389. <td>${orderPayment.meanPaymentText}</td>
  390. <td>${orderPayment.paidAtText}</td>
  391. <td>${orderPayment.amount}</td>
  392. <td>
  393. <button v-show="orderPayment.editable && editionMode && modalExist('#modal-delete-order-payment')"
  394. class="btn-sm btn-info" type="button" @click="editOrderPayment(orderPayment.id)">
  395. <i class="fa fa-pen"></i>
  396. </button>
  397. <button v-show="orderPayment.editable && editionMode && modalExist('#modal-delete-order-payment')"
  398. type="button" class="btn-sm btn-danger"
  399. @click="modalDeleteOrderPayment(orderPayment.id)">
  400. <i class="fa fa-trash"></i>
  401. </button>
  402. </td>
  403. </tr>
  404. </template>
  405. </tbody>
  406. </table>
  407. <div class="col-11">
  408. {{ _self.order_modal_button('#modal-order-payment', 'btn-info', "action.order.addOrderPayment") }}
  409. <strong class="float-right">Total règlement : ${order.totalOrderPaid} €</strong>
  410. {#TODO: afficher si la commande est règlé et afficher une alerte si le montant des paiments est supérieur au montant total de la commande#}
  411. </div>
  412. {{ macros.card_end() }}
  413. {% endmacro %}
  414. {% macro box_documents() %}
  415. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  416. {{ macros.card_start("OrderShop.documents", 'primary card-outline') }}
  417. <table class="table table-striped">
  418. <tbody>
  419. <thead>
  420. <tr>
  421. <th v-if="order.countComplementaryOrderShops > 0">Référence</th>
  422. <th>Date</th>
  423. <th>Type</th>
  424. <th>Numéro</th>
  425. <th>Actions</th>
  426. </tr>
  427. </thead>
  428. <tbody>
  429. <template v-for="(orderDocument, i) in order.orderDocuments">
  430. <tr>
  431. <td v-if="order.countComplementaryOrderShops > 0">
  432. ${orderDocument.orderReference}
  433. </td>
  434. <td>${orderDocument.date}</td>
  435. <td>Facture</td>
  436. <td>${orderDocument.reference}</td>
  437. <td>
  438. <a :href="'./?entity=Document&action=downloadInvoice&id='+orderDocument.id"
  439. class="btn-sm btn-default">Télécharger</a>
  440. </td>
  441. </tr>
  442. </template>
  443. </tbody>
  444. </table>
  445. {{ macros.card_end() }}
  446. {% endmacro %}
  447. {% macro box_complementary() %}
  448. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  449. {{ macros.card_start("OrderShop.complementary", 'primary card-outline') }}
  450. <table class="table table-striped">
  451. <tbody>
  452. <thead>
  453. <tr>
  454. <th>Réference</th>
  455. <th>Date</th>
  456. <th>total</th>
  457. <th>Actions</th>
  458. </tr>
  459. </thead>
  460. <tbody>
  461. <template v-for="(complementaryOrderShop, i) in order.complementaryOrderShops">
  462. <tr>
  463. <td>${complementaryOrderShop.reference}</td>
  464. <td>${complementaryOrderShop.date}</td>
  465. <td>${complementaryOrderShop.total}</td>
  466. <td>
  467. <a :href="complementaryOrderShop.link" class="btn-sm btn-default">Afficher</a>
  468. </td>
  469. </tr>
  470. </template>
  471. </tbody>
  472. </table>
  473. {{ macros.card_end() }}
  474. {% endmacro %}
  475. {% macro box_tickets() %}
  476. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  477. {{ macros.card_start("OrderShop.tickets", 'warning card-outline') }}
  478. <table class="table table-striped">
  479. <tbody>
  480. <thead>
  481. <tr>
  482. <th>Date</th>
  483. <th>Status</th>
  484. <th>Subject</th>
  485. <th>Actions</th>
  486. </tr>
  487. </thead>
  488. <tbody>
  489. <template v-for="(ticket, i) in order.tickets">
  490. <tr>
  491. <td>${ticket.date}</td>
  492. <td>${ticket.status}</td>
  493. <td>${ticket.subject}</td>
  494. <td>
  495. <a :href="ticket.link" class="btn-sm btn-default">Afficher</a>
  496. </td>
  497. </tr>
  498. </template>
  499. </tbody>
  500. </table>
  501. {{ macros.card_end() }}
  502. {% endmacro %}
  503. {% macro box_status() %}
  504. {% embed '@LcShop/backend/default/block/embed_box.twig' %}
  505. {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
  506. {% trans_default_domain 'lcshop' %}
  507. {% block class %}bg-success{% endblock %}
  508. {% block icon %}info{% endblock %}
  509. {% block label %}{{ "field.OrderShop.status"|trans({}, 'lcshop') }}{% endblock %}
  510. {% block value %}
  511. <strong> ${order.orderStatus}</strong>
  512. {% endblock %}
  513. {% block button %}
  514. {{ order_macros.order_modal_button('#modal-order-status-histories', 'btn-secondary', 'action.history') }}
  515. {{ order_macros.order_modal_button('#modal-order-status') }}
  516. {% endblock %}
  517. {% endembed %}
  518. {% endmacro %}
  519. {% macro order_modal_button(modalId, class="btn-primary", trad="action.edit", icon=false) %}
  520. <button v-show="editionMode && modalExist('{{ modalId }}')" type="button" class="btn-sm {{ class }}"
  521. data-toggle="modal"
  522. data-target="{{ modalId }}">
  523. {% if icon %}
  524. <i class="fa fa-{{ icon }}"></i>
  525. {% endif %}
  526. {{ trad|trans }}
  527. </button>
  528. {% endmacro order_modal_button %}