Browse Source

Correctifs backoffice

feature/export_comptable
Fab 4 years ago
parent
commit
1500297a87
14 changed files with 67 additions and 28 deletions
  1. +2
    -0
      ShopBundle/Controller/Backend/OrderController.php
  2. +1
    -0
      ShopBundle/Form/Backend/Order/AddOrderReductionCartType.php
  3. +1
    -0
      ShopBundle/Form/Backend/Order/AddOrderReductionCreditType.php
  4. +1
    -0
      ShopBundle/Form/Backend/Order/AddRedeliveryOrderProductType.php
  5. +4
    -0
      ShopBundle/Form/Backend/Order/AddReductionCreditType.php
  6. +15
    -2
      ShopBundle/Resources/public/js/backend/script/order/vuejs-order.js
  7. +12
    -2
      ShopBundle/Resources/translations/lcshop.fr.yaml
  8. +2
    -2
      ShopBundle/Resources/views/backend/order/form/modal_addorderreductioncart.html.twig
  9. +3
    -3
      ShopBundle/Resources/views/backend/order/form/modal_addorderreductioncredit.html.twig
  10. +8
    -6
      ShopBundle/Resources/views/backend/order/form/modal_addreductioncredit.html.twig
  11. +9
    -9
      ShopBundle/Resources/views/backend/order/macros.html.twig
  12. +2
    -2
      ShopBundle/Resources/views/backend/order/show-cart.html.twig
  13. +6
    -2
      ShopBundle/Resources/views/backend/order/show-order.html.twig
  14. +1
    -0
      ShopBundle/Twig/BackendTwigExtension.php

+ 2
- 0
ShopBundle/Controller/Backend/OrderController.php View File

//TODO 0 écrire //TODO 0 écrire
} }




public function deleteOrderReductionCartAction() public function deleteOrderReductionCartAction()
{ {
$orderShop = $this->getOrderShopEntity(); $orderShop = $this->getOrderShopEntity();

+ 1
- 0
ShopBundle/Form/Backend/Order/AddOrderReductionCartType.php View File

{ {
$resolver->setDefaults([ $resolver->setDefaults([
'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(), 'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(),
'translation_domain'=> 'lcshop'
]); ]);
} }
} }

+ 1
- 0
ShopBundle/Form/Backend/Order/AddOrderReductionCreditType.php View File

{ {
$resolver->setDefaults([ $resolver->setDefaults([
'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(), 'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(),
'translation_domain'=> 'lcshop'
]); ]);
} }
} }

+ 1
- 0
ShopBundle/Form/Backend/Order/AddRedeliveryOrderProductType.php View File

{ {
$resolver->setDefaults([ $resolver->setDefaults([
'data_class' => $this->em->getClassMetadata(OrderProductInterface::class)->getName(), 'data_class' => $this->em->getClassMetadata(OrderProductInterface::class)->getName(),
'translation_domain'=> 'lcshop'
]); ]);
} }
} }

+ 4
- 0
ShopBundle/Form/Backend/Order/AddReductionCreditType.php View File



public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {

// TODO ce form n'a pas été testé !!!!! voir exemple sur PDL

$entity = $options['data']; $entity = $options['data'];


$reductionCreditClass = $this->em->getClassMetadata(ReductionCreditInterface::class); $reductionCreditClass = $this->em->getClassMetadata(ReductionCreditInterface::class);
{ {
$resolver->setDefaults([ $resolver->setDefaults([
'data_class' => $this->em->getClassMetadata(ReductionCreditInterface::class)->getName(), 'data_class' => $this->em->getClassMetadata(ReductionCreditInterface::class)->getName(),
'translation_domain'=> 'lcshop'
]); ]);
} }
} }

+ 15
- 2
ShopBundle/Resources/public/js/backend/script/order/vuejs-order.js View File

