Browse Source

correctifs tableau decli

feature/export_comptable
Fab 4 years ago
parent
commit
de6d7e7555
14 changed files with 138 additions and 59 deletions
  1. +4
    -3
      ShopBundle/Controller/Backend/ProductFamilyController.php
  2. +1
    -0
      ShopBundle/Form/Backend/Filters/ListFilterType.php
  3. +1
    -1
      ShopBundle/Model/PriceTrait.php
  4. +61
    -31
      ShopBundle/Resources/public/css/backend/custom.css
  5. +32
    -12
      ShopBundle/Resources/public/js/backend/script/default/init-edit.js
  6. +7
    -1
      ShopBundle/Resources/public/js/backend/script/default/vuejs-mixins.js
  7. +12
    -3
      ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js
  8. +5
    -0
      ShopBundle/Resources/public/sass/backend/custom.scss
  9. +1
    -1
      ShopBundle/Resources/translations/lcshop.fr.yaml
  10. +2
    -2
      ShopBundle/Resources/views/backend/default/block/macros.html.twig
  11. +7
    -0
      ShopBundle/Resources/views/backend/default/edit.html.twig
  12. +2
    -2
      ShopBundle/Resources/views/backend/form/ckeditor_widget.html.twig
  13. +2
    -2
      ShopBundle/Resources/views/backend/productfamily/macros.html.twig
  14. +1
    -1
      ShopBundle/Resources/views/backend/productfamily/panel_price.html.twig

+ 4
- 3
ShopBundle/Controller/Backend/ProductFamilyController.php View File

@@ -303,8 +303,9 @@ class ProductFamilyController extends AdminController

$this->utils->addFlash('success', 'Produit sauvegardé');

