Commit a0f2f9e5 by Yvon

fix bymonthday value not transmitted

parent f5aa95a1
......@@ -18,11 +18,11 @@ class AchatMonnaieAdherentRecurrentFormType extends AchatMonnaieAdherentFormType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$jourPrelevementChoices = [];
for ($i = 1; $i <= 28; $i++) {
$jourPrelevementChoices[strval($i)] = $i;
}
$now = new \DateTime();
//force prelevement to occur on same day as today to make sure next prelevement occurs next month
//if today is after the 28th, use the 28th so that prelevement always occurs on same date
$jourPrelevement = min($now->format('d'),28);
$builder
->add('nombreMois', IntegerType::class, [
'label' => 'Nombre d\'échéances désirées : ',
......@@ -36,8 +36,8 @@ class AchatMonnaieAdherentRecurrentFormType extends AchatMonnaieAdherentFormType
])
->add('jourPrelevement', ChoiceType::class, [
'label' => 'Jour du prélèvement dans le mois : ',
'choices' => $jourPrelevementChoices,
'data' => min($now->format('d'),28),
'choices' => [strval($jourPrelevement) => $jourPrelevement],
'data' => $jourPrelevement,
'required' => true,
'mapped' => false,
'attr' => ['autocomplete' => 'off', 'disabled' => true]
......
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