Browse Source

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

feature/export_comptable
Guillaume 4 years ago
parent
commit
b1242a96bd
16 changed files with 108 additions and 40 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. +4
    -15
      ShopBundle/Resources/public/js/backend/script/default/init-common.js
  7. +15
    -2
      ShopBundle/Resources/public/js/backend/script/order/vuejs-order.js
  8. +12
    -2
      ShopBundle/Resources/translations/lcshop.fr.yaml
  9. +13
    -0
      ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig
  10. +2
    -2
      ShopBundle/Resources/views/backend/order/form/modal_addorderreductioncart.html.twig
  11. +27
    -0
      ShopBundle/Resources/views/backend/order/form/modal_addorderreductioncredit.html.twig
  12. +8
    -6
      ShopBundle/Resources/views/backend/order/form/modal_addreductioncredit.html.twig
  13. +9
    -9
      ShopBundle/Resources/views/backend/order/macros.html.twig
  14. +2
    -2
      ShopBundle/Resources/views/backend/order/show-cart.html.twig
  15. +6
    -2
      ShopBundle/Resources/views/backend/order/show-order.html.twig
  16. +1
    -0
      ShopBundle/Twig/BackendTwigExtension.php

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

@@ -350,6 +350,8 @@ class OrderController extends AdminController
//TODO 0 écrire
}



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

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

@@ -53,6 +53,7 @@ class AddOrderReductionCartType extends AbstractType
{
$resolver->setDefaults([
'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(),
'translation_domain'=> 'lcshop'
]);
}
}

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

@@ -59,6 +59,7 @@ class AddOrderReductionCreditType extends AbstractType
{
$resolver->setDefaults([
'data_class' => $this->em->getClassMetadata(OrderShopInterface::class)->getName(),
'translation_domain'=> 'lcshop'
]);
}
}

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

@@ -53,6 +53,7 @@ class AddRedeliveryOrderProductType extends AbstractType
{
$resolver->setDefaults([
'data_class' => $this->em->getClassMetadata(OrderProductInterface::class)->getName(),
'translation_domain'=> 'lcshop'
]);
}
}

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

@@ -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'
]);
}
}

+ 4
- 15
ShopBundle/Resources/public/js/backend/script/default/init-common.js View File

@@ -65,7 +65,8 @@ function initAdminLtePlugin() {
});
$('form button[type="submit"]').on('click', function (e) {

checkForm()
checkForm();
log('ncihe')
})

if ($('.select2, select.form-control').length) {
@@ -124,6 +125,8 @@ function initAdminLtePlugin() {
}
$(picker).daterangepicker(options);
$(picker).on('apply.daterangepicker', function (ev, pickerElm) {
log($(picker).nextAll('.date-time-range-fields').find('.date-start'));
log(pickerElm.startDate.format('YYYY-MM-DD HH:mm'));
$(picker).nextAll('.date-time-range-fields').find('.date-start').val(pickerElm.startDate.format('YYYY-MM-DD HH:mm'));
$(picker).nextAll('.date-time-range-fields').find('.date-end').val(pickerElm.endDate.format('YYYY-MM-DD HH:mm'));
});
@@ -189,20 +192,6 @@ function setSelect2($select) {
}
}

function checkForm() {
$('form').addClass('form-sent');
//Panel vues js
if ($('form').find('.panel').length) {
$('form').find('.panel').each(function (i, panel) {
if ($(panel).find(':invalid').length) {
$('#nav-params').find('.nav-item:eq(' + i + ')').addClass('has-invalid');
} else {
$('#nav-params').find('.nav-item:eq(' + i + ')').removeClass('has-invalid');
}
})
}
}



function initBtnEditReminder(){

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

@@ -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');
},

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

@@ -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

+ 13
- 0
ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig View File

@@ -1,5 +1,18 @@
{% use '@EasyAdmin/form/bootstrap_4.html.twig' %}



{# TODO à corriger le theme requiert des infos easyAdmin il devrait être possible de ne pas en utiliser #}










{% block form_widget -%}
{{ parent() }}


ShopBundle/Resources/views/backend/order/form/modal_addreductioncart.html.twig → ShopBundle/Resources/views/backend/order/form/modal_addorderreductioncart.html.twig View File

@@ -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 %}

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

@@ -0,0 +1,27 @@
{% embed "@LcShop/backend/default/block/embed_modal.twig" %}
{% trans_default_domain 'lcshop' %}

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

{% block content %}
<div class="col">
{{ form_row(form_add_order_reduction_credit.reductionCredit) }}
</div>
{% endblock %}

{% block footer %}
{{ parent() }}
{{ form_widget(form_add_order_reduction_credit.add, {"attr": {'class' : 'btn btn-primary', '@click': 'addOrderReductionCredit'}}) }}
{% endblock %}

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

{% endembed %}

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

@@ -1,27 +1,29 @@
{% embed "@LcShop/backend/default/block/embed_modal.twig" %}
{% trans_default_domain 'lcshop' %}

{% block id %}modal-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 %}

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

@@ -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>

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

@@ -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' %}

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

@@ -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' %}

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

@@ -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;

Loading…
Cancel
Save