}, | }, | ||||
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'); |
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 |
</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> | ||||
{% 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> |
{% 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 %} #} | ||||
}; | }; |
</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> |
{% 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 %} |
{% 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) %} |