$(this.$refs.fieldQuantity).val(0); $(this.$refs.fieldQuantity).val(0);
this.$parent.updateOrderProducts(); this.$parent.updateOrderProducts();
}, },
modalExist:function(modalId){
return this.$parent.modalExist(modalId);
},
modalAddRedeliveryOrderProduct:function () { modalAddRedeliveryOrderProduct:function () {



$(this.$parent.$refs['addRedeliveryOrderProductFormOrderProduct']).val(this.orderProduct.id); $(this.$parent.$refs['addRedeliveryOrderProductFormOrderProduct']).val(this.orderProduct.id);
$(this.$parent.$refs['addRedeliveryOrderProductFormTitle']).val(this.orderProduct.title); $(this.$parent.$refs['addRedeliveryOrderProductFormTitle']).val(this.orderProduct.title);
$(this.$parent.$refs['addRedeliveryOrderProductFormUnit']).val(this.orderProduct.unit).trigger('change'); $(this.$parent.$refs['addRedeliveryOrderProductFormUnit']).val(this.orderProduct.unit).trigger('change');
$(this.$parent.$refs['addRedeliveryOrderProductFormQuantityProduct']).val(this.orderProduct.quantityProduct); $(this.$parent.$refs['addRedeliveryOrderProductFormQuantityProduct']).val(this.orderProduct.quantityProduct);
$(this.$parent.$refs['addRedeliveryOrderProductFormQuantityOrder']).val(this.orderProduct.quantityOrder); $(this.$parent.$refs['addRedeliveryOrderProductFormQuantityOrder']).val(this.orderProduct.quantityOrder);
$('#modal-add-redelivery-order-product').modal('show'); $('#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');
} }


} }
this.postForm('#orderDeliveryAvailabilityForm', '#modal-order-delivery-availability'); this.postForm('#orderDeliveryAvailabilityForm', '#modal-order-delivery-availability');
}, },
addOrderReductionCart: function () { addOrderReductionCart: function () {
this.postForm('#addOrderReductionCartForm', '#modal-add-reduction-cart');
this.postForm('#addOrderReductionCartForm', '#modal-add-order-reduction-cart');
}, },
modalDeleteOrderReductionCart: function (id) { modalDeleteOrderReductionCart: function (id) {
log($(this.$refs['deleteOrderReductionCartId'])); log($(this.$refs['deleteOrderReductionCartId']));
this.postForm('#deleteOrderReductionCreditForm', '#modal-delete-reduction-credit'); this.postForm('#deleteOrderReductionCreditForm', '#modal-delete-reduction-credit');
}, },
addOrderReductionCredit: function () { addOrderReductionCredit: function () {
this.postForm('#addOrderReductionCreditForm', '#modal-add-reduction-credit');
this.postForm('#addOrderReductionCreditForm', '#modal-add-order-reduction-credit');
}, },
addRedeliveryOrderProduct: function () { addRedeliveryOrderProduct: function () {
this.postForm('#addRedeliveryOrderProductForm', '#modal-add-redelivery-order-product'); this.postForm('#addRedeliveryOrderProductForm', '#modal-add-redelivery-order-product');
}, },
addReductionCredit: function () {
this.postForm('#addReductionCreditForm', '#modal-add-reduction-credit');
},
sendPaymentLink: function(){ sendPaymentLink: function(){
this.postForm('#orderSendPaymentLinkForm', '#modal-order-send-payment-link'); this.postForm('#orderSendPaymentLinkForm', '#modal-order-send-payment-link');
}, },

+ 12
- 2
ShopBundle/Resources/translations/lcshop.fr.yaml View File

deliveryAddress: Adresse de livraison deliveryAddress: Adresse de livraison
complementary: Commandes complémentaires complementary: Commandes complémentaires
tickets: Tickets relatif à la commande tickets: Tickets relatif à la commande