if($editForm->get('stayOnPage')->getData() || $this->request->get('submitAndStay')){
return $this->redirectToRoute('easyadmin', ['entity' => 'ProductFamily', 'action' => 'edit', 'id' => $id]) ;
if($editForm->get('stayOnPage')->getData()!="false" || $this->request->get('submitAndStay')!==null){
$refererUrl = $this->request->query->get('referer', '');
return $this->redirectToRoute('easyadmin', ['entity' => 'ProductFamily', 'action' => 'edit', 'id' => $id, 'referer' => $refererUrl]) ;
}else {
return $this->redirectToReferrer();
}
@@ -353,7 +354,7 @@ class ProductFamilyController extends AdminController
$this->executeDynamicMethod('persist<EntityName>Entity', [$entity, $newForm]);
$this->dispatch(EasyAdminEvents::POST_PERSIST, ['entity' => $entity]);

if($newForm->get('stayOnPage')->getData() || $this->request->get('submitAndStay')){
if($newForm->get('stayOnPage')->getData()!="false" || $this->request->get('submitAndStay')!==null){
return $this->redirectToRoute('easyadmin', ['entity' => 'ProductFamily', 'action' => 'edit', 'id' => $entity->getId()]) ;
}else {
return $this->redirectToReferrer();

+ 1
- 0
ShopBundle/Form/Backend/Filters/ListFilterType.php View File

@@ -129,6 +129,7 @@ class ListFilterType extends AbstractType
{
$resolver->setDefaults([
'label' => false,
'csrf_protection'=> false,
'translation_domain' => 'lcshop',
'fields' => false
]);

+ 1
- 1
ShopBundle/Model/PriceTrait.php View File

@@ -75,7 +75,7 @@ trait PriceTrait
return $this->unit;
}

public function setUnit(Unit $unit): self
public function setUnit(?Unit $unit): self
{
$this->unit = $unit;


+ 61
- 31
ShopBundle/Resources/public/css/backend/custom.css View File

@@ -567,13 +567,43 @@ table th .select2-container--default .select2-selection--single {
min-height: 38px;
}

/* ORDER */
/* line 221, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPrice input, .field-price .input-group.buyingPrice .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 222, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPriceByRefUnit input, .field-price .input-group.buyingPriceByRefUnit .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 223, ../../sass/backend/custom.scss */
.field-price .input-group.priceWithTax input, .field-price .input-group.priceWithTax .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 224, ../../sass/backend/custom.scss */
.field-price .input-group.priceByRefUnitWithTax input, .field-price .input-group.priceByRefUnitWithTax .input-group-text {
font-weight: bold;
border-color: #222;
}

/* line 225, ../../sass/backend/custom.scss */
.input-group.multiplyingFactor input, .input-group.multiplyingFactor .input-group-text {
font-weight: bold;
border-color: #222;
}

/* ORDER */
/* line 229, ../../sass/backend/custom.scss */
.table-order-summary {
width: 100%;
}

/* line 227, ../../sass/backend/custom.scss */
/* line 232, ../../sass/backend/custom.scss */
.order-product-item.redelivery {
background: rgba(18, 104, 253, 0.38) !important;
}
@@ -581,36 +611,36 @@ table th .select2-container--default .select2-selection--single {
/*.select2-container--bootstrap .select2-selection{max-width: none;}*/
/*.order-product-item{margin: 15px 0; padding: 0;}*/
/* Product */
/* line 232, ../../sass/backend/custom.scss */
/* line 237, ../../sass/backend/custom.scss */
.product-form-modal {
display: none;
}

/* line 233, ../../sass/backend/custom.scss */
/* line 238, ../../sass/backend/custom.scss */
.product-form.modal .form-check-label {
font-style: italic;
color: #666;
text-align: left;
}

/* line 234, ../../sass/backend/custom.scss */
/* line 239, ../../sass/backend/custom.scss */
.products-collection-table .inherited {
color: #888;
font-style: italic;
font-weight: initial;
}

/* line 235, ../../sass/backend/custom.scss */
/* line 240, ../../sass/backend/custom.scss */
.products-collection-table td {
position: relative;
}

/* line 236, ../../sass/backend/custom.scss */
/* line 241, ../../sass/backend/custom.scss */
.card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type {
padding-left: 0.35rem;
}

/* line 237, ../../sass/backend/custom.scss */
/* line 242, ../../sass/backend/custom.scss */
.products-collection-table .btn-empty-field {
position: absolute;
right: 3px;
@@ -619,14 +649,14 @@ table th .select2-container--default .select2-selection--single {
padding: 0px;
}

/* line 238, ../../sass/backend/custom.scss */
/* line 243, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table {
table-layout: fixed;
/* background-clip: padding-box;*/
border-collapse: collapse;
}

/* line 239, ../../sass/backend/custom.scss */
/* line 244, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th {
font-size: 13px;
border-left: 1px solid #dee2e6;
@@ -635,22 +665,22 @@ table th .select2-container--default .select2-selection--single {
border-bottom: 2px solid #dee2e6;
}

/* line 240, ../../sass/backend/custom.scss */
/* line 245, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table tfoot th {
border-top: 2px solid #dee2e6;
}

/* line 241, ../../sass/backend/custom.scss */
/* line 246, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th span {
white-space: initial;
}

/* line 242, ../../sass/backend/custom.scss */
/* line 247, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th:last-child {
border-right: 1px solid #dee2e6;
}

/* line 243, ../../sass/backend/custom.scss */
/* line 248, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td {
border-left: 1px solid #dee2e6;
text-align: center;
@@ -658,26 +688,26 @@ table th .select2-container--default .select2-selection--single {
border-bottom: 1px solid #dee2e6;
}

/* line 244, ../../sass/backend/custom.scss */
/* line 249, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td:last-child {
border-right: 1px solid #dee2e6;
white-space: nowrap;
}

/* line 245, ../../sass/backend/custom.scss */
/* line 250, ../../sass/backend/custom.scss */
#lc-product-family-edit .btn-add-product {
margin: 20px 0;
float: right;
}

/* line 246, ../../sass/backend/custom.scss */
/* line 251, ../../sass/backend/custom.scss */
#lc-product-family-edit .inherited {
color: #888;
font-style: italic;
font-weight: initial;
}

/* line 247, ../../sass/backend/custom.scss */
/* line 252, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .value {
min-width: 80%;
margin: auto;
@@ -685,68 +715,68 @@ table th .select2-container--default .select2-selection--single {
cursor: pointer;
}

/* line 248, ../../sass/backend/custom.scss */
/* line 253, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .modal {
text-align: left;
}

/* line 249, ../../sass/backend/custom.scss */
/* line 254, ../../sass/backend/custom.scss */
table.products-collection-table th.main-info, td.buyingPrice, td.multiplyingFactor, td.priceWithTax {
background: #eeeeee;
background-clip: padding-box;
}

/* DeliveryZone */
/* line 253, ../../sass/backend/custom.scss */
/* line 258, ../../sass/backend/custom.scss */
#autocomplete-cities {
position: relative;
}

/* line 257, ../../sass/backend/custom.scss */
/* line 262, ../../sass/backend/custom.scss */
#autocomplete-cities .ui-autocomplete {
left: 30%;
top: 41px;
margin-left: 18px;
}

/* line 263, ../../sass/backend/custom.scss */
/* line 268, ../../sass/backend/custom.scss */
.head-reminders {
margin-top: 15px;
}

/* TABLEAU DE BORD */
/* line 266, ../../sass/backend/custom.scss */
/* line 271, ../../sass/backend/custom.scss */
.todo-list > li {
position: relative;
}

/* line 267, ../../sass/backend/custom.scss */
/* line 272, ../../sass/backend/custom.scss */
.todo-list > li .text {
margin-left: 30px;
}

/* line 268, ../../sass/backend/custom.scss */
/* line 273, ../../sass/backend/custom.scss */
.todo-list > li .tools {
position: absolute;
top: 4px;
right: 15px;
}

/* line 270, ../../sass/backend/custom.scss */
/* line 275, ../../sass/backend/custom.scss */
#addTicketMessageForm {
margin-top: 30px;
border-top: 2px dotted #eee;
padding-top: 30px;
}

