{% macro startCard(col, zone = "default", card ='primary', fullWidth = false ) %} {% if col > 0 %}
{% endif %}

{% set label = "group."~zone %} {{ label|trans({}, 'lcshop')|raw }}

{% endmacro startCard %} {% macro cardOverlay(attr) %}
{% endmacro cardOverlay %} {% macro endCard(noCol = false) %}
{% if noCol == false %}{% endif %} {% endmacro endCard %} {% macro productField(colspan, field, fieldName, fieldDisplay = false, displaySuffix="",attr="") %} {% if fieldDisplay == false %}{% set fieldDisplay = fieldName %}{% endif %}
{% verbatim %}{{ {% endverbatim %}{{ fieldDisplay }} {% verbatim %}}}{% endverbatim %}{{ displaySuffix }}
{% verbatim %}{{ productFamily.{% endverbatim %}{{ fieldDisplay }} {% verbatim %}}}{% endverbatim %}{{ displaySuffix }}
{{ form_widget(field, {'attr' : {'v-model' : fieldName , 'v-on:focusout': fieldName~'Inherited = false', '@change' : fieldName~'Updated'}}) }}
{% endmacro %} {% macro priceField(field, fieldTax, fieldName, behaviorPriceValue) %}
{{ form_label(field) }}
{{ form_widget(field, {'attr' : {'v-model': fieldName, '@change' : fieldName~'Updated'}}) }}
€ HT {% if behaviorPriceValue == 'by-reference-unit' %}/ ${ unitReference }{% endif %}
{{ form_widget(fieldTax, {'attr' : {'v-model': fieldName ~ 'WithTax', '@change' : fieldName~'WithTaxUpdated'}}) }}
€ TTC {% if behaviorPriceValue == 'by-reference-unit' %}/ ${ unitReference }{% endif %}
{% endmacro %} {% macro autoresizeField(field) %} {{ form_label(field) }}
{{ form_widget(field, {'attr' : {rows : '1'}}) }}
{% endmacro autoresizeField %} {% macro fieldReductionList(form, field, filterOn = false, filterType='string') %}
{{ form_widget(attribute(form, field~'Active'), {"attr" : {'v-model' : 'reduction'~field|uc_first~'Active' } }) }}
{% set attr = { 'ref' : 'reduction'~field|uc_first , 'v-model' : 'reduction'~field|uc_first } %} {{ form_widget(attribute(form, field), {"attr" : attr }) }}
{% endmacro fieldReductionList %} {% macro fieldReductionDateRange(form) %}
{{ form_widget(form.permanent, {"attr" : {'v-model' : 'reductionPermanent' } }) }}
{% endmacro fieldReductionDateRange %} {% macro fieldReductionValue(form) %}
{{ form_label(form.value) }}
{{ form_widget(form.value, {"attr" : {":required": "reductionActive", 'v-model' : 'reductionValue'}}) }}
%
{% endmacro fieldReductionValue %} {% macro fieldReductionBehaviorTaxRate(form) %}
{{ form_row(form.behaviorTaxRate, {"attr" : {":required": "reductionActive && reductionUnit=='amount'", 'v-model' : 'reductionBehaviorTaxRate'}}) }}
{% endmacro fieldReductionBehaviorTaxRate %} {% macro fieldReductionUnit(form) %}
{{ form_label(form.unit) }} {% for field in form.unit %} {{ form_widget(field, {"attr" : {":required": "reductionActive", "v-model" : 'reductionUnit'}}) }} {% endfor %}
{% endmacro fieldReductionUnit %} {% macro reductionCatalogForm(form) %} {{ _self.startCard(6, 'ReductionCatalog.info') }}
{{ form_row(form.title) }}
{{ _self.fieldReductionUnit(form) }} {{ _self.fieldReductionValue(form) }} {{ _self.fieldReductionBehaviorTaxRate(form) }} {{ _self.endCard() }} {{ _self.startCard(6, 'ReductionCatalog.conditions','success') }} {{ _self.fieldReductionDateRange(form) }} {{ _self.fieldReductionList(form, 'groupUsers') }} {{ _self.fieldReductionList(form, 'users') }} {% if form.suppliers is defined %} {{ _self.fieldReductionList(form, 'suppliers') }} {% endif %} {% if form.productCategories is defined %} {{ _self.fieldReductionList(form, 'productCategories') }} {% endif %} {% if form.productFamilies is defined %} {{ _self.fieldReductionList(form, 'productFamilies') }} {% endif %} {{ _self.endCard() }} {% endmacro reductionCatalogForm %} {% macro reductionCatalogFormValues(formValues, isProductFamilyForm= false) %} {% endmacro reductionCatalogFormValues %}