Ticket: Ticket:
listMessages: Liste des messages listMessages: Liste des messages
PointSale: PointSale:
changeDeliveryAddress: L'adresse de livraison a bien été modifié changeDeliveryAddress: L'adresse de livraison a bien été modifié
addProduct: Le produit a bien été ajouté addProduct: Le produit a bien été ajouté
addRedeliveryOrderProduct: Un produit a été ajouté en relivraison pour la prochaine commande client 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: credit:
debited: Le compte prépayé a bien été débité debited: Le compte prépayé a bien été débité
added: Le compte a bien été crédité added: Le compte a bien été crédité
alreadyInCart: La réduction a déjà été ajoutée à votre panier alreadyInCart: La réduction a déjà été ajoutée à votre panier
reductionCredit: reductionCredit:
userNotAllow: Cet avoir n'est pas disponible pour cet utilisateur 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: credit:
notActive: Cet utilisateur n'a pas activé son compte prépayé 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é debited: Une erreur est survenue, le crédit n'a pas été débité
quantityOrder: Quantité commandé quantityOrder: Quantité commandé
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
redeliverySupplierOrder: À rappeler au prochain bon de commande producteur
deliveryType: Type de livraison deliveryType: Type de livraison
deliveryTypeOptions: deliveryTypeOptions:
point-sale: En ambassade point-sale: En ambassade
deliveryAvailabilityPointSale: Choix du créneau deliveryAvailabilityPointSale: Choix du créneau
deliveryAvailabilityZone: Choix du créneau deliveryAvailabilityZone: Choix du créneau
mainOrder: "Complément à la commande :" mainOrder: "Complément à la commande :"
reductionCart: Ajouter une réduction panier
reductionCredit: Ajouter un avoir
UserMerchant: UserMerchant:
credit: Solde du compte prépayé credit: Solde du compte prépayé
CreditHistory: CreditHistory:
editionMode: Activer mode édition editionMode: Activer mode édition
viewMode: Désactiver mode édition viewMode: Désactiver mode édition
addOrderPayment: Ajouter une transaction addOrderPayment: Ajouter une transaction
deleteReductionCart: Suuprimer une réduction
deleteReductionCredit: Suuprimer un avoir
sendPaymentLink: Envoyer le lien de paiement sendPaymentLink: Envoyer le lien de paiement
credit: credit:
add: Ajouter du crédit add: Ajouter du crédit

+ 2
- 2
ShopBundle/Resources/views/backend/order/form/modal_addorderreductioncart.html.twig View File

{% embed "@LcShop/backend/default/block/embed_modal.twig" %} {% embed "@LcShop/backend/default/block/embed_modal.twig" %}
{% trans_default_domain 'lcshop' %} {% 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 title %}{{ "action.order.addReductionCart"|trans }}{% endblock %}


{% block form_start %} {% block form_start %}


