@@ -47,10 +47,10 @@ class ProductFamilyController extends AdminController | |||
$formBuilder->add('warningMessageType', ChoiceType::class, array( | |||
'choices' => array( | |||
'field.default.warningMessageTypeOptions.success' => 'success', | |||
'field.default.warningMessageTypeOptions.error' => 'error', | |||
'field.default.warningMessageTypeOptions.warning' => 'warning', | |||
'field.default.warningMessageTypeOptions.info' => 'info' | |||
'field.default.warningMessageTypeOptions.'.ProductFamily::WARNING_MESSAGE_TYPE_SUCCESS => ProductFamily::WARNING_MESSAGE_TYPE_SUCCESS, | |||
'field.default.warningMessageTypeOptions.'.ProductFamily::WARNING_MESSAGE_TYPE_ERROR => ProductFamily::WARNING_MESSAGE_TYPE_ERROR, | |||
'field.default.warningMessageTypeOptions.'.ProductFamily::WARNING_MESSAGE_TYPE_WARNING => ProductFamily::WARNING_MESSAGE_TYPE_WARNING, | |||
'field.default.warningMessageTypeOptions.'.ProductFamily::WARNING_MESSAGE_TYPE_INFO => ProductFamily::WARNING_MESSAGE_TYPE_INFO | |||
), | |||
'translation_domain' => 'lcshop', | |||
'multiple' => false, | |||
@@ -74,8 +74,8 @@ class ProductFamilyController extends AdminController | |||
$formBuilder->add('behaviorAddToCart', ChoiceType::class, array( | |||
'data' => $entity->getBehaviorAddToCart() ? $entity->getBehaviorAddToCart() : 'simple', | |||
'choices' => array( | |||
'field.ProductFamily.behaviorAddToCartOptions.simple' => 'simple', | |||
'field.ProductFamily.behaviorAddToCartOptions.multiple' => 'multiple' | |||
'field.ProductFamily.behaviorAddToCartOptions.'.ProductFamily::BEHAVIOR_ADD_TO_CART_SIMPLE => ProductFamily::BEHAVIOR_ADD_TO_CART_SIMPLE, | |||
'field.ProductFamily.behaviorAddToCartOptions.'.ProductFamily::BEHAVIOR_ADD_TO_CART_MULTIPLE => ProductFamily::BEHAVIOR_ADD_TO_CART_MULTIPLE | |||
), | |||
'translation_domain' => 'lcshop', | |||
'multiple' => false, | |||
@@ -85,8 +85,8 @@ class ProductFamilyController extends AdminController | |||
$formBuilder->add('behaviorPrice', ChoiceType::class, array( | |||
'empty_data' => 'by-piece', | |||
'choices' => array( | |||
'field.ProductFamily.behaviorPriceOptions.byPiece' => 'by-piece', | |||
'field.ProductFamily.behaviorPriceOptions.byRefUnit' => 'by-reference-unit' | |||
'field.ProductFamily.behaviorPriceOptions.'.ProductFamily::BEHAVIOR_PRICE_BY_PIECE => ProductFamily::BEHAVIOR_PRICE_BY_PIECE, | |||
'field.ProductFamily.behaviorPriceOptions.'.ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT => ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT | |||
), | |||
'translation_domain' => 'lcshop', | |||
'multiple' => false, | |||
@@ -100,9 +100,9 @@ class ProductFamilyController extends AdminController | |||
$formBuilder->add('propertyOrganicLabel', ChoiceType::class, array( | |||
'choices' => array( | |||
'field.ProductFamily.organicLabelOptions.ab' => 'ab', | |||
'field.ProductFamily.organicLabelOptions.natureProgres' => 'nature-progres', | |||
'field.ProductFamily.organicLabelOptions.hVE' => 'hve' | |||
'field.ProductFamily.organicLabelOptions.'.ProductFamily::PROPERTY_ORGANIC_LABEL_AB => ProductFamily::PROPERTY_ORGANIC_LABEL_AB, | |||
'field.ProductFamily.organicLabelOptions.'.ProductFamily::PROPERTY_ORGANIC_LABEL_NP => ProductFamily::PROPERTY_ORGANIC_LABEL_NP, | |||
'field.ProductFamily.organicLabelOptions.'.ProductFamily::PROPERTY_ORGANIC_LABEL_HVE => ProductFamily::PROPERTY_ORGANIC_LABEL_HVE | |||
), | |||
'translation_domain' => 'lcshop', | |||
'multiple' => false, | |||
@@ -112,9 +112,9 @@ class ProductFamilyController extends AdminController | |||
$formBuilder->add('typeExpirationDate', ChoiceType::class, array( | |||
'choices' => array( | |||
'field.default.dlc' => 'dlc', | |||
'field.default.ddm' => 'ddm', | |||
'field.default.dluo' => 'dluo' | |||
'field.default.'.ProductFamily::TYPE_EXPIRATION_DATE_DLC => ProductFamily::TYPE_EXPIRATION_DATE_DLC, | |||
'field.default.'.ProductFamily::TYPE_EXPIRATION_DATE_DDM => ProductFamily::TYPE_EXPIRATION_DATE_DDM, | |||
'field.default.'.ProductFamily::TYPE_EXPIRATION_DATE_DLUO => ProductFamily::TYPE_EXPIRATION_DATE_DLUO | |||
), | |||
'translation_domain' => 'lcshop', | |||
'multiple' => false, | |||
@@ -122,10 +122,22 @@ class ProductFamilyController extends AdminController | |||
'required'=>false | |||
)); | |||
$formBuilder->add('behaviorStockWeek', ChoiceType::class, array( | |||
'choices' => array( | |||
'field.ProductFamily.behaviorStockWeekOptions.'.ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE => ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE, | |||
'field.ProductFamily.behaviorStockWeekOptions.'.ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION => ProductFamily::BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION, | |||
'field.ProductFamily.behaviorStockWeekOptions.'.ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE => ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE | |||
), | |||
'translation_domain' => 'lcshop', | |||
'multiple' => false, | |||
'expanded' => true, | |||
'required'=>true | |||
)); | |||
$formBuilder->add('behaviorExpirationDate', ChoiceType::class, array( | |||
'choices' => array( | |||
'field.ProductFamily.behaviorExpirationDateOptions.productFamily' => 'by-product-family', | |||
'field.ProductFamily.behaviorExpirationDateOptions.product' => 'by-product' | |||
'field.ProductFamily.behaviorExpirationDateOptions.'.ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT_FAMILY => ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT_FAMILY, | |||
'field.ProductFamily.behaviorExpirationDateOptions.'.ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT => ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT | |||
), | |||
'translation_domain' => 'lcshop', | |||
'multiple' => false, |
@@ -120,6 +120,12 @@ class ProductType extends AbstractType | |||
)); | |||
$builder->add('position', HiddenType::class); | |||
$builder->add('exportTitle', TextType::class, array( | |||
'required' =>false | |||
)); | |||
$builder->add('exportNote', TextType::class, array( | |||
'required' =>false | |||
)); | |||
} | |||
@@ -17,14 +17,39 @@ use Lc\ShopBundle\Context\ProductPropertyInterface; | |||
abstract class ProductFamily extends AbstractDocumentEntity implements ProductPropertyInterface, PriceInterface, FilterMerchantInterface | |||
{ | |||
use ProductPropertyTrait; | |||
const BEHAVIOR_COUNT_STOCK_UNLIMITED = 'unlimited' ; | |||
const BEHAVIOR_COUNT_STOCK_BY_MEASURE = 'by-measure' ; | |||
const BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY = 'by-product-family' ; | |||
const BEHAVIOR_COUNT_STOCK_BY_PRODUCT = 'by-product' ; | |||
const TYPE_CREDIT = 'credit' ; | |||
use ProductPropertyTrait; | |||
const BEHAVIOR_STOCK_WEEK_RENEWABLE = 'renewable'; | |||
const BEHAVIOR_STOCK_WEEK_RENEWABLE_VALIDATION = 'renewable-with-validation'; | |||
const BEHAVIOR_STOCK_WEEK_NON_RENEWABLE = 'non-renewable'; | |||
const WARNING_MESSAGE_TYPE_SUCCESS = 'success'; | |||
const WARNING_MESSAGE_TYPE_ERROR = 'error'; | |||
const WARNING_MESSAGE_TYPE_WARNING = 'warning'; | |||
const WARNING_MESSAGE_TYPE_INFO = 'info'; | |||
const BEHAVIOR_ADD_TO_CART_SIMPLE = 'simple'; | |||
const BEHAVIOR_ADD_TO_CART_MULTIPLE = 'multiple'; | |||
const BEHAVIOR_PRICE_BY_PIECE = 'by-piece'; | |||
const BEHAVIOR_PRICE_BY_REFERENCE_UNIT = 'by-reference-unit'; | |||
const PROPERTY_ORGANIC_LABEL_AB = 'ab'; | |||
const PROPERTY_ORGANIC_LABEL_NP = 'nature-progres'; | |||
const PROPERTY_ORGANIC_LABEL_HVE = 'hve'; | |||
const TYPE_EXPIRATION_DATE_DLC = 'dlc'; | |||
const TYPE_EXPIRATION_DATE_DDM = 'ddm'; | |||
const TYPE_EXPIRATION_DATE_DLUO = 'dluo'; | |||
const BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT_FAMILY = 'by-product-family'; | |||
const BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT = 'by-product'; | |||
//Champ hydraté par ProductFamilyUtils | |||
protected $reductionCatalog; |
@@ -215,10 +215,11 @@ table th .select2-container--default .select2-selection--single{padding:0.3rem 0 | |||
#lc-product-family-edit .products-collection-table th span {white-space: initial;} | |||
#lc-product-family-edit .products-collection-table th:last-child{border-right: 1px solid #dee2e6;} | |||
#lc-product-family-edit .products-collection-table td{border-left: 1px solid #dee2e6; text-align: center; font-size: 13px;} | |||
#lc-product-family-edit .products-collection-table td:last-child{border-right: 1px solid #dee2e6;} | |||
#lc-product-family-edit .products-collection-table td:last-child{border-right: 1px solid #dee2e6; white-space: nowrap; } | |||
#lc-product-family-edit .btn-add-product {margin: 20px 0; float: right;} | |||
#lc-product-family-edit .inherited {color: #888; font-style: italic; font-weight: initial;} | |||
#lc-product-family-edit .products-collection-table td .value {min-width: 80%; margin: auto; min-height: 20px; cursor: pointer;} | |||
#lc-product-family-edit .products-collection-table td .value {min-width: 80%; margin: auto; min-height: 35px; cursor: pointer;} | |||
#lc-product-family-edit .products-collection-table td .modal {text-align: left;} | |||
/* DeliveryZone */ | |||
@@ -19,13 +19,13 @@ Vue.component('product-unit-price', { | |||
buyingPriceWithTaxValue: function () { | |||
return this.buyingPriceWithTax; | |||
}, | |||
buyingPriceByRefUnitValue:function(){ | |||
buyingPriceByRefUnitValue: function () { | |||
return this.buyingPriceByRefUnit; | |||
}, | |||
buyingPriceByRefUnitWithTaxValue:function(){ | |||
buyingPriceByRefUnitWithTaxValue: function () { | |||
return this.buyingPriceByRefUnitWithTax; | |||
}, | |||
multiplyingFactorValue:function(){ | |||
multiplyingFactorValue: function () { | |||
return this.multiplyingFactor; | |||
}, | |||
priceWithTaxValue: function () { | |||
@@ -34,10 +34,10 @@ Vue.component('product-unit-price', { | |||
priceValue: function () { | |||
return this.price; | |||
}, | |||
priceByRefUnitValue:function(){ | |||
priceByRefUnitValue: function () { | |||
return this.priceByRefUnit; | |||
}, | |||
priceByRefUnitWithTaxValue:function(){ | |||
priceByRefUnitWithTaxValue: function () { | |||
return this.priceByRefUnitWithTax; | |||
}, | |||
quantityValue: function () { | |||
@@ -46,7 +46,7 @@ Vue.component('product-unit-price', { | |||
unitValue: function () { | |||
return this.unit; | |||
}, | |||
behaviorPriceValue:function(){ | |||
behaviorPriceValue: function () { | |||
return this.behaviorPrice; | |||
}, | |||
taxRateValue: function () { | |||
@@ -85,14 +85,14 @@ Vue.component('product-unit-price', { | |||
this.setBuyingPriceWithTax(); | |||
this.setBuyingPriceByRefUnitWithTax(); | |||
}, | |||
differentSupplierTaxRate:function(){ | |||
differentSupplierTaxRate: function () { | |||
this.supplierTaxRate = null; | |||
}, | |||
activeProducts:function () { | |||
activeProducts: function () { | |||
this.$parent.updateActiveProducts(); | |||
}, | |||
behaviorPrice:function () { | |||
if(this.behaviorPrice == 'by-reference-unit'){ | |||
behaviorPrice: function () { | |||
if (this.behaviorPrice == 'by-reference-unit') { | |||
this.quantity = 1; | |||
} | |||
} | |||
@@ -117,15 +117,15 @@ Vue.component('product-form', { | |||
if (this.buyingPriceWithTax) return this.buyingPriceWithTax; | |||
else return this.productFamily.buyingPriceWithTax; | |||
}, | |||
buyingPriceByRefUnitValue:function(){ | |||
buyingPriceByRefUnitValue: function () { | |||
if (this.buyingPriceByRefUnit) return this.buyingPriceByRefUnit; | |||
else return this.productFamily.buyingPriceByRefUnit; | |||
}, | |||
buyingPriceByRefUnitWithTaxValue:function(){ | |||
buyingPriceByRefUnitWithTaxValue: function () { | |||
if (this.buyingPriceByRefUnitWithTax) return this.buyingPriceByRefUnitWithTax; | |||
else return this.productFamily.buyingPriceByRefUnitWithTax; | |||
}, | |||
multiplyingFactorValue:function(){ | |||
multiplyingFactorValue: function () { | |||
if (this.multiplyingFactor) return this.multiplyingFactor; | |||
else return this.productFamily.multiplyingFactor; | |||
}, | |||
@@ -137,11 +137,11 @@ Vue.component('product-form', { | |||
if (this.price) return this.price; | |||
else return this.productFamily.price; | |||
}, | |||
priceByRefUnitValue:function(){ | |||
priceByRefUnitValue: function () { | |||
if (this.priceByRefUnit) return this.priceByRefUnit; | |||
else return this.productFamily.priceByRefUnit; | |||
}, | |||
priceByRefUnitWithTaxValue:function(){ | |||
priceByRefUnitWithTaxValue: function () { | |||
if (this.priceByRefUnitWithTax) return this.priceByRefUnitWithTax; | |||
else return this.productFamily.priceByRefUnitWithTax; | |||
}, | |||
@@ -157,11 +157,11 @@ Vue.component('product-form', { | |||
if (this.propertyExpirationDate) return this.propertyExpirationDate; | |||
else return this.productFamily.propertyExpirationDate; | |||
}, | |||
behaviorPriceValue:function(){ | |||
behaviorPriceValue: function () { | |||
return this.productFamily.behaviorPrice; | |||
}, | |||
finalPriceWithTax:function () { | |||
return getPriceWithTax(parseFloat((this.priceByRefUnitValue * this.quantityValue) / this.unitCoefficient).toFixed(4), this.taxRateValue); | |||
finalPriceWithTax: function () { | |||
return getPriceWithTax(parseFloat((this.priceByRefUnitValue * this.quantityValue) / this.unitCoefficient).toFixed(4), this.taxRateValue); | |||
} | |||
}, | |||
data() { | |||
@@ -186,8 +186,8 @@ Vue.component('product-form', { | |||
buyingPriceWithTaxInherited: false, | |||
buyingPriceByRefUnitInherited: false, | |||
buyingPriceByRefUnitWithTaxInherited: false, | |||
priceByRefUnitInherited:false, | |||
priceByRefUnitWithTaxInherited:false, | |||
priceByRefUnitInherited: false, | |||
priceByRefUnitWithTaxInherited: false, | |||
expirationDateInherited: false, | |||
availableQuantityInherited: false, | |||
availableQuantityDefaultInherited: false, | |||
@@ -196,9 +196,40 @@ Vue.component('product-form', { | |||
}, window.productForm[this.keyForm]) | |||
}, | |||
mounted: function () { | |||
//INIT VAR | |||
//INIT VAR | |||
updateSortableProducts(); | |||
//this.setUnitSelect2(); | |||
var app = this; | |||
$(this.$el).find('input, select').on('keydown', function (e) { | |||
if (e.keyCode == 13 || e.keyCode == 9) e.preventDefault(); | |||
//GAUCHE | |||
if (e.shiftKey && e.keyCode == 9) { | |||
e.preventDefault(); | |||
$prevField = $(this).parents('td').prevAll('td:visible').first().find('input, select'); | |||
app.setFocusOnField($prevField.data('ref'), $prevField.data('y')); | |||
} else if (e.keyCode == '9') { | |||
e.preventDefault(); | |||
$nextField = $(this).parents('td').nextAll('td:visible').first().find('input, select'); | |||
app.setFocusOnField($nextField.data('ref'), $nextField.data('y')); | |||
} | |||
//BAS | |||
if (e.keyCode == '40') { | |||
y = parseInt($(this).data('y')) + 1; | |||
if (y >= app.$parent.$refs['productForm'].length) y = 0; | |||
app.$parent.$refs['productForm'][y].setFocusOnField($(this).data('ref'), y); | |||
} | |||
//HAUT | |||
if (e.keyCode == '38') { | |||
y = parseInt($(this).data('y')) - 1; | |||
if (y == -1) y = app.$parent.$refs['productForm'].length - 1; | |||
app.$parent.$refs['productForm'][y].setFocusOnField($(this).data('ref'), y); | |||
} | |||
}); | |||
//METHOD | |||
@@ -206,15 +237,32 @@ Vue.component('product-form', { | |||
//this.updateProductView(); | |||
}, | |||
methods: { | |||
setUnitSelect2:function(){ | |||
setFocusOnField: function (field, y) { | |||
this[field] = true; | |||
this.$nextTick(function () { | |||
log(field); | |||
if (field == 'unitInherited') { | |||
$('select[data-ref="' + field + '"]').eq(y).focus(); | |||
} else { | |||
$('input[data-ref="' + field + '"]').eq(y).focus(); | |||
} | |||
}); | |||
}, | |||
setUnitSelect2: function () { | |||
$(this.$el).find('select').each(function (i, select) { | |||
setSelect2($(select)); | |||
}); | |||
}, | |||
titleUpdated:function(){}, | |||
availableQuantityUpdated:function(){}, | |||
availableQuantityDefaultUpdated:function(){}, | |||
propertyExpirationDateUpdated:function(){}, | |||
titleUpdated: function () { | |||
}, | |||
availableQuantityUpdated: function () { | |||
}, | |||
availableQuantityDefaultUpdated: function () { | |||
}, | |||
propertyExpirationDateUpdated: function () { | |||
}, | |||
updateProductForm: function () { | |||
this.init(); | |||
@@ -227,6 +275,9 @@ Vue.component('product-form', { | |||
this.$parent.formProductArray.splice(this.keyForm, 1); | |||
} | |||
}, | |||
modalProductForm: function () { | |||
$('#modal-extends-product').modal('show') | |||
}, | |||
}, | |||
watch: {} | |||
}); | |||
@@ -238,10 +289,11 @@ appProductFamily = new Vue({ | |||
delimiters: ['${', '}'], | |||
computed: { | |||
productFamily: function () { | |||
if(this.isMounted) { | |||
if (this.isMounted) { | |||
return { | |||
'title': this.title, | |||
'behaviorCountStock': this.behaviorCountStock, | |||
'behaviorStockWeek': this.behaviorStockWeek, | |||
'behaviorPrice': this.$refs.productUnitPrice.behaviorPrice, | |||
'unit': this.$refs.productUnitPrice.unit, //this.getProductUnitPrice('unit'), | |||
'unitWording': this.$refs.productUnitPrice.unitWording, | |||
@@ -268,16 +320,17 @@ appProductFamily = new Vue({ | |||
'reductionValue': this.reductionValue, | |||
'reductionBehaviorTaxRate': this.reductionBehaviorTaxRate | |||
}; | |||
}else{ | |||
} else { | |||
return { | |||
'title': null, | |||
'behaviorCountStock': null, | |||
'behaviorStockWeek': null, | |||
'behaviorPrice': null, | |||
'unit': null, | |||
'unitWording': null, | |||
'quantity': null, | |||
'price': null, | |||
'priceWithTax':null, | |||
'priceWithTax': null, | |||
'buyingPrice': null, | |||
'buyingPriceWithTax': null, | |||
'buyingPriceByRefUnit': null, | |||
@@ -301,19 +354,20 @@ appProductFamily = new Vue({ | |||
return Object.assign( | |||
{ | |||
isMounted:false, | |||
isMounted: false, | |||
indexFormProduct: 0, | |||
title: null, | |||
isNovelty: null, | |||
isOrganic: null, | |||
propertyExpirationDate: null, | |||
behaviorCountStock: null, | |||
behaviorStockWeek:null, | |||
typeExpirationDate: null, | |||
behaviorExpirationDate: null, | |||
propertyAllergens: null, | |||
propertyOrganicLabelActive: false, | |||
propertyNoveltyExpirationDateActive: false, | |||
activeProducts:false, | |||
activeProducts: false, | |||
formProductArray: [], | |||
currentSection: 'general', | |||
@@ -342,6 +396,10 @@ appProductFamily = new Vue({ | |||
name: 'reduction', | |||
nameDisplay: 'Réduction' | |||
}, | |||
{ | |||
name: 'seo', | |||
nameDisplay: 'SEO' | |||
}, | |||
{ | |||
name: 'note', | |||
nameDisplay: 'Note interne' |
@@ -20,6 +20,7 @@ group: | |||
addresses: Livraisons & facturation | |||
main: Général | |||
products: Déclinaisons | |||
productsExtend: Champs supplémentaires | |||
priceAndUnit: Tarifs / Unités / Quantités | |||
categories: Catégories | |||
unit: Unité & quantité | |||
@@ -254,6 +255,10 @@ field: | |||
simple: Simple | |||
multiple: Multiple | |||
activeReductionCatalog: Appliquer une réduction sur ce produit | |||
exportTitle: Titre à l'export | |||
exportNote: Note à l'export | |||
quantityLabel: Label quantité | |||
quantityLabelHelp: Volumes / Poids .. (utiliser dans les caractéristiques du produit) | |||
Reduction: | |||
usersActive: Filtrer sur les utilisateurs | |||
groupUsersActive: Filtrer sur les groupes d'utilisateurs |
@@ -27,23 +27,23 @@ | |||
{% macro productField(colspan, field, fieldName, fieldDisplay = false, displaySuffix="",attr="") %} | |||
{% macro product_field(colspan, field, field_name, field_display = false, display_suffix="",attr="") %} | |||
{% if fieldDisplay == false %}{% set fieldDisplay = fieldName %}{% endif %} | |||
{% if field_display == false %}{% set field_display = field_name %}{% endif %} | |||
<td {{ attr|raw }} colspan="{{ colspan }}" class="{{ fieldName }}"> | |||
<div class="value" v-show="{{ fieldName }}Inherited == false" v-on:click="{{ fieldName }}Inherited = true"> | |||
<div v-if="{{ fieldName }}"> | |||
{% verbatim %}{{ {% endverbatim %}{{ fieldDisplay }} {% verbatim %}}}{% endverbatim %}{{ displaySuffix }} | |||
<td {{ attr|raw }} colspan="{{ colspan }}" class="{{ field_name }}"> | |||
<div class="value" v-show="{{ field_name }}Inherited == false" v-on:click="setFocusOnField('{{ field_name }}Inherited', keyForm)"> | |||
<div v-if="{{ field_name }}"> | |||
{% verbatim %}{{ {% endverbatim %}{{ field_display }} {% verbatim %}}}{% endverbatim %}{{ display_suffix }} | |||
</div> | |||
<div v-else class="inherited"> | |||
{% verbatim %}{{ productFamily.{% endverbatim %}{{ fieldDisplay }} {% verbatim %}}}{% endverbatim %}{{ displaySuffix }} | |||
{% verbatim %}{{ productFamily.{% endverbatim %}{{ field_display }} {% verbatim %}}}{% endverbatim %}{{ display_suffix }} | |||
</div> | |||
</div> | |||
<div v-show="{{ fieldName }}Inherited == true"> | |||
{{ form_widget(field, {'attr' : {'v-model' : fieldName , 'v-on:focusout': fieldName~'Inherited = false', '@change' : fieldName~'Updated'}}) }} | |||
<div v-show="{{ field_name }}Inherited == true"> | |||
{{ form_widget(field, {'attr' : {'v-model' : field_name , 'v-on:focusout': field_name~'Inherited = false', '@change' : field_name~'Updated', 'data-ref': field_name~'Inherited', ':data-y' : "keyForm" }}) }} | |||
</div> | |||
<button v-show="{{ fieldName }}" v-on:click="{{ fieldName }} = null; {{ fieldName }}Inherited = false; " | |||
<button v-show="{{ field_name }}" v-on:click="{{ field_name }} = null; {{ field_name }}Inherited = false; " | |||
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button> | |||
</td> | |||
{% endmacro %} |
@@ -83,7 +83,9 @@ | |||
<div v-show="currentSection == 'reduction'" class="panel panel-default"> | |||
{% include '@LcShop/backend/productfamily/panel_reduction.html.twig' %} | |||
</div> | |||
<div v-show="currentSection == 'seo'" class="panel panel-default"> | |||
{% include '@LcShop/backend/productfamily/panel_seo.html.twig' %} | |||
</div> | |||
<div v-show="currentSection == 'note'" class="panel panel-default"> | |||
<div class="row"> |
@@ -23,6 +23,7 @@ | |||
</div> | |||
{{ macros.endCard(true) }} | |||
{{ macros.startCard(0, 'ProductFamily.tax','light') }} | |||
<div class="col-12"> | |||
{{ form_row(form.taxRate, {'attr': {'v-model':'taxRate'}}) }} |
@@ -1,37 +1,70 @@ | |||
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | |||
{% trans_default_domain 'lcshop' %} | |||
{% macro printProductRow(product) %} | |||
<tr class="lc-draggable"> | |||
<td><i class="fa fa-fw fa-sort"></i></td> | |||
{{ macros.productField(2, product.title, 'title') }} | |||
{{ macros.productField(1, product.quantity, 'quantity') }} | |||
{{ macros.productField(2, product.unit, 'unit', 'unitWording') }} | |||
{{ macros.productField(2, product.buyingPrice, 'buyingPrice',false, '€', 'v-show="productFamily.behaviorPrice == \'by-piece\'"') }} | |||
{{ macros.productField(2, product.buyingPriceWithTax, 'buyingPriceWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'by-piece\'"') }} | |||
{{ macros.productField(2, product.buyingPriceByRefUnit, 'buyingPriceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'by-reference-unit\'"') }} | |||
{{ macros.productField(2, product.buyingPriceByRefUnitWithTax, 'buyingPriceByRefUnitWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'by-reference-unit\'"') }} | |||
{{ macros.productField(2, product.multiplyingFactor, 'multiplyingFactor') }} | |||
{{ macros.productField(2, product.priceByRefUnit, 'priceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'by-reference-unit\'"') }} | |||
{{ macros.productField(2, product.priceByRefUnitWithTax, 'priceByRefUnitWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'by-reference-unit\'"') }} | |||
<td colspan="2" v-show="productFamily.behaviorPrice == 'by-reference-unit'"> | |||
{{ macros.product_field(2, product.title, 'title') }} | |||
{{ macros.product_field(1, product.quantity, 'quantity') }} | |||
{{ macros.product_field(1, product.unit, 'unit', 'unitWording') }} | |||
{{ macros.product_field(2, product.buyingPrice, 'buyingPrice',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }} | |||
{{ macros.product_field(2, product.buyingPriceWithTax, 'buyingPriceWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }} | |||
{{ macros.product_field(2, product.buyingPriceByRefUnit, 'buyingPriceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }} | |||
{{ macros.product_field(2, product.buyingPriceByRefUnitWithTax, 'buyingPriceByRefUnitWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }} | |||
{{ macros.product_field(2, product.multiplyingFactor, 'multiplyingFactor') }} | |||
{{ macros.product_field(2, product.priceByRefUnit, 'priceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }} | |||
{{ macros.product_field(2, product.priceByRefUnitWithTax, 'priceByRefUnitWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }} | |||
<td colspan="2" v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"> | |||
{% verbatim %}{{ finalPriceWithTax }}{% endverbatim %}€ | |||
</td> | |||
{{ macros.productField(2, product.price, 'price', false, '€', 'v-show="productFamily.behaviorPrice == \'by-piece\'"') }} | |||
{{ macros.productField(2, product.priceWithTax, 'priceWithTax', false, '€', 'v-show="productFamily.behaviorPrice == \'by-piece\'"') }} | |||
{{ macros.product_field(2, product.price, 'price', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }} | |||
{{ macros.product_field(2, product.priceWithTax, 'priceWithTax', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }} | |||
{{ macros.productField(1, product.availableQuantity, 'availableQuantity',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\'"') }} | |||
{{ macros.productField(1, product.availableQuantityDefault, 'availableQuantityDefault',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\'"') }} | |||
{{ macros.product_field(1, product.availableQuantity, 'availableQuantity',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\'"') }} | |||
{{ macros.product_field(1, product.availableQuantityDefault, 'availableQuantityDefault',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\' && productFamily.behaviorStockWeek!= \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') ~ '\'"') }} | |||
{{ macros.productField(2, product.propertyExpirationDate, 'propertyExpirationDate','propertyExpirationDateValue', '', 'v-show="productFamily.behaviorExpirationDate== \'by-product\'"') }} | |||
{{ macros.product_field(2, product.propertyExpirationDate, 'propertyExpirationDate','propertyExpirationDateValue', '', 'v-show="productFamily.behaviorExpirationDate== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') ~ '\'"') }} | |||
<td> | |||
<button type="button" class="btn-remove-product btn btn-default" @click="deleteProductForm()"> | |||
<button type="button" class="btn-remove-product btn-sm btn-info" @click="modalProductForm()"> | |||
<i class="fa fa-edit"></i> | |||
</button> | |||
<button type="button" class="btn-remove-product btn-sm btn-danger" @click="deleteProductForm()"> | |||
<i class="fa fa-trash"></i> | |||
</button> | |||
{{ form_widget(product.position, {'attr' : {'class': "field-position"}}) }} | |||
<div class="modal fade show" id="modal-extends-product"> | |||
<div class="modal-dialog"> | |||
<div class="modal-content"> | |||
<div class="modal-header"> | |||
<h4>{{ "group.ProductFamily.productsExtend"|trans }}</h4> | |||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |||
<span aria-hidden="true">×</span> | |||
</button> | |||
</div> | |||
<div class="modal-body"> | |||
<div class="col"> | |||
{{ form_row(product.exportTitle) }} | |||
</div> | |||
<div class="col"> | |||
{{ form_row(product.exportNote) }} | |||
</div> | |||
</div> | |||
<div class="modal-footer justify-content-between"> | |||
<button type="button" class="btn btn-info float-right" data-dismiss="modal">Ok</button> | |||
</div> | |||
</div> | |||
<!-- /.modal-content --> | |||
</div> | |||
</div> | |||
</td> | |||
</tr> | |||
{% endmacro %} | |||
@@ -53,20 +86,20 @@ | |||
<th colspan="1" class="string "> | |||
Quantité | |||
</th> | |||
<th colspan="2" class="quantity"> | |||
<th colspan="1" class="quantity"> | |||
Unité | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class="buyingPriceByRefUnit"> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class="buyingPriceByRefUnit"> | |||
PA HT / ${ getUnitReference() } | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class="priceByRefUnit"> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class="priceByRefUnit"> | |||
PA TTC / ${ getUnitReference() } | |||
</th> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='by-piece'"> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> | |||
PA HT | |||
</th> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='by-piece'"> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> | |||
PA TTC | |||
</th> | |||
<th colspan="2" class=""> | |||
@@ -74,27 +107,27 @@ | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class=""> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class=""> | |||
PV HT / ${ getUnitReference() } | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class="price"> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class="price"> | |||
PV TTC / ${ getUnitReference() } | |||
</th> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='by-piece'"> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> | |||
PV HT | |||
</th> | |||
<th colspan="2" class="price"> | |||
PV TTC | |||
</th> | |||
<th v-show="behaviorCountStock== 'by-product'"> | |||
<th v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'"> | |||
Stock | |||
</th> | |||
<th v-show="behaviorCountStock== 'by-product'"> | |||
<th 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 | |||
</th> | |||
<th colspan="2" class="" v-show="behaviorExpirationDate== 'by-product'"> | |||
<th colspan="2" class="" v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'"> | |||
<span style="text-transform: uppercase"> ${typeExpirationDate}</span> | |||
</th> | |||
<th class=""> | |||
@@ -121,20 +154,20 @@ | |||
<th colspan="1" class="string "> | |||
${productFamily.quantity} | |||
</th> | |||
<th colspan="2" class="quantity"> | |||
<th colspan="1" class="quantity"> | |||
${productFamily.unitWording} | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class="buyingPriceByRefUnit"> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class="buyingPriceByRefUnit"> | |||
${productFamily.buyingPriceByRefUnit} | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class="priceByRefUnit"> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class="priceByRefUnit"> | |||
${productFamily.buyingPriceByRefUnitWithTax} | |||
</th> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='by-piece'"> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> | |||
${productFamily.buyingPrice} | |||
</th> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='by-piece'"> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> | |||
${productFamily.buyingPriceWithTax} | |||
</th> | |||
<th colspan="2" class=""> | |||
@@ -142,25 +175,25 @@ | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class=""> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class=""> | |||
${productFamily.priceByRefUnit} | |||
</th> | |||
<th v-show="getBehaviorPrice() == 'by-reference-unit'" colspan="2" class="price"> | |||
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" colspan="2" class="price"> | |||
${productFamily.priceByRefUnitWithTax} | |||
</th> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='by-piece'"> | |||
<th colspan="2" class="price" v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> | |||
${productFamily.price} | |||
</th> | |||
<th colspan="2" class="price"> | |||
${productFamily.priceWithTax} | |||
</th> | |||
<th v-show="behaviorCountStock== 'by-product'"> | |||
<th v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'"> | |||
</th> | |||
<th v-show="behaviorCountStock== 'by-product'"> | |||
<th 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" class="" v-show="behaviorExpirationDate== 'by-product'"> | |||
<th colspan="2" class="" v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'"> | |||
${propertyExpirationDate} | |||
</th> | |||
<th class=""> |
@@ -0,0 +1,14 @@ | |||
{% trans_default_domain 'lcshop' %} | |||
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | |||
<div class="row"> | |||
{{ macros.startCard(12, 'ProductFamily.Seo', 'light') }} | |||
<div class="col"> | |||
{{ form_row(form.metaTitle)}} | |||
{{ form_row(form.metaDescription)}} | |||
</div> | |||
{{ macros.endCard() }} | |||
</div> |
@@ -8,7 +8,7 @@ | |||
<div class="col"> | |||
{{ form_label(form.behaviorCountStock) }} | |||
{% for field in form.behaviorCountStock %} | |||
{% if field.vars.value == "by-product" %} | |||
{% if field.vars.value == constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') %} | |||
<div v-if="activeProducts == true"> | |||
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }} | |||
</div> | |||
@@ -16,6 +16,11 @@ | |||
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorCountStock'}}) }} | |||
{% endif %} | |||
{% endfor %} | |||
{{ form_label(form.behaviorStockWeek) }} | |||
{% for field in form.behaviorStockWeek %} | |||
{{ form_widget(field, {"attr" : {"v-model" : 'behaviorStockWeek'}}) }} | |||
{% 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') }}'" | |||
@@ -30,7 +35,8 @@ | |||
</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"> |