Commit 3d14875f by Yvon

add presta conventionnement percentage

parent 6921115c
......@@ -352,6 +352,23 @@ class PrestataireAdmin extends AbstractAdmin
->end()
->end()
;
if ($this->getConfigurationPool()->getContainer()->getParameter('presta_self_init_and_eval')) {
$formMapper
->tab('Prestataire')
->with('Prestataire', ['class' => 'col-md-6'])
->add('conventionnement', ChoiceType::class, [
'choices' => [
'50 %' => 0.5,
'75 %' => 0.75,
'100 %' => 1,
],
'required' => false,
])
->end()
->end();
}
// @TODO : add tags model transformer if add new from text
// ->get('etats')
// ->addModelTransformer(new CallbackTransformer(
......@@ -730,7 +747,6 @@ class PrestataireAdmin extends AbstractAdmin
'label' => 'Cotisation à jour',
'template' => '@kohinos/bundles/SonataAdminBundle/CRUD/list_presta_cotisation.html.twig',
]
)
->add('users', null, [
'label' => 'Gestionnaires [Cotisation à jour]',
......
......@@ -342,6 +342,21 @@ class Prestataire extends AccountableObject implements AccountableInterface
*/
private $lastTransactionsExportDatetime;
/**
* @var float
*
* @ORM\Column(name="conventionnement", type="decimal", scale=2)
* @Assert\Type("numeric")
* @Assert\GreaterThanOrEqual(
* value = 0
* )
* @Assert\LessThanOrEqual(
* value = 1
* )
*/
protected $conventionnement;
public function __construct()
{
$this->users = new ArrayCollection();
......@@ -1154,4 +1169,24 @@ class Prestataire extends AccountableObject implements AccountableInterface
return $this;
}
/**
* @return float
*/
public function getConventionnement(): ?float
{
return number_format($this->conventionnement, 2);
}
/**
* @param float $conventionnement
*
* @return Prestataire
*/
public function setConventionnement(float $conventionnement)
{
$this->conventionnement = $conventionnement;
return $this;
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240220094817 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire ADD conventionnement NUMERIC(10, 2) NOT NULL, CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire DROP conventionnement, CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment