Browse Source

[Backend] Désactiver produit import bon de commande

develop
Fab 3 years ago
parent
commit
e75ec4e8b8
8 changed files with 89 additions and 24 deletions
  1. +12
    -2
      ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js
  2. +2
    -0
      ShopBundle/Resources/translations/lcshop.fr.yaml
  3. +3
    -3
      ShopBundle/Resources/views/backend/productfamily/macros.html.twig
  4. +2
    -2
      ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig
  5. +2
    -0
      ShopBundle/Resources/views/backend/productfamily/panel_products.html.twig
  6. +16
    -5
      ShopBundle/Resources/views/backend/productfamily/panel_stock.html.twig
  7. +34
    -0
      ShopBundle/Resources/views/backend/user/macros.html.twig
  8. +18
    -12
      ShopBundle/Resources/views/backend/user/show.html.twig

+ 12
- 2
ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js View File

}, },
behaviorPriceValue: function () { behaviorPriceValue: function () {
return this.productFamily.behaviorPrice; return this.productFamily.behaviorPrice;
}
},
hasExportInfo: function () {
if((this.exportNote != null && this.exportNote != '') || (this.exportTitle != null && this.exportTitle != ''))return true
else return false;
},
}, },
data() { data() {
return Object.assign( return Object.assign(
expirationDateInherited: false, expirationDateInherited: false,
availableQuantityInherited: false, availableQuantityInherited: false,
availableQuantityDefaultInherited: false, availableQuantityDefaultInherited: false,
propertyExpirationDateInherited: false
propertyExpirationDateInherited: false,
exportTitle: null,
exportNote: null
}, window.productForm[this.keyForm]) }, window.productForm[this.keyForm])
}, },
mounted: function () { mounted: function () {
}else{ }else{
this.status = 1; this.status = 1;
$(this.$el).removeClass('disabled'); $(this.$el).removeClass('disabled');
if(this.hasExportInfo){
alert('Cette déclinaison contient un titre ou une note à l\'export');
}
} }

}, },
decode(str){ decode(str){
var textArea = document.createElement('textarea'); var textArea = document.createElement('textarea');

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

initReduction: Réduction initReduction: Réduction
export: Note à l'export export: Note à l'export
stockNegative: Produits stocks négatif stockNegative: Produits stocks négatif
purchaseOrder: Bons de commandes
ReductionCatalog: ReductionCatalog:
info: Informations principal info: Informations principal
conditions: Conditions d'application conditions: Conditions d'application
displayPriceUnitRef: Afficher le prix par unité de référence displayPriceUnitRef: Afficher le prix par unité de référence
behaviorPrice: Travailler avec des tarifs behaviorPrice: Travailler avec des tarifs
productsQuantityAsTitle: Titre équivalent à quantité productsQuantityAsTitle: Titre équivalent à quantité
isDisabledOnPurchaseOrder: Automatiquement désactiver ce produit dans les bons de commandes
behaviorPriceOptions: behaviorPriceOptions:
by-piece: À la pièce by-piece: À la pièce
by-reference-unit: Par unité de référence by-reference-unit: Par unité de référence

+ 3
- 3
ShopBundle/Resources/views/backend/productfamily/macros.html.twig View File



</td> #} </td> #}
<td colspan="3"> <td colspan="3">
<button type="button" class="btn-sm btn-info" @click="modalProductForm()">
<button type="button" :class="hasExportInfo ? 'btn-sm btn-info' : 'btn-sm btn-secondary'" @click="modalProductForm()">
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
</button> </button>
<button type="button" class="btn-sm btn-info" @click="changeStatus()"> <button type="button" class="btn-sm btn-info" @click="changeStatus()">
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="col"> <div class="col">
{{ form_row(product.exportTitle) }}
{{ form_row(product.exportTitle, {'attr' : {"v-model" : 'exportTitle'}}) }}
</div> </div>
<div class="col"> <div class="col">
{{ form_row(product.exportNote) }}
{{ form_row(product.exportNote, {'attr' : {"v-model" : 'exportNote'}}) }}
</div> </div>





+ 2
- 2
ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig View File

{% endfor %} {% endfor %}
{% do form.sections.setRendered %} {% do form.sections.setRendered %}
</div> </div>
{{ macros.endCard() }}
{{ macros.endCard(true) }}




{{ macros.startCard(8, 'ProductFamily.main','light') }}
{{ macros.startCard(0, 'ProductFamily.main','light') }}
<div class="col-12"> <div class="col-12">
{{ form_row(form.supplier) }} {{ form_row(form.supplier) }}
</div> </div>

+ 2
- 0
ShopBundle/Resources/views/backend/productfamily/panel_products.html.twig View File

{% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}),{% endif %} {% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}),{% endif %}
{% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}),{% endif %} {% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}),{% endif %}
{% if product.vars.value.propertyExpirationDate %}propertyExpirationDate: "{{ product.vars.value.propertyExpirationDate }}",{% endif %} {% if product.vars.value.propertyExpirationDate %}propertyExpirationDate: "{{ product.vars.value.propertyExpirationDate }}",{% endif %}
{% if product.vars.value.exportTitle %}exportTitle: "{{ product.vars.value.exportTitle }}",{% endif %}
{% if product.vars.value.exportNote %}exportNote: "{{ product.vars.value.exportNote }}",{% endif %}
{# {% if product.vars.value.giftVoucherReductionCart %}giftVoucherReductionCart: {{ product.vars.value.giftVoucherReductionCart.id }},{% endif %} #} {# {% if product.vars.value.giftVoucherReductionCart %}giftVoucherReductionCart: {{ product.vars.value.giftVoucherReductionCart.id }},{% endif %} #}
{# {% if product.vars.value.expirationDate %}expirationDate: "{{ product.vars.value.expirationDate|date('d/m/Y') }}"{% endif %} #} {# {% if product.vars.value.expirationDate %}expirationDate: "{{ product.vars.value.expirationDate|date('d/m/Y') }}"{% endif %} #}
}; };

