Commit 496f94c7 by Yvon

Merge branch 'ssa-gironde' into 5865-cancel-transaction

parents 5d8738cb 55fe59bb
......@@ -85,13 +85,12 @@ Création des tables et des contraintes :
Charger les fixtures standards :
Pour une instance non TAV :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=pro**
Pour une instance TAV :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=tavpro**
Pour une instance non SSA :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=pro**
Pour une instance TAV, ou bien :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=tavpro**
ou bien :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=ssagirondepro**
Vous obtiendrez cette erreur ci dessous, c'est normal !
......@@ -100,13 +99,13 @@ There is no main category related to context: rubrique
**$ php bin/console sonata:media:fix-media-context**
Pour une instance non TAV :
**$ php bin/console hautelook:fixtures:load --append --env=pro**
Pour une instance TAV :
Pour une instance non SSA :
**$ php bin/console hautelook:fixtures:load --append --env=pro**
Pour une instance TAV, ou bien :
**$ php bin/console hautelook:fixtures:load --append --env=tavpro**
ou bien :
**$ php bin/console hautelook:fixtures:load --append --env=ssagirondepro**
**$ php bin/console hautelook:fixtures:load --append --env=tavpro**
Supprimer le cache (si besoin)
......
......@@ -38,12 +38,14 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
/**
* Administration des adhérents.
......@@ -160,6 +162,12 @@ class AdherentAdmin extends AbstractAdmin
'required' => true,
'with_geoloc' => false,
'with_latlon' => false,
'with_subterritory' =>
$this->getConfigurationPool()->getContainer()->getParameter('tav_env')
&& $this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance'),
'with_quartier' =>
$this->getConfigurationPool()->getContainer()->getParameter('tav_env')
&& $this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance')
])
->end()
->with('Groupe', ['class' => 'col-md-5'])
......@@ -179,6 +187,28 @@ class AdherentAdmin extends AbstractAdmin
$formMapper
->tab('General')
->with('Foyer', ['class' => 'col-md-7'])
->add('householdComposition',ChoiceType::class, [
'choices' => [
"Personne seule" => "Personne seule",
"Couple sans enfant à charge" => "Couple sans enfant à charge",
"Famille mono-parentale" => "Famille mono-parentale",
"Couple avec enfant(s) à charge" => "Couple avec enfant(s) à charge",
"Autre" => "Autre"
],
'label' => "Composition du foyer (pour information)",
'required' => true,
'placeholder' => "Choix de la composition du foyer",
])
->add('householdAdultCount',IntegerType::class, [
'label' => "Nombre total d'adultes dans le foyer (pour calculer l'allocation)",
'constraints' => [
new GreaterThanOrEqual(['value' => 0]),
],
'required' => true,
'attr' => [
'autocomplete' => false
]
])
->add('dependentChildren', CollectionType::class, [
'entry_type' => DependentChildFormType::class,
'entry_options' => [
......@@ -189,7 +219,7 @@ class AdherentAdmin extends AbstractAdmin
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false,
'label' => "Enfant(s) à charge"
'label' => "Enfant(s) à charge (pour calculer l'allocation)"
])
->end()
->end();
......@@ -222,7 +252,10 @@ class AdherentAdmin extends AbstractAdmin
}
return $choice->__toString();
}
},
'attr' => [
'autocomplete' => 'off'
]
])
->end()
->end();
......@@ -241,25 +274,37 @@ class AdherentAdmin extends AbstractAdmin
"prélèvement" => "prélèvement"
],
'empty_data' => null,
'placeholder' => 'Choisir un moyen de paiement'
'placeholder' => 'Choisir un moyen de paiement',
'attr' => [
'autocomplete' => 'off'
]
])
->add('jourPrelevement', ChoiceType::class, [
'required' => false,
'label' => 'Jour de prélèvement :',
'choices' => $this->daysOfMonth(),
'empty_data' => null,
'placeholder' => 'Choisir un jour de prélèvement'
'placeholder' => 'Choisir un jour de prélèvement',
'attr' => [
'autocomplete' => 'off'
]
])
->add('mailRappelCotisation', CheckboxType::class, [
'required' => false,
'label' => 'Recevoir un rappel du paiement de ma cotisation par mail',
'attr' => [
'autocomplete' => 'off'
]
])
->add('jourMailRappelCotisation', ChoiceType::class, [
'required' => false,
'label' => 'Jour de l\'envoi du mail de rappel :',
'choices' => $this->daysOfMonth(),
'empty_data' => null,
'placeholder' => 'Choisir un jour pour l\'envoi du mail de rappel'
'placeholder' => 'Choisir un jour pour l\'envoi du mail de rappel',
'attr' => [
'autocomplete' => 'off'
]
])
->end()
->end();
......@@ -275,7 +320,10 @@ class AdherentAdmin extends AbstractAdmin
'disabled' => true,
'required' => false,
'label' => 'Solde e-' . $mlc . ' :',
'data' => $balance . ' ' . $mlc
'data' => $balance . ' ' . $mlc,
'attr' => [
'autocomplete' => 'off'
]
])
->end()
->end();
......
......@@ -119,6 +119,16 @@ class Adherent extends AccountableObject implements AccountableInterface
*/
private $dependentChildren;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $householdComposition;
/**
* @ORM\Column(type="integer", length=255, nullable=true)
*/
private $householdAdultCount;
public function __construct()
{
......@@ -307,6 +317,18 @@ class Adherent extends AccountableObject implements AccountableInterface
return $this;
}
public function getHouseholdComposition(): ?string
{
return $this->householdComposition;
}
public function setHouseholdComposition(?string $householdComposition): self
{
$this->householdComposition = $householdComposition;
return $this;
}
public function getJourPrelevement(): ?int
{
......@@ -319,6 +341,18 @@ class Adherent extends AccountableObject implements AccountableInterface
return $this;
}
public function getHouseholdAdultCount(): ?int
{
return $this->householdAdultCount;
}
public function setHouseholdAdultCount(?int $householdAdultCount): self
{
$this->householdAdultCount = $householdAdultCount;
return $this;
}
public function getMailRappelCotisation(): ?bool
{
......
......@@ -66,6 +66,23 @@ class Geoloc
*/
private $lon;
/**
* @var Subterritory
*
* @ORM\ManyToOne(targetEntity="Subterritory")
* @ORM\JoinColumn(name="subterritory_id", referencedColumnName="id", nullable=true)
*/
private $subterritory;
/**
* @var string|null
*
* @ORM\Column(name="quartier", type="string", length=255, nullable=true)
* @Groups({"read", "write"})
*/
private $quartier;
public function getId()
{
return $this->id;
......@@ -171,6 +188,46 @@ class Geoloc
return $this;
}
/**
* @return Subterritory|null
*/
public function getSubterritory(): ?Subterritory
{
return $this->subterritory;
}
/**
* @param Subterritory|null $subterritory
*
* @return Geoloc
*/
public function setSubterritory(?Subterritory $subterritory): Geoloc
{
$this->subterritory = $subterritory;
return $this;
}
/**
* @return string|null
*/
public function getQuartier(): ?string
{
return $this->quartier;
}
/**
* @param string|null $quartier
*
* @return Geoloc
*/
public function setQuartier(?string $quartier)
{
$this->quartier = $quartier;
return $this;
}
public function __toString(): string
{
return (!empty($this->adresse) ? $this->adresse : '') . ' ' . (!empty($this->cpostal) ? $this->cpostal : '') . ' ' . (!empty($this->ville) ? $this->ville : '');
......
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Doctrine\UuidGenerator;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="subterritory")
*/
class Subterritory
{
/**
* @var \Ramsey\Uuid\UuidInterface
*
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*/
protected $id;
/**
* @var string|null
*
* @ORM\Column(type="string", unique=true)
* @Assert\NotBlank
*/
protected $name;
public function getId()
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name)
{
$this->name = $name;
return $this;
}
}
......@@ -3,6 +3,8 @@
namespace App\Form\Type;
use App\Entity\Geoloc;
use App\Entity\Subterritory;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
......@@ -71,6 +73,25 @@ class GeolocFormType extends AbstractType
])
;
}
if (true === $options['with_quartier']) {
$builder
->add('quartier', TextType::class, [
'required' => false,
])
;
}
if (true === $options['with_subterritory']) {
$builder
->add('subterritory', EntityType::class, [
'class' => Subterritory::class,
'label' => 'Territoire',
'required' => true,
'choice_label' => 'name',
'placeholder' => "Choix du territoire",
'attr' => ['autocomplete' => 'off']
])
;
}
}
public function configureOptions(OptionsResolver $resolver)
......@@ -80,6 +101,8 @@ class GeolocFormType extends AbstractType
'data_class' => Geoloc::class,
'with_geoloc' => true,
'with_latlon' => true,
'with_subterritory' => false,
'with_quartier' => false
]);
}
......
<?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 Version20240311154311 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('CREATE TABLE subterritory (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_7D1B925F5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB');
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Bordeaux Nord / Bordeaux La Benauge')");
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Pays foyen')");
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Bègles')");
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Sud Gironde / Bazadais')");
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE subterritory');
}
}
<?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 Version20240311155641 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 geoloc ADD subterritory_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE geoloc ADD CONSTRAINT FK_E1B7F4E7C8B38DB4 FOREIGN KEY (subterritory_id) REFERENCES subterritory (id)');
$this->addSql('CREATE INDEX IDX_E1B7F4E7C8B38DB4 ON geoloc (subterritory_id)');
$this->addSql('ALTER TABLE prestataire 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 geoloc DROP FOREIGN KEY FK_E1B7F4E7C8B38DB4');
$this->addSql('DROP INDEX IDX_E1B7F4E7C8B38DB4 ON geoloc');
$this->addSql('ALTER TABLE geoloc DROP subterritory_id');
$this->addSql('ALTER TABLE prestataire 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 Version20240311161651 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 geoloc ADD quartier VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire 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 geoloc DROP quartier');
$this->addSql('ALTER TABLE prestataire 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 Version20240311163934 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 adherent ADD household_composition VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire 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 adherent DROP household_composition');
$this->addSql('ALTER TABLE prestataire 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 Version20240311170014 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 adherent ADD household_adult_count INT DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire 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 adherent DROP household_adult_count');
$this->addSql('ALTER TABLE prestataire 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