/* line 272, ../../sass/backend/custom.scss */
/* line 277, ../../sass/backend/custom.scss */
#dashboard .list-btn-statistic {
display: flex;
flex-wrap: wrap;
justify-content: center;
}

/* line 273, ../../sass/backend/custom.scss */
/* line 278, ../../sass/backend/custom.scss */
#dashboard .btn-statistic {
width: 120px;
height: 70px;
@@ -755,13 +785,13 @@ table.products-collection-table th.main-info, td.buyingPrice, td.multiplyingFact
line-height: 1rem;
}

/* line 274, ../../sass/backend/custom.scss */
/* line 279, ../../sass/backend/custom.scss */
#dashboard .btn-statistic small {
margin-bottom: 10px;
display: block;
}

/* line 275, ../../sass/backend/custom.scss */
/* line 280, ../../sass/backend/custom.scss */
#dashboard .btn-statistic .value {
display: block;
}

+ 32
- 12
ShopBundle/Resources/public/js/backend/script/default/init-edit.js View File

@@ -21,20 +21,40 @@ jQuery(document).ready(function () {
function initLcCkEditor(){
var elements = $( '.lc-ckeditor' );

log(elements);
if(elements.length) {
for (var i = 0; i < elements.length; ++i) {
var editor = CKEDITOR.replace(elements[i], {
"toolbar": [
{
name: "styles",
items: ["Format", 'Bold', 'Italic', 'Underline', 'Strike', "Link", "BulletedList"]
},
{name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']},
{name: 'insert', items: ['Image', 'SpecialChar']},
{name: "document", items: ["Source"]},
],
"language": "fr"
});
if($(elements[i]).data('config')==='simple_config'){
var editor = CKEDITOR.replace(elements[i], {
"toolbar": [
{
items: ['Bold', 'Italic', 'Underline', 'Strike']
},
{
items: ["TextColor"]
}
],
"language": "fr",
'height': 100
});
}else{
var editor = CKEDITOR.replace(elements[i], {
"toolbar": [
{
name: "styles",
items: ["Format", 'Bold', 'Italic', 'Underline', 'Strike', "Link", "BulletedList"]
},
{
items: ["TextColor"]
},
{name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']},
{name: 'insert', items: ['Image', 'SpecialChar']},
{name: "document", items: ["Source"]},
],
"language": "fr"
});
}

}
}
}

+ 7
- 1
ShopBundle/Resources/public/js/backend/script/default/vuejs-mixins.js View File

@@ -36,6 +36,9 @@ let mixinPrice = {
},
finalPriceWithTaxAndReduction(){
return this.$parent.applyReduction(this.priceValue, this.priceWithTaxValue, this.taxRateValue, true);
},
finalBuyingPrice:function () {
return parseFloat((this.buyingPriceByRefUnitValue * this.quantityValue) / this.unitCoefficient).toFixed(4);
}

},
@@ -140,6 +143,7 @@ let mixinPrice = {


unitUpdated: function () {

this.quantityUpdated();
},
quantityUpdated: function () {
@@ -154,6 +158,7 @@ let mixinPrice = {
} else if (this.behaviorPriceValue == 'by-reference-unit') {
this.setPriceFromPriceByRefUnit();
this.setPriceWithTax();
log('ncihe');
this.setBuyingPriceFromBuyingPriceByRefUnit();
this.setBuyingPriceWithTax();
}
@@ -253,7 +258,8 @@ let mixinPrice = {
this.priceInherited = true;
}
},
watch: {}
watch: {
}

}
;

+ 12
- 3
ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js View File

@@ -202,8 +202,7 @@ $(window).on('load', function () {
this.title = toPlainText(this.title)
this.title = toPlainText(this.title)
this.title = toPlainText(this.title)
this.title = toPlainText(this.title)

this.title = toPlainText(this.title);
//METHOD
//this.updateProductForm();
//this.updateProductView();
@@ -278,12 +277,20 @@ $(window).on('load', function () {
if (e.shiftKey && e.keyCode == 9) {
e.preventDefault();
$prevField = $(this).parents('td').prevAll('td:visible').first().find('input, select');
log($prevField);
if($prevField.length == 0){
$prevField = $(this).parents('td').prevAll('td:visible').first().prevAll('td:visible').first().find('input, select');

}
app.setFocusOnField($prevField.data('ref'), $prevField.data('y'));

//DROITE (tab)
} else if (e.keyCode == '9') {
e.preventDefault();
$nextField = $(this).parents('td').nextAll('td:visible').first().find('input, select');
if($nextField.length == 0){
$nextField = $(this).parents('td').nextAll('td:visible').first().nextAll('td:visible').first().find('input, select');
}
app.setFocusOnField($nextField.data('ref'), $nextField.data('y'));
}

@@ -492,7 +499,9 @@ $(window).on('load', function () {
},
postForm:function(){
this.stayOnPage = 1;
$("#edit-productfamily-form").submit();
this.$nextTick(function () {
$("#edit-productfamily-form").submit();
});
},

initLcSortableProductsList: function () {

+ 5
- 0
ShopBundle/Resources/public/sass/backend/custom.scss View File

@@ -218,6 +218,11 @@ table th .select2-container--default .select2-selection--single{padding:0.3rem 0

.autoresize textarea{height: auto; min-height: 38px;}

.field-price .input-group.buyingPrice input,.field-price .input-group.buyingPrice .input-group-text{font-weight: bold; border-color: #222 }
.field-price .input-group.buyingPriceByRefUnit input,.field-price .input-group.buyingPriceByRefUnit .input-group-text{font-weight: bold; border-color: #222 }
.field-price .input-group.priceWithTax input,.field-price .input-group.priceWithTax .input-group-text{font-weight: bold; border-color: #222 }
.field-price .input-group.priceByRefUnitWithTax input,.field-price .input-group.priceByRefUnitWithTax .input-group-text{font-weight: bold; border-color: #222 }
.input-group.multiplyingFactor input,.input-group.multiplyingFactor .input-group-text{font-weight: bold; border-color: #222 }

/* ORDER */


+ 1
- 1
ShopBundle/Resources/translations/lcshop.fr.yaml View File

@@ -385,7 +385,7 @@ field:
quantityProduct: Quantité (en rapport à l'unité)
unit: Unité
redeliverySupplier: Erreur producteur
redeliverySupplierOrder: À rappeler au prochain bon de commande producteur
redeliverySupplierOrder: A recommander au producteur
deliveryType: Type de livraison
deliveryTypeOptions:
point-sale: En ambassade

+ 2
- 2
ShopBundle/Resources/views/backend/default/block/macros.html.twig View File

@@ -69,7 +69,7 @@
</div>
<div class="col-6">
<div class="form-widget">
<div class="input-group">
<div class="input-group {{ fieldName }}">
{{ form_widget(field, {'attr' : {'v-model': fieldName, '@change' : fieldName~'Updated'}}) }}
<div class="input-group-append">
<span class="input-group-text">€ HT
@@ -80,7 +80,7 @@
</div>
</div>
<div class="col-6">
<div class="input-group">
<div class="input-group {{ fieldName }}WithTax">
{{ form_widget(fieldTax, {'attr' : {'v-model': fieldName ~ 'WithTax', '@change' : fieldName~'WithTaxUpdated'}}) }}
<div class="input-group-append">
<span class="input-group-text">€ TTC

+ 7
- 0
ShopBundle/Resources/views/backend/default/edit.html.twig View File

@@ -51,6 +51,13 @@
{% block plugin_javascript %}
{{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery-ui/jquery-ui.min.js') }}"></script>
<script type="text/javascript">
var CKEDITOR_BASEPATH = "{{ ckeditor_base_path("/bundles/fosckeditor/") }}";
</script>
<script type="text/javascript" src="{{ asset('bundles/fosckeditor/ckeditor.js') }}"></script>
{#{% if jquery %}
<script type="text/javascript" src="{{ ckeditor_js_path(jquery_path) }}"></script>
{% endif %}#}
{% endblock %}

{% block script_javascript %}

+ 2
- 2
ShopBundle/Resources/views/backend/form/ckeditor_widget.html.twig View File

@@ -15,7 +15,7 @@
{% endblock %}

{% block _ckeditor_javascript %}
{% if autoload %}
{# {% if autoload %}
<script type="text/javascript">
var CKEDITOR_BASEPATH = "{{ ckeditor_base_path(base_path) }}";
</script>
@@ -23,7 +23,7 @@
{% if jquery %}
<script type="text/javascript" src="{{ ckeditor_js_path(jquery_path) }}"></script>
{% endif %}
{% endif %}
{% endif %}#}
{#<script type="text/javascript">
{% if jquery %}
$(function () {

+ 2
- 2
ShopBundle/Resources/views/backend/productfamily/macros.html.twig View File

@@ -34,7 +34,7 @@
<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="{{ field_name }}" v-on:click="{{ field_name }} = null; {{ field_name }}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 %}
@@ -52,7 +52,7 @@
{{ _self.product_field(3, product.buyingPriceWithTax, 'buyingPriceWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }}

<td class="buyingPrice" colspan="3" v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'">
{% verbatim %}{{ buyingPriceValue }}{% endverbatim %}€
{% verbatim %}{{ finalBuyingPrice }}{% endverbatim %}€
</td>

{{ _self.product_field(3, product.multiplyingFactor, 'multiplyingFactor') }}

+ 1
- 1
ShopBundle/Resources/views/backend/productfamily/panel_price.html.twig View File

@@ -73,7 +73,7 @@
<div class="col-6">
<div class="form-widget">
{{ form_label(form.multiplyingFactor) }}
<div class="input-group">
<div class="input-group multiplyingFactor">
{{ form_widget(form.multiplyingFactor, {'attr': {'v-model':'multiplyingFactor', '@change' : 'multiplyingFactorUpdated'}}) }}
<div class="input-group-append">
<span class="input-group-text">X</span>

Loading…
Cancel
Save