+ 16
- 5
ShopBundle/Resources/views/backend/productfamily/panel_stock.html.twig View File

</p> </p>
</div> </div>


{{ macros.endCard(true) }}


{{ macros.startCard(0, 'ProductFamily.export', 'light') }}
<div class="col">
{{ form_row(form.exportTitle) }}
{{ form_row(form.exportNote) }}
</div>

{{ macros.endCard() }} {{ macros.endCard() }}



{{ macros.startCard(4, 'ProductFamily.storage', 'light') }} {{ macros.startCard(4, 'ProductFamily.storage', 'light') }}
<div class="col"> <div class="col">
{{ form_row(form.depositoryZone) }} {{ form_row(form.depositoryZone) }}
</div> </div>




{{ macros.endCard() }}

{{ macros.endCard(true) }}


{{ macros.startCard(8, 'ProductFamily.export', 'light') }}
{{ macros.startCard(0, 'ProductFamily.purchaseOrder', 'light') }}
<div class="col"> <div class="col">
{{ form_row(form.exportTitle) }}
{{ form_row(form.exportNote) }}
{{ form_row(form.isDisabledOnPurchaseOrder) }}
</div> </div>



{{ macros.endCard() }} {{ macros.endCard() }}






</div> </div>

+ 34
- 0
ShopBundle/Resources/views/backend/user/macros.html.twig View File

{% endembed %} {% endembed %}
{% endmacro box_total_spent %} {% endmacro box_total_spent %}


{% macro box_prepaid_account(user) %}
{% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
{% set userMerchant = creditUtils.getUserMerchant() %}
{% trans_default_domain 'lcshop' %}
{% block class %}bg-blue{% endblock %}
{% block icon %}cash-register{% endblock %}
{% block label %}
<a class="text-white" href="{{ path('easyadmin', {"action" : 'show', 'entity': 'UserMerchant', 'id': userMerchant.id}) }}">
<i class="fa fa-pen"></i> Éditer
</a> - Solde compte prépayé
{% endblock %}
{% block value %}

{{ userMerchant.getCredit()|format_price(false) }}
{% if userMerchant.getCreditActive() ==false %}
<small>(inactif)</small>
{% endif %}

{% endblock %}
{% endembed %}
{% endmacro box_prepaid_account %}

{% macro box_average_products(user) %}
{% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
{% trans_default_domain 'lcshop' %}
{% block class %}bg-navy{% endblock %}
{% block icon %}shopping-basket{% endblock %}
{% block label %} Panier moyen{% endblock %}
{% block value %}
{{ orderUtils.getAverageProductsByUser(user)|format_price|raw }}
{% endblock %}
{% endembed %}
{% endmacro box_average_products %}

{% macro box_rank_total_order(user) %} {% macro box_rank_total_order(user) %}
{% embed '@LcShop/backend/default/block/embed_figure_box.twig' %} {% embed '@LcShop/backend/default/block/embed_figure_box.twig' %}
{% block class %}bg-info{% endblock %} {% block class %}bg-info{% endblock %}

+ 18
- 12
ShopBundle/Resources/views/backend/user/show.html.twig View File

{% block global_actions %} {% block global_actions %}
{% if entity is not null %} {% if entity is not null %}
{% set action = {label : "action.user.switch", icon: 'user-secret', css_class: 'btn btn-sm btn-danger'} %} {% set action = {label : "action.user.switch", icon: 'user-secret', css_class: 'btn btn-sm btn-danger'} %}
{% include '@LcShop/backend/user/block/user-switch.html.twig' with {item: entity, is_dropdown: false, action: action, translation_domain: 'lcshop', trans_parameters: {}, item_id: entity.id}%}
{% include '@LcShop/backend/user/block/user-switch.html.twig' with {item: entity, is_dropdown: false, action: action, translation_domain: 'lcshop', trans_parameters: {}, item_id: entity.id} %}


<button id="btn-ticket-write-to-user" <button id="btn-ticket-write-to-user"
data-url="{{ path('easyadmin', {'entity': 'Ticket', 'action': 'new'}) }}" data-url="{{ path('easyadmin', {'entity': 'Ticket', 'action': 'new'}) }}"
<div class="col-3"> <div class="col-3">
{{ user_macros.card_info(entity) }} {{ user_macros.card_info(entity) }}
</div> </div>
<div class="col-3">
{{ user_macros.box_rank_total_order(entity) }}
{{ user_macros.box_total_order(entity) }}
</div>
<div class="col-3">
{{ user_macros.box_rank_sum_order(entity) }}
{{ user_macros.box_total_spent(entity) }}
</div>
<div class="col-3">
{{ user_macros.box_register_since(entity) }}
{{ user_macros.box_login_since(entity) }}
<div class="col-9 row">
<div class="col-3">
{{ user_macros.box_rank_total_order(entity) }}
{{ user_macros.box_total_order(entity) }}
</div>
<div class="col-3">
{{ user_macros.box_rank_sum_order(entity) }}
{{ user_macros.box_total_spent(entity) }}
</div>
<div class="col-3">
{{ user_macros.box_prepaid_account(entity) }}
{{ user_macros.box_average_products(entity) }}
</div>
<div class="col-3">
{{ user_macros.box_register_since(entity) }}
{{ user_macros.box_login_since(entity) }}
</div>
</div> </div>
<div class="col-6"> <div class="col-6">
{% set redeliveries = orderUtils.getRedeliveryByUser(entity) %} {% set redeliveries = orderUtils.getRedeliveryByUser(entity) %}

Loading…
Cancel
Save