@@ -350,6 +350,8 @@ class OrderController extends AdminController | |||
//TODO 0 écrire | |||
} | |||
public function deleteOrderReductionCartAction() | |||
{ | |||
$orderShop = $this->getOrderShopEntity(); |
@@ -53,6 +53,7 @@ class AddOrderReductionCartType extends AbstractType | |||
{ | |||
$resolver->setDefaults([ | |||
'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(), | |||
'translation_domain'=> 'lcshop' | |||
]); | |||
} | |||
} |
@@ -59,6 +59,7 @@ class AddOrderReductionCreditType extends AbstractType | |||
{ | |||
$resolver->setDefaults([ | |||
'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(), | |||
'translation_domain'=> 'lcshop' | |||
]); | |||
} | |||
} |
@@ -53,6 +53,7 @@ class AddRedeliveryOrderProductType extends AbstractType | |||
{ | |||
$resolver->setDefaults([ | |||
'data_class' => $this->em->getClassMetadata(OrderProductInterface::class)->getName(), | |||
'translation_domain'=> 'lcshop' | |||
]); | |||
} | |||
} |
@@ -34,6 +34,9 @@ class AddReductionCreditType extends AbstractType | |||
public function buildForm(FormBuilderInterface $builder, array $options) | |||
{ | |||
// TODO ce form n'a pas été testé !!!!! voir exemple sur PDL | |||
$entity = $options['data']; | |||
$reductionCreditClass = $this->em->getClassMetadata(ReductionCreditInterface::class); | |||
@@ -51,6 +54,7 @@ class AddReductionCreditType extends AbstractType | |||
{ | |||
$resolver->setDefaults([ | |||
'data_class' => $this->em->getClassMetadata(ReductionCreditInterface::class)->getName(), | |||
'translation_domain'=> 'lcshop' | |||
]); | |||
} | |||
} |
@@ -34,14 +34,24 @@ Vue.component('order-product', { | |||
$(this.$refs.fieldQuantity).val(0); | |||
this.$parent.updateOrderProducts(); | |||
}, | |||
modalExist:function(modalId){ | |||
return this.$parent.modalExist(modalId); | |||
}, | |||
modalAddRedeliveryOrderProduct:function () { | |||
$(this.$parent.$refs['addRedeliveryOrderProductFormOrderProduct']).val(this.orderProduct.id); | |||
$(this.$parent.$refs['addRedeliveryOrderProductFormTitle']).val(this.orderProduct.title); | |||
$(this.$parent.$refs['addRedeliveryOrderProductFormUnit']).val(this.orderProduct.unit).trigger('change'); | |||
$(this.$parent.$refs['addRedeliveryOrderProductFormQuantityProduct']).val(this.orderProduct.quantityProduct); | |||
$(this.$parent.$refs['addRedeliveryOrderProductFormQuantityOrder']).val(this.orderProduct.quantityOrder); | |||
$('#modal-add-redelivery-order-product').modal('show'); | |||
}, | |||
modalAddReductionCredit:function () { | |||
$(this.$parent.$refs['addReductionCreditFormTitle']).val(this.orderProduct.title); | |||
$(this.$parent.$refs['addReductionCreditFormValue']).val(this.orderProduct.price); | |||
$(this.$parent.$refs['addReductionCreditFormBehaviorTaxRate']).val('tax-included').trigger('change'); | |||
$('#modal-add-reduction-credit').modal('show'); | |||
} | |||
} | |||
@@ -188,7 +198,7 @@ appOrder = new Vue({ | |||
this.postForm('#orderDeliveryAvailabilityForm', '#modal-order-delivery-availability'); | |||
}, | |||
addOrderReductionCart: function () { | |||
this.postForm('#addOrderReductionCartForm', '#modal-add-reduction-cart'); | |||
this.postForm('#addOrderReductionCartForm', '#modal-add-order-reduction-cart'); | |||
}, | |||
modalDeleteOrderReductionCart: function (id) { | |||
log($(this.$refs['deleteOrderReductionCartId'])); | |||
@@ -206,11 +216,14 @@ appOrder = new Vue({ | |||
this.postForm('#deleteOrderReductionCreditForm', '#modal-delete-reduction-credit'); | |||
}, | |||
addOrderReductionCredit: function () { | |||
this.postForm('#addOrderReductionCreditForm', '#modal-add-reduction-credit'); | |||
this.postForm('#addOrderReductionCreditForm', '#modal-add-order-reduction-credit'); | |||
}, | |||
addRedeliveryOrderProduct: function () { | |||
this.postForm('#addRedeliveryOrderProductForm', '#modal-add-redelivery-order-product'); | |||
}, | |||
addReductionCredit: function () { | |||
this.postForm('#addReductionCreditForm', '#modal-add-reduction-credit'); | |||
}, | |||
sendPaymentLink: function(){ | |||
this.postForm('#orderSendPaymentLinkForm', '#modal-order-send-payment-link'); | |||
}, |
@@ -60,6 +60,7 @@ group: | |||
deliveryAddress: Adresse de livraison | |||
complementary: Commandes complémentaires | |||
tickets: Tickets relatif à la commande | |||
Ticket: | |||
listMessages: Liste des messages | |||
PointSale: | |||
@@ -88,6 +89,10 @@ success: | |||
changeDeliveryAddress: L'adresse de livraison a bien été modifié | |||
addProduct: Le produit a bien été ajouté | |||
addRedeliveryOrderProduct: Un produit a été ajouté en relivraison pour la prochaine commande client | |||
addReductionCart: La réduction a bien été ajouté | |||
addReductionCredit: L'avoir a bien été généré | |||
removeReductionCredit: L'avoir a bien été généré | |||
removeReductionCart: La réduction a bien été supprimé | |||
credit: | |||
debited: Le compte prépayé a bien été débité | |||
added: Le compte a bien été crédité | |||
@@ -123,7 +128,7 @@ error: | |||
alreadyInCart: La réduction a déjà été ajoutée à votre panier | |||
reductionCredit: | |||
userNotAllow: Cet avoir n'est pas disponible pour cet utilisateur | |||
alreayUse: Cet avoir a déjà été utilisé | |||
alreadyUse: Cet avoir a déjà été utilisé | |||
credit: | |||
notActive: Cet utilisateur n'a pas activé son compte prépayé | |||
debited: Une erreur est survenue, le crédit n'a pas été débité | |||
@@ -374,7 +379,8 @@ field: | |||
quantityOrder: Quantité commandé | |||
quantityProduct: Quantité (en rapport à l'unité) | |||
unit: Unité | |||
redeliverySupplier: Erreur producteur (A rappeler au prochain bon de commande producteur) | |||
redeliverySupplier: Erreur producteur | |||
redeliverySupplierOrder: À rappeler au prochain bon de commande producteur | |||
deliveryType: Type de livraison | |||
deliveryTypeOptions: | |||
point-sale: En ambassade | |||
@@ -386,6 +392,8 @@ field: | |||
deliveryAvailabilityPointSale: Choix du créneau | |||
deliveryAvailabilityZone: Choix du créneau | |||
mainOrder: "Complément à la commande :" | |||
reductionCart: Ajouter une réduction panier | |||
reductionCredit: Ajouter un avoir | |||
UserMerchant: | |||
credit: Solde du compte prépayé | |||
CreditHistory: | |||
@@ -446,6 +454,8 @@ action: | |||
editionMode: Activer mode édition | |||
viewMode: Désactiver mode édition | |||
addOrderPayment: Ajouter une transaction | |||
deleteReductionCart: Suuprimer une réduction | |||
deleteReductionCredit: Suuprimer un avoir | |||
sendPaymentLink: Envoyer le lien de paiement | |||
credit: | |||
add: Ajouter du crédit |
@@ -1,7 +1,7 @@ | |||
{% embed "@LcShop/backend/default/block/embed_modal.twig" %} | |||
{% trans_default_domain 'lcshop' %} | |||
{% block id %}modal-add-reduction-cart{% endblock %} | |||
{% block id %}modal-add-order-reduction-cart{% endblock %} | |||
{% block title %}{{ "action.order.addReductionCart"|trans }}{% endblock %} | |||
{% block form_start %} | |||
@@ -17,7 +17,7 @@ | |||
{% block footer %} | |||
{{ parent() }} | |||
{{ form_widget(form_add_order_reduction_credit.add, {"attr": {'class' : 'btn btn-primary', '@click': 'addOrderReductionCredit'}}) }} | |||
{{ form_widget(form_add_order_reduction_cart.add, {"attr": {'class' : 'btn btn-primary', '@click': 'addOrderReductionCart'}}) }} | |||
{% endblock %} | |||
{% block form_end %} |
@@ -1,11 +1,11 @@ | |||
{% embed "@LcShop/backend/default/block/embed_modal.twig" %} | |||
{% trans_default_domain 'lcshop' %} | |||
{% block id %}modal-reduction-credit{% endblock %} | |||
{% block id %}modal-add-order-reduction-credit{% endblock %} | |||
{% block title %}{{ "action.order.addReductionCredit"|trans }}{% endblock %} | |||
{% block form_start %} | |||
{{ form_start(form_add_order_reduction_credit, {'attr': {'class': 'row', 'id' : 'addOrderReductionCreditForm'}}) }} | |||
{{ form_start(form_add_order_reduction_credit, {'attr': {'id' : 'addOrderReductionCreditForm'}}) }} | |||
{% form_theme form_add_order_reduction_credit '@LcShop/backend/form/custom_bootstrap_4.html.twig' %} | |||
{% endblock %} | |||
@@ -17,7 +17,7 @@ | |||
{% block footer %} | |||
{{ parent() }} | |||
{{ form_row(form_add_order_reduction_credit.add, {"attr": {'class' : 'btn btn-primary', '@click': 'addOrderReductionCredit'}}) }} | |||
{{ form_widget(form_add_order_reduction_credit.add, {"attr": {'class' : 'btn btn-primary', '@click': 'addOrderReductionCredit'}}) }} | |||
{% endblock %} | |||
{% block form_end %} |
@@ -1,27 +1,29 @@ | |||
{% embed "@LcShop/backend/default/block/embed_modal.twig" %} | |||
{% trans_default_domain 'lcshop' %} | |||
{% block id %}modal-add-order-reduction-credit{% endblock %} | |||
{% block id %}modal-add-reduction-credit{% endblock %} | |||
{% block title %}{{ "action.order.addReductionCredit"|trans }}{% endblock %} | |||
{% block form_start %} | |||
{{ form_start(form_add_order_reduction_credit, {'attr': {'class': 'row', 'id' : 'addOrderReductionCreditForm'}}) }} | |||
{% form_theme form_add_order_reduction_credit '@LcShop/backend/form/custom_bootstrap_4.html.twig' %} | |||
{{ form_start(form_add_reduction_credit, {'attr': {'class': 'row', 'id' : 'addReductionCreditForm'}}) }} | |||
{% form_theme form_add_reduction_credit '@LcShop/backend/form/custom_bootstrap_4.html.twig' %} | |||
{% endblock %} | |||
{% block content %} | |||
<div class="col"> | |||
{{ form_row(form_add_order_reduction_credit.reductionCredit) }} | |||
{{ form_row(form_add_reduction_credit.title) }} | |||
{{ form_row(form_add_reduction_credit.value) }} | |||
{{ form_row(form_add_reduction_credit.behaviorTaxRate) }} | |||
</div> | |||
{% endblock %} | |||
{% block footer %} | |||
{{ parent() }} | |||
{{ form_row(form_add_order_reduction_credit.add, {"attr": {'class' : 'btn btn-primary', '@click': 'addOrderReductionCredit'}}) }} | |||
<button type="button" class="btn btn-primary" @click="addOrderReductionCredit">{{ 'action.add'|trans }}</button> | |||
{% endblock %} | |||
{% block form_end %} | |||
{{ form_end(form_add_order_reduction_credit) }} | |||
{{ form_end(form_add_reduction_credit) }} | |||
{% endblock %} | |||
{% endembed %} |
@@ -103,12 +103,12 @@ | |||
Actions | |||
</button> | |||
<div class="dropdown-menu" aria-labelledby="dropdownMenu"> | |||
<button v-show="orderProduct.hasRedelivery == false"type="button" class="dropdown-item" @click="modalAddRedeliveryOrderProduct"> | |||
Relivraison | |||
<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 type="button" class="dropdown-item" > | |||
Avoirs groupé | |||
<button v-show="modalExist('#modal-add-reduction-credit')" type="button" class="dropdown-item" @click="modalAddReductionCredit" > | |||
Générer un avoir | |||
</button> | |||
</div> | |||
</div> | |||
@@ -128,8 +128,8 @@ | |||
<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-reduction-cart', 'btn-warning', "action.order.addReductionCart", 'shopping-basket') }} | |||
{{ _self.order_modal_button('#modal-add-reduction-credit', 'btn-warning', "action.order.addReductionCredit", 'backspace') }} | |||
{{ _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> | |||
@@ -435,7 +435,7 @@ | |||
<td>${complementaryOrderShop.date}</td> | |||
<td>${complementaryOrderShop.total}</td> | |||
<td> | |||
<a :href="complementaryOrderShop.link" class="btn-sm btn-default">Afficher</a> | |||
</td> | |||
</tr> | |||
</template> | |||
@@ -450,7 +450,7 @@ | |||
{% macro box_tickets() %} | |||
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | |||
{{ macros.card_start("OrderShop.tickets", 'primary card-outline') }} | |||
{{ macros.card_start("OrderShop.tickets", 'warning card-outline') }} | |||
<table class="table table-striped"> | |||
<tbody> | |||
<thead> | |||
@@ -468,7 +468,7 @@ | |||
<td>${ticket.status}</td> | |||
<td>${ticket.subject}</td> | |||
<td> | |||
<a :href="ticket.link" class="btn-sm btn-default">Afficher</a> | |||
</td> | |||
</tr> | |||
</template> |
@@ -59,10 +59,10 @@ | |||
{% include '@LcShop/backend/order/form/modal_orderstatus.html.twig' %} | |||
{% endif %} | |||
{% if form_add_order_reduction_credit is defined %} | |||
{% include '@LcShop/backend/order/form/modal_addreductioncredit.html.twig' %} | |||
{% include '@LcShop/backend/order/form/modal_addorderreductioncredit.html.twig' %} | |||
{% endif %} | |||
{% if form_add_order_reduction_cart is defined %} | |||
{% include '@LcShop/backend/order/form/modal_addreductioncart.html.twig' %} | |||
{% include '@LcShop/backend/order/form/modal_addorderreductioncart.html.twig' %} | |||
{% endif %} | |||
{% if form_delete_order_reduction_cart is defined %} | |||
{% include '@LcShop/backend/order/form/modal_deletereductioncart.html.twig' %} |
@@ -76,10 +76,10 @@ | |||
{% include '@LcShop/backend/order/form/modal_orderstatus.html.twig' %} | |||
{% endif %} | |||
{% if form_add_order_reduction_credit is defined %} | |||
{% include '@LcShop/backend/order/form/modal_addreductioncredit.html.twig' %} | |||
{% include '@LcShop/backend/order/form/modal_addorderreductioncredit.html.twig' %} | |||
{% endif %} | |||
{% if form_add_order_reduction_cart is defined %} | |||
{% include '@LcShop/backend/order/form/modal_addreductioncart.html.twig' %} | |||
{% include '@LcShop/backend/order/form/modal_addorderreductioncart.html.twig' %} | |||
{% endif %} | |||
{% if form_delete_order_reduction_cart is defined %} | |||
{% include '@LcShop/backend/order/form/modal_deletereductioncart.html.twig' %} | |||
@@ -100,6 +100,10 @@ | |||
{% if form_add_redelivery_order_product is defined %} | |||
{% include '@LcShop/backend/order/form/modal_addredeliveryorderproduct.html.twig' %} | |||
{% endif %} | |||
{% if form_add_reduction_credit is defined %} | |||
{% include '@LcShop/backend/order/form/modal_addreductioncredit.html.twig' %} | |||
{% endif %} | |||
{% if form_order_send_payment_link is defined %} | |||
{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} |
@@ -49,6 +49,7 @@ class BackendTwigExtension extends AbstractExtension | |||
public function lcTrad($field, $entityName, $type = "field") | |||
{ | |||
if($entityName == 'OrderCart') $entityName ='OrderShop'; | |||
if(strpos($field, '.')===false) { | |||
$tradKey = $type . '.' . $entityName . '.' . $field; | |||
$tradDefaultKey = $type . '.default.' . $field; |