remove required options contrat
This commit is contained in:
@@ -473,12 +473,14 @@ class ContratsController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($postData['options'] ?? [] as $opt) {
|
foreach ($postData['options'] ?? [] as $opt) {
|
||||||
$vo = (new ContratsOption())
|
if($opt['name'] != "") {
|
||||||
->setName($opt['name'])
|
$vo = (new ContratsOption())
|
||||||
->setDetails($opt['details'])
|
->setName($opt['name'])
|
||||||
->setPrice($opt['priceHt']);
|
->setDetails($opt['details'])
|
||||||
$this->em->persist($vo);
|
->setPrice($opt['priceHt']);
|
||||||
$contrat->addContratsOption($vo);
|
$this->em->persist($vo);
|
||||||
|
$contrat->addContratsOption($vo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$contrat->setNumReservation($this->generateReservationNumber());
|
$contrat->setNumReservation($this->generateReservationNumber());
|
||||||
|
|||||||
@@ -227,7 +227,7 @@
|
|||||||
<div class="lg:col-span-6">
|
<div class="lg:col-span-6">
|
||||||
<label class="text-[9px] font-black text-slate-300 uppercase tracking-widest ml-1 mb-2 block">Produit / Prestation</label>
|
<label class="text-[9px] font-black text-slate-300 uppercase tracking-widest ml-1 mb-2 block">Produit / Prestation</label>
|
||||||
<div class="relative flex items-center">
|
<div class="relative flex items-center">
|
||||||
<input type="text" name="options[{{ key }}][name]" value="{{ line.name }}" required class="w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-purple-500/20 focus:border-purple-500 transition-all py-3 pl-5 pr-12 text-sm">
|
<input type="text" name="options[{{ key }}][name]" value="{{ line.name }}" class="w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-purple-500/20 focus:border-purple-500 transition-all py-3 pl-5 pr-12 text-sm">
|
||||||
|
|
||||||
{# BOUTON RECHERCHER #}
|
{# BOUTON RECHERCHER #}
|
||||||
<button is="search-options" type="button" class="absolute right-2 p-2 bg-purple-500/10 hover:bg-purple-500 text-purple-400 hover:text-white rounded-xl transition-all duration-300 group/search" title="Rechercher un produit">
|
<button is="search-options" type="button" class="absolute right-2 p-2 bg-purple-500/10 hover:bg-purple-500 text-purple-400 hover:text-white rounded-xl transition-all duration-300 group/search" title="Rechercher un produit">
|
||||||
@@ -241,8 +241,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{# 2. PRIX 1J #}
|
{# 2. PRIX 1J #}
|
||||||
<div class="lg:col-span-3">
|
<div class="lg:col-span-3">
|
||||||
<label class="text-[9px] font-black text-slate-300 uppercase tracking-widest ml-1 mb-2 block">Prix 1J HT</label>
|
<label class="text-[9px] font-black text-slate-300 uppercase tracking-widest ml-1 mb-2 block">Prix HT</label>
|
||||||
<input type="text" name="options[{{ key }}][priceHt]" value="{{ line.priceHt }}" required class="w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-purple-500/20 focus:border-purple-500 transition-all py-3 px-5 text-sm font-mono">
|
<input type="text" name="options[{{ key }}][priceHt]" value="{{ line.priceHt }}" class="w-full bg-slate-950/50 border-white/5 rounded-2xl text-white focus:ring-purple-500/20 focus:border-purple-500 transition-all py-3 px-5 text-sm font-mono">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# 5. SUPPRIMER #}
|
{# 5. SUPPRIMER #}
|
||||||
|
|||||||
Reference in New Issue
Block a user