break; | break; | ||||
case OrderStatus::ALIAS_PAID_BY_CREDIT : | case OrderStatus::ALIAS_PAID_BY_CREDIT : | ||||
case OrderStatus::ALIAS_PAID_ONLINE : | case OrderStatus::ALIAS_PAID_ONLINE : | ||||
case OrderStatus::ALIAS_WAITING_DELIVERY : | |||||
$parameters['form_order_payment'] = $this->createCustomForm(OrderPaymentType::class, 'orderPayment', $parameters, false)->createView(); | |||||
$parameters['form_order_status'] = $this->createCustomForm(OrderStatusType::class, 'orderStatus', $parameters)->createView(); | $parameters['form_order_status'] = $this->createCustomForm(OrderStatusType::class, 'orderStatus', $parameters)->createView(); | ||||
break; | |||||
$parameters['form_delete_order_payment'] = $this->createCustomForm(DeleteOrderPaymentType::class, 'deleteOrderPayment', $parameters)->createView(); | |||||
break; | |||||
} | } | ||||
if($orderShop->isValid()){ | if($orderShop->isValid()){ |
float: left; | float: left; | ||||
} | } | ||||
/* line 30, ../../sass/backend/custom.scss */ | |||||
.card-tools h5 { | |||||
margin-bottom: 0px; | |||||
} | |||||
/***************************************** ADMIN SIDEBAR ***************************************/ | /***************************************** ADMIN SIDEBAR ***************************************/ | ||||
/* line 34, ../../sass/backend/custom.scss */ | /* line 34, ../../sass/backend/custom.scss */ | ||||
.main-sidebar p { | .main-sidebar p { |
this.postForm('#orderInvoiceAddressForm', '#modal-order-invoice-address'); | this.postForm('#orderInvoiceAddressForm', '#modal-order-invoice-address'); | ||||
}, | }, | ||||
updateOrderDeliveryAddress: function () { | updateOrderDeliveryAddress: function () { | ||||
this.postForm('#orderDeliveryAddressForm', '#modal-order-delivery-address'); | |||||
this.postForm('#orderDeliveryAddressForm', '#modal-order-delivery-address', true); | |||||
}, | }, | ||||
updateOrderDeliveryAvailability: function () { | updateOrderDeliveryAvailability: function () { | ||||
this.postForm('#orderDeliveryAvailabilityForm', '#modal-order-delivery-availability'); | this.postForm('#orderDeliveryAvailabilityForm', '#modal-order-delivery-availability'); | ||||
gotoPaymentLink: function(){ | gotoPaymentLink: function(){ | ||||
this.postForm('#orderSendPaymentLinkForm', '#modal-order-send-payment-link'); | this.postForm('#orderSendPaymentLinkForm', '#modal-order-send-payment-link'); | ||||
}, | }, | ||||
postForm: function (formId, modalId) { | |||||
postForm: function (formId, modalId, refresh =false) { | |||||
var app = this; | var app = this; | ||||
if(checkFormValidity(formId)) { | if(checkFormValidity(formId)) { | ||||
this.isLoading = true; | this.isLoading = true; | ||||
success: function (response) { | success: function (response) { | ||||
setFlashMessages(response.flashMessages); | setFlashMessages(response.flashMessages); | ||||
app.updateOrder(response.data); | app.updateOrder(response.data); | ||||
if(refresh)window.location.reload(); | |||||
} | } | ||||
}); | }); | ||||
} | } |
jQuery(document).ready(function () { | jQuery(document).ready(function () { | ||||
$('.btn-edit-user-address').on('click', function () { | |||||
$('.btn-edit-user-address, .btn-add-user-address').on('click', function () { | |||||
var url = $(this).data('url'); | var url = $(this).data('url'); | ||||
var btn = this; | var btn = this; | ||||
initUserAddressForm($('#modal-user-address').find('form')); | initUserAddressForm($('#modal-user-address').find('form')); | ||||
} else { | } else { | ||||
if($(btn).hasClass('btn-edit-user-address')){ | if($(btn).hasClass('btn-edit-user-address')){ | ||||
$('btn').parents('.user-address-item').replaceWith(response.data); | |||||
$(btn).parents('.user-address-item').replaceWith(response.data); | |||||
}else{ | }else{ | ||||
$('#user-addresses').append(response.data); | $('#user-addresses').append(response.data); | ||||
} | } |
} | } | ||||
.card-tools h5{margin-bottom: 0px;} | |||||
/***************************************** ADMIN SIDEBAR ***************************************/ | /***************************************** ADMIN SIDEBAR ***************************************/ |
addRedeliveryOrderProduct: Ajouter une relivraison | addRedeliveryOrderProduct: Ajouter une relivraison | ||||
payment: Historique des transactions | payment: Historique des transactions | ||||
documents: Documents | documents: Documents | ||||
deliveryAddress: Adresse de livraison | |||||
Ticket: | Ticket: | ||||
listMessages: Liste des messages | listMessages: Liste des messages | ||||
None: Aucune valeur | None: Aucune valeur | ||||
quantityProduct: Quantité (en rapport à l'unité) | quantityProduct: Quantité (en rapport à l'unité) | ||||
unit: Unité | unit: Unité | ||||
redeliverySupplier: Erreur producteur (A rappeler au prochain bon de commande producteur) | redeliverySupplier: Erreur producteur (A rappeler au prochain bon de commande producteur) | ||||
reference: Référence | |||||
deliveryAvailabilityPointSale: Créneau de livraison en Ambassade | |||||
deliveryType: Adresse de livraison | |||||
deliveryTypeOptions: | |||||
point-sale: En ambassade | |||||
home: À domicile | |||||
UserMerchant: | UserMerchant: | ||||
credit: Solde du compte prépayé | credit: Solde du compte prépayé | ||||
CreditHistory: | CreditHistory: |
{% macro card_start(zone = "default", card ='primary', fullWidth = false ) %} | |||||
<div class="card card-{{ card }}"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title"> | |||||
{% set label = "group."~zone %} | |||||
{{ label|trans({}, 'lcshop')|raw }} | |||||
</h3> | |||||
</div> | |||||
<div class="card-body {{ fullWidth == true ? 'p-0' : 'row' }}"> | |||||
{% endmacro card_start %} | |||||
{% macro card_overlay(attr) %} | |||||
</div> | |||||
{% endmacro card_overlay %} | |||||
{% macro card_end(overlay = false) %} | |||||
</div> | |||||
{% if overlay %} | |||||
<div v-if="{{ overlay }}==true" class="overlay"> | |||||
<i class="fas fa-2x fa-sync-alt"></i> | |||||
{% macro card_start(zone = "default", card ='primary', fullWidth = false, tools = false ) %} | |||||
<div class="card card-{{ card }}"> | |||||
<div class="card-header"> | |||||
<h3 class="card-title"> | |||||
{% set label = "group."~zone %} | |||||
{{ label|trans({}, 'lcshop')|raw }} | |||||
</h3> | |||||
{% if tools %} | |||||
<div class="card-tools"> | |||||
{{ tools|raw }} | |||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
</div> | </div> | ||||
<div class="card-body {{ fullWidth == true ? 'p-0' : 'row' }}"> | |||||
{% endmacro card_start %} | |||||
{% macro card_end(overlay = false) %} | |||||
</div> | |||||
{% if overlay %} | |||||
<div v-if="{{ overlay }}==true" class="overlay"> | |||||
<i class="fas fa-2x fa-sync-alt"></i> | |||||
</div> | |||||
{% endif %} | |||||
</div> | |||||
{% endmacro card_end %} | {% endmacro card_end %} | ||||
</head> | </head> | ||||
{% block body %} | {% block body %} | ||||
<body class="{% block body_class %}sidebar-mini layout-navbar-fixed{% endblock %}"> | |||||
<body class="{% block body_class %}sidebar-mini layout-navbar-fixed {% endblock %}{% block body_class_extend %}{% endblock %}"> | |||||
{# <script> | {# <script> | ||||
document.body.classList.add( | document.body.classList.add( | ||||
'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'), | 'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'), |
{% verbatim %}{{orderProduct.priceWithTax}}{% endverbatim %}€ | {% verbatim %}{{orderProduct.priceWithTax}}{% endverbatim %}€ | ||||
</td> | </td> | ||||
<td> | <td> | ||||
{% verbatim %}{{orderProduct.buyingPrice}}{% endverbatim %}€ <br /> | |||||
{% verbatim %}{{orderProduct.totalMargin}}{% endverbatim %}€ / | {% verbatim %}{{orderProduct.totalMargin}}{% endverbatim %}€ / | ||||
{% verbatim %}{{orderProduct.marginPercent}}{% endverbatim %}% | {% verbatim %}{{orderProduct.marginPercent}}{% endverbatim %}% | ||||
</td> | </td> | ||||
</td> | </td> | ||||
<td :class="editionMode ? '' : 'hidden'"> | <td :class="editionMode ? '' : 'hidden'"> | ||||
<div class="dropdown" :class="editionMode ? '' : 'hidden'"> | <div class="dropdown" :class="editionMode ? '' : 'hidden'"> | ||||
<button class="btn btn-info dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-expanded="false"> | |||||
<button class="btn-sm btn-info dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-expanded="false"> | |||||
Actions | Actions | ||||
</button> | </button> | ||||
<div class="dropdown-menu" aria-labelledby="dropdownMenu"> | <div class="dropdown-menu" aria-labelledby="dropdownMenu"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="col"></div> | |||||
<div class="col-5"> | <div class="col-5"> | ||||
<div class="table-responsive"> | <div class="table-responsive"> | ||||
<table class="table"> | <table class="table"> | ||||
</table> | </table> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="col"></div> | |||||
<div class="col-12"> | <div class="col-12"> | ||||
{#<button v-show="order.user" type="button" class="btn btn-danger" @click="switchEditionMode"> | {#<button v-show="order.user" type="button" class="btn btn-danger" @click="switchEditionMode"> | ||||
<template v-if="editionMode"> | <template v-if="editionMode"> | ||||
{% macro box_payments() %} | {% macro box_payments() %} | ||||
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | {% 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') }} | |||||
<table class="table table-striped"> | |||||
{{ macros.card_start("OrderShop.payment", 'danger card-outline', false, tools) }} | |||||
<table class="table table-striped" style="margin-bottom: 15px"> | |||||
<tbody> | <tbody> | ||||
<thead> | <thead> | ||||
<tr> | <tr> | ||||
</template> | </template> | ||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
<div class="col-8"> | |||||
<div class="col-11"> | |||||
{{ _self.order_modal_button('#modal-order-payment', 'btn-info', "action.order.addOrderPayment") }} | |||||
<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> | |||||
</div> | |||||
<div class="col-4"> | |||||
<span class="float-right">Total : ${order.totalOrderPaid}</span> | |||||
</div> | |||||
<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#} | {#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#} | ||||
{{ _self.order_modal_button('#modal-order-payment', 'btn-info', "action.order.addOrderPayment") }} | |||||
</div> | |||||
{{ macros.card_end() }} | {{ macros.card_end() }} | ||||
{% endmacro %} | {% endmacro %} | ||||
<td>Facture</td> | <td>Facture</td> | ||||
<td>${orderDocument.reference}</td> | <td>${orderDocument.reference}</td> | ||||
<td> | <td> | ||||
<a :href="'./?entity=Document&action=downloadInvoice&id='+i" class="btn btn-default">Télécharger</a> | |||||
<a :href="'./?entity=Document&action=downloadInvoice&id='+i" class="btn-sm btn-default">Télécharger</a> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</template> | </template> |
{% include '@LcShop/backend/order/form/card_orderproducts.html.twig' %} | {% include '@LcShop/backend/order/form/card_orderproducts.html.twig' %} | ||||
{{ macros.card_overlay('isLoading') }} | |||||
{{ macros.card_end() }} | |||||
{{ macros.card_end('isLoading') }} | |||||
</div> | </div> | ||||
{% if form_order_invoice_address is defined %} | {% if form_order_invoice_address is defined %} |
{% for address in entity.addresses %} | {% for address in entity.addresses %} | ||||
{% include '@LcShop/backend/user/block_useraddress.html.twig' %} | {% include '@LcShop/backend/user/block_useraddress.html.twig' %} | ||||
{% endfor %} | {% endfor %} | ||||
<div class="col-6"> | |||||
<button type="button" data-url="{{ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': 'new'}) }}" | |||||
class="btn btn-primary btn-edit-user-address" ><i class="fa fa-plus"></i> {{ 'action.address.add'|trans }} | |||||
</button> | |||||
</div> | |||||
</div> | </div> | ||||
<button type="button" data-url="{{ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': 'new'}) }}" | |||||
class="btn btn-primary btn-add-user-address" ><i class="fa fa-plus"></i> {{ 'action.address.add'|trans }} | |||||
</button> | |||||
</div> | </div> | ||||
</div> | </div> | ||||