|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509 |
- {% trans_default_domain 'lcshop' %}
-
-
- {% macro tableHead() %}
- <table id="order-products-list" class="table table-striped">
- <thead>
- <tr>
- <th :class="editionMode ? '' : 'hidden'">
-
- </th>
- <th colspan="2">
- <span>Produits / Producteurs</span>
- </th>
- <th>
- <span>Prix HT à l'unité</span>
- </th>
- <th>
- <span>Prix TTC à l'unité </span>
- </th>
- <th>
- <span>Marge </span>
- </th>
- <th>
- <span>Disponibilité</span>
- </th>
- <th>
- <span>Quantité</span>
- </th>
- <th>
- <span>Total</span>
- </th>
- <th :class="editionMode ? '' : 'hidden'">
- Actions
- </th>
- </tr>
- </thead>
- {% endmacro %}
-
-
- {% macro products() %}
- <tbody>
- <template v-for="(orderProduct, key) in orderProducts">
- <order-product ref="orderProductBLOP" :order-product="orderProduct" :edition-mode="editionMode"
- :template="templateTest"
- :key-item="key"></order-product>
- </template>
- </tbody>
- {% endmacro %}
-
-
- {% macro productsTemplate(form_order_products=null) %}
- <tr :class=" orderProduct.isRedelivery ? 'redelivery order-product-item' : 'order-product-item'">
- <td :class="editionMode ? '' : 'hidden'">
- <input type="checkbox" :value="orderProduct.id" class="order-product-checkbox" />
- </td>
- <td colspan="2">
- {% verbatim %}{{orderProduct.title}}{% endverbatim %}
- <span v-show="orderProduct.hasRedelivery">
- - <i class="fa fa-undo" data-toggle="tooltip" :title="orderProduct.redeliveryOrderShop" ></i>
- </span>
-
- <span v-show="orderProduct.isRedelivery">
- - <i class="fa fa-undo" data-toggle="tooltip" title="Ce produit fait l'objet d'une relivraison" ></i>
- </span>
-
- </td>
- <td>
- {% verbatim %}{{orderProduct.price}}{% endverbatim %}€
- </td>
- <td>
- {% verbatim %}{{orderProduct.priceWithTax}}{% endverbatim %}€
- </td>
- <td>
- {% verbatim %}{{orderProduct.totalMargin}}{% endverbatim %}€ /
- {% verbatim %}{{orderProduct.marginPercent}}{% endverbatim %}%
- </td>
- <td>
- {% verbatim %}{{orderProduct.availableQuantity}}{% endverbatim %}
- </td>
- <td>
- {% if form_order_products is not null %}
- <div :class="editionMode && orderProduct.isRedelivery ==false ? '' : 'hidden'">
- {{ form_widget(form_order_products.orderProducts.vars.prototype.quantityOrder, {'attr' : {'ref': 'fieldQuantity', 'v-model' : 'orderProduct.quantityOrder', '@change' : 'updateOrderProducts'}}) }}
- {{ form_widget(form_order_products.orderProducts.vars.prototype.product, {'attr' : {'ref' : 'fieldProduct', 'v-model' : 'orderProduct.product'}}) }}
- {#{{ form_widget(form_order_products.orderProducts.vars.prototype.id, {'attr' : {'ref' : 'fieldId', 'v-model' : 'orderProduct.id'}}) }}#}
- <button type="button" class="btn-remove-product btn btn-default" @click="deleteOrderProduct()">
- <i class="fa fa-trash"></i>
- </button>
- </div>
- <div :class="editionMode && orderProduct.isRedelivery ==false ? 'hidden' : ''">
- {% verbatim %}{{ orderProduct.quantityOrder }}{% endverbatim %}
- </div>
- {% else %}
- {% verbatim %}{{ orderProduct.quantityOrder }}{% endverbatim %}
- {% endif %}
- </td>
- <td>
- {% verbatim %}{{orderProduct.totalWithTaxAndReduction}}{% endverbatim %}€
- </td>
- <td :class="editionMode ? '' : 'hidden'">
- <div class="dropdown" :class="editionMode ? '' : 'hidden'">
- <button class="btn-sm btn-info dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-expanded="false">
- Actions
- </button>
- <div class="dropdown-menu" aria-labelledby="dropdownMenu">
- <button v-show="modalExist('#modal-add-redelivery-order-product') && orderProduct.hasRedelivery == false" type="button" class="dropdown-item" @click="modalAddRedeliveryOrderProduct">
- Générer une relivraison
- </button>
-
- <button v-show="modalExist('#modal-add-reduction-credit')" type="button" class="dropdown-item" @click="modalAddReductionCredit" >
- Générer un avoir
- </button>
- </div>
- </div>
- </td>
- </tr>
-
- {% endmacro %}
-
- {% macro tableTotal() %}
-
- </table>
-
- <div class="clearfix"></div>
-
- <div class="row">
- <div class="col-6">
- <div class="row">
- <div class="col-12">
- {{ _self.order_modal_button('#modal-add-product-to-order', 'btn-success', "action.order.addOrderProduct", 'plus') }}
- {{ _self.order_modal_button('#modal-add-order-reduction-cart', 'btn-warning', "action.order.addReductionCart", 'shopping-basket') }}
- {{ _self.order_modal_button('#modal-add-order-reduction-credit', 'btn-warning', "action.order.addReductionCredit", 'backspace') }}
-
- </div>
-
- </div>
- </div>
-
- <div class="col-5">
- <div class="table-responsive">
- <table class="table">
- <tbody>
- <tr>
- <th>Total produits TTC</th>
- <td>${order.totalOrderProductsWithTax}€</td>
- </tr>
- <template v-for="(orderReductionCart, key) in order.orderReductionCarts">
- <tr>
- <th>
- ${orderReductionCart.title}
- <button v-show="editionMode && modalExist('#modal-delete-reduction-cart')" type="button"
- class="btn-sm btn-danger"
- @click="modalDeleteOrderReductionCart(orderReductionCart.id)">
- <i class="fa fa-trash"></i>
- </button>
- </th>
- <td>${orderReductionCart.amount}€</td>
- </tr>
- </template>
- <template v-for="(orderReductionCredit, key) in order.orderReductionCredits">
- <tr>
- <th>${orderReductionCredit.title}
-
- <button v-show="editionMode && modalExist('#modal-delete-reduction-credit')"
- type="button" class="btn-sm btn-danger"
- @click="modalDeleteOrderReductionCredit(orderReductionCredit.id)">
- <i class="fa fa-trash"></i>
- </button>
- </th>
- <td>${orderReductionCredit.amount}€</td>
- </tr>
- </template>
- <tr>
- <th>Total produits après réductions TTC</th>
- <td>${order.totalOrderProductsWithTaxAndReductions}€</td>
- </tr>
-
- <tr>
- <th>Frais de livraisons TTC</th>
- <td>${order.deliveryPriceWithTaxAndReduction}€</td>
- </tr>
-
- {# <tr>
- <th>Total Taxes </th>
- <td>${order.totalWithTax}€</td>
- </tr>
- #}
- <tr>
- <th>Total TTC</th>
- <td>${order.totalWithTax}€</td>
- </tr>
-
- </tbody>
- </table>
- </div>
- </div>
- <div class="col"></div>
- <div class="col-12">
- {#<button v-show="order.user" type="button" class="btn btn-danger" @click="switchEditionMode">
- <template v-if="editionMode">
- <i class="fa fa-eye"></i> {{ "action.order.viewMode"|trans }}
- </template>
- <template v-else>
- <i class="fa fa-pen"></i> {{ "action.order.editionMode"|trans }}
- </template>
- </button>#}
- {{ _self.order_modal_button('#modal-order-send-payment-link', 'btn-info float-right', "action.order.sendPaymentLink", 'credit-card') }}
-
- </div>
- </div>
- {% endmacro %}
-
-
- {% macro box_user_info() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
- {% set value = ' <span v-if="order.user" v-html="order.user"></span>
- <span v-else v-html="order.visitor"></span>' %}
- {{ macros.box_info('bg-info', 'user',"field.default.user"|trans({}, 'lcshop'), value) }}
-
- {% endmacro box_user_info %}
-
-
-
-
- {% macro box_reference() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
-
- {{ macros.box_info('bg-info', 'credit-card',"field.OrderShop.reference"|trans({}, 'lcshop'), ' ${order.reference}') }}
- {% endmacro %}
-
-
- {% macro box_validation_date() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
- {% set value = '<span class="info-box-number" v-if="order.createdAt"> ${order.createdAt}</span>
- <span class="info-box-number" v-else> ${order.createdAt}</span>' %}
- {{ macros.box_info('bg-warning', 'calendar',"field.default.date"|trans({}, 'lcshop'), value) }}
-
- {% endmacro %}
-
-
- {% macro box_total_order() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
-
- {{ macros.box_info('bg-danger', 'euro-sign',"field.OrderShop.total"|trans({}, 'lcshop'), ' ${order.totalWithTax} €') }}
-
- {% endmacro %}
-
-
- {% macro box_address_invoice() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
-
- {% set value = '<span v-if="order.invoiceAddress!=false">
- <address v-html="order.invoiceAddress"></address>
- </span>
- <span v-else>
- Aucune adresse de facturation défini.
- </span>' %}
- {{ macros.box_info('bg-info', 'address-card',"field.default.invoiceAddress"|trans({}, 'lcshop'), value , _self.order_modal_button('#modal-order-invoice-address')) }}
-
- {% endmacro %}
-
- {% macro box_main_order() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
- {% set value = '${order.mainOrder.reference} <a :href="order.mainOrder.link">[Afficher]</a>' %}
- {{ macros.box_info('bg-danger', 'link',"field.OrderShop.mainOrder"|trans({}, 'lcshop'), value) }}
-
- {% endmacro %}
-
- {% macro box_address_delivery() %}
- {% embed '@LcShop/backend/default/block/embed_box.twig' %}
- {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
- {% trans_default_domain 'lcshop' %}
- {% block class %}bg-success{% endblock %}
- {% block icon %}map-marked-alt{% endblock %}
- {% block label %}{{ "field.default.deliveryAddress"|trans({}, 'lcshop')}}{% endblock %}
- {% block value %}
- <div v-if="order.deliveryType == 'home'">
- <address v-html="order.deliveryAddress">
- </address>
- </div>
- <div v-else-if="order.deliveryType == 'point-sale'">
- <address v-html="order.deliveryPointSale">
- </address>
- </div>
- <div v-else>
- Aucun lieu de livraison défini.
- </div>
- {% endblock %}
- {% block button %}
- {{ order_macros.order_modal_button('#modal-order-delivery-address') }}
- {% endblock %}
- {% endembed %}
- {% endmacro %}
-
- {% macro box_delivery_slot() %}
- {% embed '@LcShop/backend/default/block/embed_box.twig' %}
- {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
- {% trans_default_domain 'lcshop' %}
- {% block class %}bg-success{% endblock %}
- {% block icon %}clock{% endblock %}
- {% block label %}{{ "field.default.deliveryAvailabilty"|trans({}, 'lcshop') }}{% endblock %}
- {% block value %}
- <div v-if="order.deliveryType == 'home'">
- <div v-html="order.deliveryAvailabilityZone">
- </div>
- </div>
- <div v-else-if="order.deliveryType == 'point-sale'">
- <div v-html="order.deliveryAvailabilityPointSale">
- </div>
- </div>
- <div v-else>
- Aucun créneau défini.
- </div>
- {% endblock %}
- {% block button %}
- {{ order_macros.order_modal_button('#modal-order-delivery-availability') }}
- {% endblock %}
- {% endembed %}
- {% endmacro %}
-
-
-
- {% macro box_payments() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
- {% set tools = '<div v-show="order.isOrderPaid">
- <h5>
- <span class="badge badge-success">
- <i class="icon fas fa-check"></i> Commande soldé
- </span>
- </h5>
- </div>
- <div v-show="order.isOrderPaid==false" >
- <h5>
- <span class="badge badge-error">
- <i class="icon fas fa-check"></i> Commande non soldé
- </span>
- </h5>
- </div>' %}
-
- {{ macros.card_start("OrderShop.payment", 'danger card-outline', false, tools) }}
- <table class="table table-striped" style="margin-bottom: 15px">
- <tbody>
- <thead>
- <tr>
- <th>Mode de règlement</th>
- <th>Date</th>
- <th>Montant</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <template v-for="(orderPayment, i) in order.orderPayments">
- <tr>
- <td>${orderPayment.meanPaymentText}</td>
- <td>${orderPayment.paidAtText}</td>
- <td>${orderPayment.amount}</td>
- <td>
- <button v-show="orderPayment.editable && editionMode && modalExist('#modal-delete-order-payment')" class="btn-sm btn-info" type="button" @click="editOrderPayment(orderPayment.id)">
- <i class="fa fa-pen"></i>
- </button>
- <button v-show="orderPayment.editable && editionMode && modalExist('#modal-delete-order-payment')"
- type="button" class="btn-sm btn-danger"
- @click="modalDeleteOrderPayment(orderPayment.id)">
- <i class="fa fa-trash"></i>
- </button>
- </td>
- </tr>
- </template>
- </tbody>
- </table>
- <div class="col-11">
- {{ _self.order_modal_button('#modal-order-payment', 'btn-info', "action.order.addOrderPayment") }}
-
- <strong class="float-right">Total règlement : ${order.totalOrderPaid} €</strong>
-
- {#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#}
- </div>
- {{ macros.card_end() }}
- {% endmacro %}
-
-
-
- {% macro box_documents() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
-
- {{ macros.card_start("OrderShop.documents", 'primary card-outline') }}
- <table class="table table-striped">
- <tbody>
- <thead>
- <tr>
- <th>Date</th>
- <th>Type</th>
- <th>Numéro</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <template v-for="(orderDocument, i) in order.orderDocuments">
- <tr>
- <td>${orderDocument.date}</td>
- <td>Facture</td>
- <td>${orderDocument.reference}</td>
- <td>
- <a :href="'./?entity=Document&action=downloadInvoice&id='+i" class="btn-sm btn-default">Télécharger</a>
- </td>
- </tr>
- </template>
- </tbody>
- </table>
-
- {{ macros.card_end() }}
- {% endmacro %}
-
-
-
-
- {% macro box_complementary() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
-
- {{ macros.card_start("OrderShop.complementary", 'primary card-outline') }}
- <table class="table table-striped">
- <tbody>
- <thead>
- <tr>
- <th>Réference</th>
- <th>Date</th>
- <th>total</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <template v-for="(complementaryOrderShop, i) in order.complementaryOrderShops">
- <tr>
- <td>${complementaryOrderShop.reference}</td>
- <td>${complementaryOrderShop.date}</td>
- <td>${complementaryOrderShop.total}</td>
- <td>
- <a :href="complementaryOrderShop.link" class="btn-sm btn-default">Afficher</a>
- </td>
- </tr>
- </template>
- </tbody>
- </table>
-
- {{ macros.card_end() }}
- {% endmacro %}
-
-
-
- {% macro box_tickets() %}
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
-
- {{ macros.card_start("OrderShop.tickets", 'warning card-outline') }}
- <table class="table table-striped">
- <tbody>
- <thead>
- <tr>
- <th>Date</th>
- <th>Status</th>
- <th>Subject</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- <template v-for="(ticket, i) in order.tickets">
- <tr>
- <td>${ticket.date}</td>
- <td>${ticket.status}</td>
- <td>${ticket.subject}</td>
- <td>
- <a :href="ticket.link" class="btn-sm btn-default">Afficher</a>
- </td>
- </tr>
- </template>
- </tbody>
- </table>
-
- {{ macros.card_end() }}
- {% endmacro %}
-
-
- {% macro box_status() %}
- {% embed '@LcShop/backend/default/block/embed_box.twig' %}
- {% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
- {% trans_default_domain 'lcshop' %}
- {% block class %}bg-success{% endblock %}
- {% block icon %}info{% endblock %}
- {% block label %}{{ "field.OrderShop.status"|trans({}, 'lcshop')}}{% endblock %}
- {% block value %}
- <strong> ${order.orderStatus}</strong>
- {% endblock %}
- {% block button %}
- {{ order_macros.order_modal_button('#modal-order-status') }}
- {% endblock %}
- {% endembed %}
- {% endmacro %}
-
- {% macro order_modal_button(modalId, class="btn-primary", trad="action.edit", icon=false) %}
-
- <button v-show="editionMode && modalExist('{{ modalId }}')" type="button" class="btn-sm {{ class }}"
- data-toggle="modal"
- data-target="{{ modalId }}">
- {% if icon %}
- <i class="fa fa-{{ icon }}"></i>
- {% endif %}
- {{ trad|trans }}
- </button>
-
- {% endmacro order_modal_button %}
|