Commit 20d36a21 by Damien Moulard

Merge branch '5749-add-presta-conventionnement-percentage' into 'ssa-gironde'

add presta conventionnement percentage

See merge request cooperatic/kohinos-tav!53
parents 6921115c c8f68538
...@@ -352,6 +352,23 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -352,6 +352,23 @@ class PrestataireAdmin extends AbstractAdmin
->end() ->end()
->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 // @TODO : add tags model transformer if add new from text
// ->get('etats') // ->get('etats')
// ->addModelTransformer(new CallbackTransformer( // ->addModelTransformer(new CallbackTransformer(
...@@ -730,7 +747,6 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -730,7 +747,6 @@ class PrestataireAdmin extends AbstractAdmin
'label' => 'Cotisation à jour', 'label' => 'Cotisation à jour',
'template' => '@kohinos/bundles/SonataAdminBundle/CRUD/list_presta_cotisation.html.twig', 'template' => '@kohinos/bundles/SonataAdminBundle/CRUD/list_presta_cotisation.html.twig',
] ]
) )
->add('users', null, [ ->add('users', null, [
'label' => 'Gestionnaires [Cotisation à jour]', 'label' => 'Gestionnaires [Cotisation à jour]',
......
...@@ -342,6 +342,15 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -342,6 +342,15 @@ class Prestataire extends AccountableObject implements AccountableInterface
*/ */
private $lastTransactionsExportDatetime; private $lastTransactionsExportDatetime;
/**
* @var float
*
* @ORM\Column(name="conventionnement", type="decimal", scale=2, nullable=true)
* @Assert\Type("numeric")
*/
protected $conventionnement;
public function __construct() public function __construct()
{ {
$this->users = new ArrayCollection(); $this->users = new ArrayCollection();
...@@ -1154,4 +1163,24 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -1154,4 +1163,24 @@ class Prestataire extends AccountableObject implements AccountableInterface
return $this; return $this;
} }
/**
* @return mixed
*/
public function getConventionnement()
{
return $this->conventionnement !== null ? number_format($this->conventionnement, 2) : null;
}
/**
* @param mixed $conventionnement
*
* @return Prestataire
*/
public function setConventionnement($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)\'');
}
}
<?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 Version20240221094604 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 CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\', CHANGE conventionnement conventionnement NUMERIC(10, 2) DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\', CHANGE conventionnement conventionnement NUMERIC(10, 2) NOT NULL');
}
}
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