|
- {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
- {% import '@LcShop/backend/productfamily/macros.html.twig' as product_family_macros %}
- {% trans_default_domain 'lcshop' %}
-
- {# {% import _self as formMacros %} #}
- <div class="row">
- {{ macros.startCard(12, 'ProductFamily.products', 'light', true) }}
-
- <table class="table datagrid sortable lc-sortable-products products-collection-table" style="margin-bottom: 20px;"
- :data-index="formProducts.length"
- data-prototype="{{ product_family_macros.product_row(form.products.vars.prototype)|e('html_attr') }}">
- <thead>
- <tr>
- <th>
- </th>
- <th colspan="4" class="string" v-show="productsQuantityAsTitle == false">
- Titre
- <button v-on:click="emptyProductsField('title');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="2" class="string ">
- Quantité
- <button v-on:click="emptyProductsField('quantity');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="2" class="quantity">
- Unité
- <button v-on:click="emptyProductsField('unit');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="buyingPriceByRefUnit ">
- PA HT / ${ getUnitReference() }
- <button v-on:click="emptyProductsField('buyingPriceByRefUnit');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="priceByRefUnit">
- PA TTC / ${ getUnitReference() }
- <button v-on:click="emptyProductsField('buyingPriceByRefUnitWithTax');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
-
- <th colspan="3" class="price main-info">
- PA HT
- <button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"
- v-on:click="emptyProductsField('buyingPrice');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="3" class="price"
- v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">
- PA TTC
- <button v-on:click="emptyProductsField('buyingPriceWithTax');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="3" class="main-info">
- Coef
- <button v-on:click="emptyProductsField('multiplyingFactor');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
-
-
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="">
- PV HT / ${ getUnitReference() }
- <button v-on:click="emptyProductsField('priceByRefUnit');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="price">
- PV TTC / ${ getUnitReference() }
- <button v-on:click="emptyProductsField('priceByRefUnitWithTax');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
-
- <th colspan="3" class="price">
- {# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> #}
- PV HT
- <button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"
- v-on:click="emptyProductsField('price');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="3" class="price main-info">
- PV TTC
- <button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"
- v-on:click="emptyProductsField('priceWithTax');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="2" v-show="giftVoucherActive!= true">
- Marge HT
- </th>
-
- <th colspan="2" class=""
- v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'">
- <span style="text-transform: uppercase"> ${typeExpirationDate}</span>
- <button v-on:click="emptyProductsField('propertyExpirationDate');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="2"
- v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'">
- Stock
- <button v-on:click="emptyProductsField('availableQuantity');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="2"
- v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'">
- Stock par défaut
- <button v-on:click="emptyProductsField('availableQuantityDefault');"
- class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
- </th>
- <th colspan="2">
- Semaine / Commandés
- </th>
- {# <th colspan="4"
- v-show="giftVoucherActive== true">
- Réduction "Bon cadeaux"
- </th> #}
- <th colspan="3" class="">
- Action
- </th>
- </tr>
- </thead>
- <tbody class="products-collection">
-
- <template>
- <product-form v-for="(formProduct, name, index) in formProducts" v-bind:key="name"
- :key-form="name" ref="productForm" v-bind:product-family="productFamily"
- :template="formProduct"></product-form>
- </template>
- </tbody>
- <tfoot>
- <th>
- Rappel
- </th>
- <th colspan="4" class="string" v-show="productsQuantityAsTitle == false">
- ${title}
-
- </th>
- <th colspan="2" class="string ">
- ${productFamily.quantity}
- </th>
- <th colspan="2" class="quantity">
- ${productFamily.unitWording}
- </th>
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="buyingPriceByRefUnit">
- ${productFamily.buyingPriceByRefUnit}
- </th>
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="priceByRefUnit">
- ${productFamily.buyingPriceByRefUnitWithTax}
- </th>
-
- <th colspan="3" class="price main-info">
- ${productFamily.buyingPrice}
- </th>
- <th colspan="3" class="price"
- v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">
- ${productFamily.buyingPriceWithTax}
- </th>
- <th colspan="3" class="main-info">
- ${productFamily.multiplyingFactor}
- </th>
-
-
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="">
- ${productFamily.priceByRefUnit}
- </th>
- <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
- colspan="3" class="price">
- ${productFamily.priceByRefUnitWithTax}
- </th>
-
- <th colspan="3" class="price">
- {# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> #}
- ${productFamily.price}
- </th>
- <th colspan="3" class="price main-info">
- ${productFamily.priceWithTax}
- </th>
- <th colspan="2" class="price" v-show="giftVoucherActive!= true">
- ${productFamily.marginProfit}€<br/>
- ${productFamily.marginProfitPercent}%
- </td>
-
- <th colspan="2" class=""
- v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'">
- ${propertyExpirationDate}
- </th>
-
- <th colspan="2"
- v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'">
- </th>
- <th colspan="2"
- v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'">
- </th>
- <th colspan="2">
- </th>
- {# <th colspan="4"
- v-show="giftVoucherActive== true">
- </th> #}
- <th colspan="3" class="">
-
- </th>
- </tfoot>
- </table>
-
-
- <div class="row" style="margin: 0 25px">
-
- <div class="col-3 form-group">
- {{ form_widget(form.productsQuantityAsTitle, {"attr":{'v-model' : 'productsQuantityAsTitle'}}) }}
- </div>
- <div class="col-3 form-group"></div>
- <div class="col-6 form-group float-right">
- <button type="button" class="add_tag_link btn-add-product btn btn-default" @click="addProductForm"><span
- class="fa fa-plus"></span> Ajouter une déclinaison
- </button>
- </div>
-
- <div class="col-12">
-
- <p>
- <strong>Aide à l'utilisation - Raccourci clavier</strong>
- <ul>
- <li><strong>TAB</strong> : Champ suivant</li>
- <li><strong>SHIFT + TAB</strong> : Champ précédent</li>
- <li><strong>FLÈCHE BAS</strong> : Déclinaison suivante</li>
- <li><strong>FLÈCHE HAUT</strong> : Déclinaison précédente</li>
- <li><strong>SHIFT + [+]</strong> : Ajout d'une nouvelle déclinaison</li>
- </ul>
- </p>
- </div>
- </div>
-
- <div class="clearfix"></div>
-
- {{ macros.endCard() }}
- </div>
- {% do form.products.setRendered %}
- <script>
- window.productForm = new Array();
- window.formProductTemplate = new Array();
-
- {% for keyForm,i in sortableProductsField %}
- {% set product = form.products[i] %}
-
- {# {% if product.vars.value.status >= 0 and (product.vars.value.originProduct is null or product.vars.value.originProduct == false) %} #}
- window.productForm[{{ keyForm }}] = {
- {% if product.vars.value.originProduct is defined %}originProduct: parseInt({{ product.vars.value.originProduct }}),{% endif %}
- {% if product.vars.value.status is defined %}status: parseInt({{ product.vars.value.status }}),{% endif %}
- {% if product.vars.value.position %}position: "{{ product.vars.value.position }}",{% endif %}
- {% if product.vars.value.title %}title: "{{ product.vars.value.title }}",{% endif %}
- {% if product.vars.value.quantity %}quantity: "{{ product.vars.value.quantity }}",{% endif %}
- {% if product.vars.value.unit %}unit: {{ product.vars.value.unit.id }},{% endif %}
- {% if product.vars.value.buyingPrice %}buyingPrice: parseFloat({{ product.vars.value.buyingPrice }}).toFixed(3),{% endif %}
- {% if product.vars.value.buyingPriceByRefUnit %}buyingPriceByRefUnit: parseFloat({{ product.vars.value.buyingPriceByRefUnit }}).toFixed(3),{% endif %}
- {% if product.vars.value.price %}price: parseFloat({{ product.vars.value.price }}).toFixed(3),{% endif %}
- {% if product.vars.value.priceByRefUnit %}priceByRefUnit: parseFloat({{ product.vars.value.priceByRefUnit }}).toFixed(3),{% 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.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.expirationDate %}expirationDate: "{{ product.vars.value.expirationDate|date('d/m/Y') }}"{% endif %} #}
- };
- window.formProductTemplate[{{ keyForm }}] = '{{ product_family_macros.product_row(product, productsSalesStatistic['data'][product.vars.value.id]['data'])|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw }}';
- {# {% endif %} #}
- {% endfor %}
-
- </script>
|