@@ -464,8 +464,12 @@ class OrderController extends AdminController | |||
break; | |||
case OrderStatus::ALIAS_PAID_BY_CREDIT : | |||
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(); | |||
break; | |||
$parameters['form_delete_order_payment'] = $this->createCustomForm(DeleteOrderPaymentType::class, 'deleteOrderPayment', $parameters)->createView(); | |||
break; | |||
} | |||
if($orderShop->isValid()){ |
@@ -52,6 +52,11 @@ body { | |||
float: left; | |||
} | |||
/* line 30, ../../sass/backend/custom.scss */ | |||
.card-tools h5 { | |||
margin-bottom: 0px; | |||
} | |||
/***************************************** ADMIN SIDEBAR ***************************************/ | |||
/* line 34, ../../sass/backend/custom.scss */ | |||
.main-sidebar p { |
@@ -182,7 +182,7 @@ appOrder = new Vue({ | |||
this.postForm('#orderInvoiceAddressForm', '#modal-order-invoice-address'); | |||
}, | |||
updateOrderDeliveryAddress: function () { | |||
this.postForm('#orderDeliveryAddressForm', '#modal-order-delivery-address'); | |||
this.postForm('#orderDeliveryAddressForm', '#modal-order-delivery-address', true); | |||
}, | |||
updateOrderDeliveryAvailability: function () { | |||
this.postForm('#orderDeliveryAvailabilityForm', '#modal-order-delivery-availability'); | |||
@@ -217,7 +217,7 @@ appOrder = new Vue({ | |||
gotoPaymentLink: function(){ | |||
this.postForm('#orderSendPaymentLinkForm', '#modal-order-send-payment-link'); | |||
}, | |||
postForm: function (formId, modalId) { | |||
postForm: function (formId, modalId, refresh =false) { | |||
var app = this; | |||
if(checkFormValidity(formId)) { | |||
this.isLoading = true; | |||
@@ -230,6 +230,7 @@ appOrder = new Vue({ | |||
success: function (response) { | |||
setFlashMessages(response.flashMessages); | |||
app.updateOrder(response.data); | |||
if(refresh)window.location.reload(); | |||
} | |||
}); | |||
} |
@@ -1,5 +1,5 @@ | |||
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 btn = this; | |||
@@ -44,7 +44,7 @@ function initUserAddressForm(form, btn) { | |||
initUserAddressForm($('#modal-user-address').find('form')); | |||
} else { | |||
if($(btn).hasClass('btn-edit-user-address')){ | |||
$('btn').parents('.user-address-item').replaceWith(response.data); | |||
$(btn).parents('.user-address-item').replaceWith(response.data); | |||
}else{ | |||
$('#user-addresses').append(response.data); | |||
} |
@@ -27,7 +27,7 @@ body{font-size: 0.9rem;} | |||
} | |||
.card-tools h5{margin-bottom: 0px;} | |||
/***************************************** ADMIN SIDEBAR ***************************************/ |
@@ -52,6 +52,7 @@ group: | |||
addRedeliveryOrderProduct: Ajouter une relivraison | |||
payment: Historique des transactions | |||
documents: Documents | |||
deliveryAddress: Adresse de livraison | |||
Ticket: | |||
listMessages: Liste des messages | |||
None: Aucune valeur | |||
@@ -345,6 +346,12 @@ field: | |||
quantityProduct: Quantité (en rapport à l'unité) | |||
unit: Unité | |||
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: | |||
credit: Solde du compte prépayé | |||
CreditHistory: |
@@ -1,28 +1,29 @@ | |||
{% 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> | |||
{% endif %} | |||
</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 %} | |||
@@ -53,7 +53,7 @@ | |||
</head> | |||
{% 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> | |||
document.body.classList.add( | |||
'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'), |
@@ -71,7 +71,6 @@ | |||
{% verbatim %}{{orderProduct.priceWithTax}}{% endverbatim %}€ | |||
</td> | |||
<td> | |||
{% verbatim %}{{orderProduct.buyingPrice}}{% endverbatim %}€ <br /> | |||
{% verbatim %}{{orderProduct.totalMargin}}{% endverbatim %}€ / | |||
{% verbatim %}{{orderProduct.marginPercent}}{% endverbatim %}% | |||
</td> | |||
@@ -100,7 +99,7 @@ | |||
</td> | |||
<td :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 | |||
</button> | |||
<div class="dropdown-menu" aria-labelledby="dropdownMenu"> | |||
@@ -136,7 +135,7 @@ | |||
</div> | |||
</div> | |||
<div class="col"></div> | |||
<div class="col-5"> | |||
<div class="table-responsive"> | |||
<table class="table"> | |||
@@ -195,6 +194,7 @@ | |||
</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"> | |||
@@ -324,9 +324,23 @@ | |||
{% 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') }} | |||
<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> | |||
<thead> | |||
<tr> | |||
@@ -356,29 +370,13 @@ | |||
</template> | |||
</tbody> | |||
</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#} | |||
{{ _self.order_modal_button('#modal-order-payment', 'btn-info', "action.order.addOrderPayment") }} | |||
</div> | |||
{{ macros.card_end() }} | |||
{% endmacro %} | |||
@@ -405,7 +403,7 @@ | |||
<td>Facture</td> | |||
<td>${orderDocument.reference}</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> | |||
</tr> | |||
</template> |
@@ -60,9 +60,7 @@ | |||
{% include '@LcShop/backend/order/form/card_orderproducts.html.twig' %} | |||
{{ macros.card_overlay('isLoading') }} | |||
{{ macros.card_end() }} | |||
{{ macros.card_end('isLoading') }} | |||
</div> | |||
{% if form_order_invoice_address is defined %} |
@@ -21,13 +21,11 @@ | |||
{% for address in entity.addresses %} | |||
{% include '@LcShop/backend/user/block_useraddress.html.twig' %} | |||
{% 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> | |||
<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> | |||