Browse Source

Correctif mineur

develop
Fabien Normand 2 years ago
parent
commit
a20dd6a090
6 changed files with 18 additions and 8 deletions
  1. +1
    -1
      Controller/AbstractAdminController.php
  2. +3
    -0
      Definition/Field/AbstractFieldDefinition.php
  3. +6
    -0
      Resources/assets/app/adminlte/main/scss/_common.scss
  4. +3
    -3
      Resources/assets/functions/prices.js
  5. +4
    -4
      Resources/assets/functions/widgets.js
  6. +1
    -0
      Resources/translations/admin.fr.yaml

+ 1
- 1
Controller/AbstractAdminController.php View File

} }


$newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance()); $newEntity = $entityComponent->duplicateEntity($context->getEntity()->getInstance());
$em->create($newEntity);
$em->create($newEntity, false);
$em->flush(); $em->flush();


$url = $this->get(AdminUrlGenerator::class) $url = $this->get(AdminUrlGenerator::class)

+ 3
- 0
Definition/Field/AbstractFieldDefinition.php View File

use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\CaracoleBundle\Field\AssociationField;
use Lc\SovBundle\Field\CKEditorField; use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\CollectionField; use Lc\SovBundle\Field\CollectionField;
use Lc\SovBundle\Field\ImageManagerField; use Lc\SovBundle\Field\ImageManagerField;
'status' => StatusField::new('status')->setSortable(true), 'status' => StatusField::new('status')->setSortable(true),
'createdAt' => DateTimeField::new('createdAt')->setSortable(true), 'createdAt' => DateTimeField::new('createdAt')->setSortable(true),
'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true), 'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true),
'createdBy' => AssociationField::new('createdBy'),
'updatedBy' => AssociationField::new('updatedBy')
]; ];
} }



+ 6
- 0
Resources/assets/app/adminlte/main/scss/_common.scss View File

} }


.badge.stripped{background-image: url('../img/stripped.png');} .badge.stripped{background-image: url('../img/stripped.png');}

.ui-sortable-helper {
display: table;
}
.lc-draggable{width: 100%;}
.sortable{width: 100%}

+ 3
- 3
Resources/assets/functions/prices.js View File

} }


static getPriceWithTax(priceWithoutTax, taxRate) { static getPriceWithTax(priceWithoutTax, taxRate) {
return parseFloat(parseFloat(priceWithoutTax) * ((taxRate/100) + 1)).toFixed(2);
return parseFloat(parseFloat(priceWithoutTax) * ((taxRate/100) + 1)).toFixed(4);
} }


static getMargin(price, buyingPrice){ static getMargin(price, buyingPrice){


static applyReductionAmount(price, amount) static applyReductionAmount(price, amount)
{ {
return parseFloat(price - amount).toFixed(2);
return parseFloat(price - amount).toFixed(4);
} }


static applyPercent(price, percentage) static applyPercent(price, percentage)
{ {
return parseFloat(price * (percentage / 100 + 1)).toFixed(2);
return parseFloat(price * (percentage / 100 + 1)).toFixed(4);
} }
} }

+ 4
- 4
Resources/assets/functions/widgets.js View File

options.width = 'auto' options.width = 'auto'
} }


options.placeholder = "";

// @TODO : génère une erreur // @TODO : génère une erreur
/*if ($select.find('option[value=""]')) {
if ($select.find('option[value=""]').length) {
options.placeholder = $select.find('option[value=""]').html() options.placeholder = $select.find('option[value=""]').html()
}*/

options.placeholder = "";
}


var myselect = $select.select2(options); var myselect = $select.select2(options);



+ 1
- 0
Resources/translations/admin.fr.yaml View File

label_plurial: Blocs label_plurial: Blocs
default: default:
fields: fields:
placeholder: Sélectionner une valeur
id: Id id: Id
confirmDelete: Confirmer la suppression confirmDelete: Confirmer la suppression
createdAt: Créé le createdAt: Créé le

Loading…
Cancel
Save