{% trans_default_domain 'lcshop' %}
{% import '@LcShop/backend/productfamily/macros.html.twig' as product_family_macros %}
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %}

<div class="row">
    {{ macros.startCard(8, 'ProductFamily.stock', 'light') }}

    <div class="col">
        {{ form_label(form.behaviorCountStock) }}
        {% for field in form.behaviorCountStock %}
            {% if field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT')
                or field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') %}
                <div v-if="activeProducts == true">
                    {{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }}
                </div>
            {% elseif field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY') %}
                <div v-if="activeProducts != true">
                    {{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }}
                </div>
            {% else %}
                {{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }}
            {% endif %}
        {% endfor %}

        {{ form_label(form.behaviorStockWeek) }}
        {% for field in form.behaviorStockWeek %}
            {% if field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE') or field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION') %}
                <div v-if="behaviorCountStock != '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED')}}'">
                    {{ form_widget(field, {"attr" : {"v-model" : 'behaviorStockWeek'}}) }}
                </div>
            {% else %}
                {{ form_widget(field, {"attr" : {"v-model" : 'behaviorStockWeek'}}) }}
            {% endif %}

        {% endfor %}
    </div>
    <div class="col">
        <div v-show="behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY') }}' || behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'"
             class="form-group">
            {{ form_label(form.availableQuantity) }}
            <div class="form-widget">
                <div class="input-group">
                    {{ form_widget(form.availableQuantity) }}
                    <div v-show="behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'" class="input-group-append">
                        <span class="input-group-text">${ getUnitReference() }</span>
                    </div>
                </div>
                {{ form_help(form.availableQuantity) }}
            </div>

        </div>
        <div v-show="(behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY') }}' || behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}') &&  behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'">
            {{ form_label(form.availableQuantityDefault) }}
            <div class="form-widget">
                <div class="input-group">
                    {{ form_widget(form.availableQuantityDefault) }}
                    <div v-show="behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'" class="input-group-append">
                        <span class="input-group-text">${ getUnitReference() }</span>
                    </div>
                </div>
                {{ form_help(form.availableQuantityDefault) }}
            </div>
        </div>
        <p v-show="behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY') }}' || behaviorCountStock == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}' ">
            {{ product_family_macros.total_order_product_family(totalProductOrdered['total'], entity) }}
        </p>
    </div>

    {{ macros.endCard() }}

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


    {{ macros.endCard() }}


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

    {{ macros.endCard() }}


</div>