{% block footer %} {% block footer %}
{{ parent() }} {{ 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 %} {% endblock %}


{% block form_end %} {% block form_end %}

+ 3
- 3
ShopBundle/Resources/views/backend/order/form/modal_addorderreductioncredit.html.twig View File

{% embed "@LcShop/backend/default/block/embed_modal.twig" %} {% embed "@LcShop/backend/default/block/embed_modal.twig" %}
{% trans_default_domain 'lcshop' %} {% 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 title %}{{ "action.order.addReductionCredit"|trans }}{% endblock %}


{% block form_start %} {% 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' %} {% form_theme form_add_order_reduction_credit '@LcShop/backend/form/custom_bootstrap_4.html.twig' %}
{% endblock %} {% endblock %}




{% block footer %} {% block footer %}
{{ parent() }} {{ 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 %} {% endblock %}


{% block form_end %} {% block form_end %}

+ 8
- 6
ShopBundle/Resources/views/backend/order/form/modal_addreductioncredit.html.twig View File

{% embed "@LcShop/backend/default/block/embed_modal.twig" %} {% embed "@LcShop/backend/default/block/embed_modal.twig" %}
{% trans_default_domain 'lcshop' %} {% 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 title %}{{ "action.order.addReductionCredit"|trans }}{% endblock %}


{% block form_start %} {% 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 %} {% endblock %}


{% block content %} {% block content %}
<div class="col"> <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> </div>
{% endblock %} {% endblock %}


{% block footer %} {% block footer %}
{{ parent() }} {{ 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 %} {% endblock %}


{% block form_end %} {% block form_end %}
{{ form_end(form_add_order_reduction_credit) }}
{{ form_end(form_add_reduction_credit) }}
{% endblock %} {% endblock %}


{% endembed %} {% endembed %}

+ 9
- 9
ShopBundle/Resources/views/backend/order/macros.html.twig View File

Actions Actions
</button> </button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu"> <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>


<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> </button>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12"> <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-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> </div>


<td>${complementaryOrderShop.date}</td> <td>${complementaryOrderShop.date}</td>
<td>${complementaryOrderShop.total}</td> <td>${complementaryOrderShop.total}</td>
<td> <td>
<a :href="complementaryOrderShop.link" class="btn-sm btn-default">Afficher</a>
</td> </td>
</tr> </tr>
</template> </template>
{% macro box_tickets() %} {% macro box_tickets() %}
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} {% 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"> <table class="table table-striped">
<tbody> <tbody>
<thead> <thead>
<td>${ticket.status}</td> <td>${ticket.status}</td>
<td>${ticket.subject}</td> <td>${ticket.subject}</td>
<td> <td>
<a :href="ticket.link" class="btn-sm btn-default">Afficher</a>
</td> </td>
</tr> </tr>
</template> </template>

+ 2
- 2
ShopBundle/Resources/views/backend/order/show-cart.html.twig View File

{% include '@LcShop/backend/order/form/modal_orderstatus.html.twig' %} {% include '@LcShop/backend/order/form/modal_orderstatus.html.twig' %}
{% endif %} {% endif %}
{% if form_add_order_reduction_credit is defined %} {% 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 %} {% endif %}
{% if form_add_order_reduction_cart is defined %} {% 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 %} {% endif %}
{% if form_delete_order_reduction_cart is defined %} {% if form_delete_order_reduction_cart is defined %}
{% include '@LcShop/backend/order/form/modal_deletereductioncart.html.twig' %} {% include '@LcShop/backend/order/form/modal_deletereductioncart.html.twig' %}

+ 6
- 2
ShopBundle/Resources/views/backend/order/show-order.html.twig View File

{% include '@LcShop/backend/order/form/modal_orderstatus.html.twig' %} {% include '@LcShop/backend/order/form/modal_orderstatus.html.twig' %}
{% endif %} {% endif %}
{% if form_add_order_reduction_credit is defined %} {% 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 %} {% endif %}
{% if form_add_order_reduction_cart is defined %} {% 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 %} {% endif %}
{% if form_delete_order_reduction_cart is defined %} {% if form_delete_order_reduction_cart is defined %}
{% include '@LcShop/backend/order/form/modal_deletereductioncart.html.twig' %} {% include '@LcShop/backend/order/form/modal_deletereductioncart.html.twig' %}
{% if form_add_redelivery_order_product is defined %} {% if form_add_redelivery_order_product is defined %}
{% include '@LcShop/backend/order/form/modal_addredeliveryorderproduct.html.twig' %} {% include '@LcShop/backend/order/form/modal_addredeliveryorderproduct.html.twig' %}
{% endif %} {% 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 %} {% if form_order_send_payment_link is defined %}
{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} {% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %}

+ 1
- 0
ShopBundle/Twig/BackendTwigExtension.php View File



public function lcTrad($field, $entityName, $type = "field") public function lcTrad($field, $entityName, $type = "field")
{ {
if($entityName == 'OrderCart') $entityName ='OrderShop';
if(strpos($field, '.')===false) { if(strpos($field, '.')===false) {
$tradKey = $type . '.' . $entityName . '.' . $field; $tradKey = $type . '.' . $entityName . '.' . $field;
$tradDefaultKey = $type . '.default.' . $field; $tradDefaultKey = $type . '.default.' . $field;

Loading…
Cancel
Save