Fix #45 champs numéro vide en créant des cotis

This commit is contained in:
Noizette 2023-04-17 01:10:08 +02:00
parent b08572e6d2
commit 4aaed6f3c2
1 changed files with 3 additions and 4 deletions

View File

@ -131,7 +131,7 @@ if (f('save'))
elseif (f('select_cotis')) elseif (f('select_cotis'))
{ {
$form->check('add_cotis_1',[ $form->check('add_cotis_1',[
'numero_facture' => 'required|string', 'numero_facture' => $require_number ? 'required|string' : 'string',
'date_emission' => 'required|date_format:d/m/Y', 'date_emission' => 'required|date_format:d/m/Y',
'membre_cotis' => 'required|numeric', 'membre_cotis' => 'required|numeric',
]); ]);
@ -141,7 +141,7 @@ elseif (f('select_cotis'))
elseif (f('add_cotis')) elseif (f('add_cotis'))
{ {
$form->check('add_cotis_2',[ $form->check('add_cotis_2',[
'numero_facture' => 'required|string', 'numero_facture' => $require_number ? 'required|string' : 'string',
'date_emission' => 'required|date_format:d/m/Y', 'date_emission' => 'required|date_format:d/m/Y',
'membre_cotis' => 'required|numeric', 'membre_cotis' => 'required|numeric',
'cotisation' => 'required', 'cotisation' => 'required',
@ -168,6 +168,7 @@ elseif (f('add_cotis'))
'receveur_membre' => 1, 'receveur_membre' => 1,
'receveur_id' => f('membre_cotis'), 'receveur_id' => f('membre_cotis'),
'date_emission' => f('date_emission'), 'date_emission' => f('date_emission'),
'moyen_paiement' => 'AU',
'total' => $r->paid_amount ?? $r->amount, 'total' => $r->paid_amount ?? $r->amount,
'contenu' => ['id' => $cotis['id'], 'contenu' => ['id' => $cotis['id'],
'intitule' => $cotis['label'], 'intitule' => $cotis['label'],
@ -181,8 +182,6 @@ elseif (f('add_cotis'))
$form->addError($e->getMessage()); $form->addError($e->getMessage());
} }
} }
// $step = true;
} }
if ($step) if ($step)