Commit 38ebb1c7 by Julien Jorry

Cotisation form fix

parent 8f6b1be6
...@@ -75,10 +75,12 @@ class CotisationAdmin extends AbstractAdmin ...@@ -75,10 +75,12 @@ class CotisationAdmin extends AbstractAdmin
'entity_class' => Siege::class, 'entity_class' => Siege::class,
'em' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager() 'em' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager()
)) ))
->add('cotisationInfos.annee', null, array('label' => 'Année', 'data' => $now->format('Y'))) ->add('cotisationInfos.annee', null, array(
'label' => 'Année',
))
->add('montant', MoneyType::class, array( ->add('montant', MoneyType::class, array(
'label' => 'Montant', 'label' => 'Montant',
'data' => floatval($this->container->getParameter('app.cotisation_montant')) 'data' => ($cotisation->getMontant() != null)?$cotisation->getMontant():floatval($this->container->getParameter('app.cotisation_montant'))
)) ))
->add('moyen', ChoiceType::class, array( ->add('moyen', ChoiceType::class, array(
'required' => true, 'required' => true,
...@@ -96,14 +98,12 @@ class CotisationAdmin extends AbstractAdmin ...@@ -96,14 +98,12 @@ class CotisationAdmin extends AbstractAdmin
->with('Date', ['class' => 'col-md-4']) ->with('Date', ['class' => 'col-md-4'])
->add('cotisationInfos.debut', DateType::class, array( ->add('cotisationInfos.debut', DateType::class, array(
'label' => 'Date de début', 'label' => 'Date de début',
'data' => new \DateTime(),
'widget' => 'single_text', 'widget' => 'single_text',
'html5' => false, 'html5' => false,
'attr' => ['class' => 'js-datepicker'], 'attr' => ['class' => 'js-datepicker'],
)) ))
->add('cotisationInfos.fin', DateType::class, array( ->add('cotisationInfos.fin', DateType::class, array(
'label' => 'Date de fin', 'label' => 'Date de fin',
'data' => new \DateTime('+ 1 year'),
'widget' => 'single_text', 'widget' => 'single_text',
'html5' => false, 'html5' => false,
'attr' => ['class' => 'js-datepicker'], 'attr' => ['class' => 'js-datepicker'],
......
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