```
✨ feat(contrats/add.twig): Ajoute le détail des options au formulaire ✨ feat(SearchProduct.js): Implémente la recherche et la sélection d'options 🐛 fix(DevisController.php): Corrige la création/édition de devis et supprime un devis ✨ feat(admin.js): Enregistre les custom elements SearchOptions ✨ feat(templates/dashboard/devis): Permet l'édition et la suppression d'un devis ```
This commit is contained in:
@@ -64,11 +64,23 @@
|
||||
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||
<div class="space-y-3">
|
||||
<label for="billAddress" class="{{ label_class }}">Adresse de facturation</label>
|
||||
<select id="billAddress" name="devis[bill_address]" class="{{ input_class }}"></select>
|
||||
<select id="billAddress" name="devis[bill_address]" class="{{ input_class }}">
|
||||
{% if billAddress is defined %}
|
||||
{% for key,shipAdd in billAddress %}
|
||||
<option {% if key == devis.billAddress.id%}selected{% endif%} value="{{ key }}">{{ shipAdd }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="space-y-3">
|
||||
<label for="shipAddress" class="{{ label_class }}">Adresse de livraison</label>
|
||||
<select id="shipAddress" name="devis[ship_address]" class="{{ input_class }}"></select>
|
||||
<select id="shipAddress" name="devis[ship_address]" class="{{ input_class }}">
|
||||
{% if shipAddress is defined %}
|
||||
{% for key,shipAdd in shipAddress %}
|
||||
<option {% if key == devis.addressShip.id%}selected{% endif%} value="{{ key }}">{{ shipAdd }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{# SECTION ADRESSES #}
|
||||
@@ -92,35 +104,43 @@
|
||||
</div>
|
||||
|
||||
<ol class="form-repeater__rows space-y-4" data-ref="rows">
|
||||
<li class="form-repeater__row group animate-in slide-in-from-right-5 duration-300">
|
||||
{% for key,line in lines %}
|
||||
<li class="form-repeater__row group animate-in slide-in-from-right-5 duration-300">
|
||||
<fieldset class="backdrop-blur-md bg-white/5 border border-white/10 rounded-[2.5rem] p-8 hover:border-blue-500/30 transition-all shadow-xl">
|
||||
|
||||
{% if line.id is defined %}
|
||||
<input type="hidden" name="lines[{{ key }}][id]" value="{{ line.id }}">
|
||||
{% endif %}
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-12 gap-5 items-end">
|
||||
|
||||
{# 1. PRODUIT #}
|
||||
<div class="lg:col-span-5">
|
||||
<label class="{{ label_class }}">Produit / Prestation</label>
|
||||
<select data-load="product" name="lines[0][product_id]" class="{{ input_class }}" required>
|
||||
<select data-load="product" name="lines[{{ key }}][product_id]" class="{{ input_class }}" required>
|
||||
{% if line.id is not defined%}
|
||||
<option value="">Sélectionner...</option>
|
||||
{% else %}
|
||||
{% for product in products %}
|
||||
<option {% if product.id == line.product_id %}selected{% endif %} value="{{ product.id }}">{{ product.name }} - {{ product.ref }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{# 2. DURÉE #}
|
||||
<div class="lg:col-span-2">
|
||||
<label class="{{ label_class }}">Jours</label>
|
||||
<input type="number" name="lines[0][days]" min="1" placeholder="1" class="{{ input_class }} [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" required />
|
||||
<input type="number" name="lines[{{ key }}][days]" min="1" placeholder="1" class="{{ input_class }} [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" required value="{{ line.days }}" />
|
||||
</div>
|
||||
|
||||
{# 3. PRIX HT J1 #}
|
||||
<div class="lg:col-span-2">
|
||||
<label class="{{ label_class }}">HT J1 (€)</label>
|
||||
<input type="number" step="0.01" name="lines[0][price_ht]" placeholder="0.00" class="{{ input_class }} text-right font-mono" required />
|
||||
<input type="number" step="0.01" name="lines[{{ key }}][price_ht]" placeholder="0.00" class="{{ input_class }} text-right font-mono" required value="{{ line.price_ht }}" />
|
||||
</div>
|
||||
|
||||
{# 4. PRIX HT SUP #}
|
||||
<div class="lg:col-span-2">
|
||||
<label class="{{ label_class }}">HT Sup</label>
|
||||
<input type="number" step="0.01" name="lines[0][price_sup_ht]" placeholder="0.00" class="{{ input_class }} text-right font-mono" required />
|
||||
<input type="number" step="0.01" name="lines[{{ key }}][price_sup_ht]" placeholder="0.00" class="{{ input_class }} text-right font-mono" required value="{{ line.price_sup_ht }}" />
|
||||
</div>
|
||||
|
||||
{# 6. SUPPRIMER #}
|
||||
@@ -134,6 +154,7 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
<div class="mt-6 px-4">
|
||||
@@ -149,22 +170,31 @@
|
||||
<h4 class="text-sm font-black text-white uppercase tracking-widest">Détail des options</h4>
|
||||
</div>
|
||||
<ol class="form-repeater__rows space-y-4" data-ref="rows">
|
||||
{% for key,option in options %}
|
||||
<li class="form-repeater__row group animate-in slide-in-from-right-5 duration-300">
|
||||
<fieldset class="backdrop-blur-md bg-white/5 border border-white/10 rounded-[2.5rem] p-8 hover:border-blue-500/30 transition-all shadow-xl">
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-12 gap-5 items-end">
|
||||
|
||||
{% if option.id is defined %}
|
||||
<input type="hidden" name="options[{{ key }}][id]" value="{{ option.id }}">
|
||||
{% endif %}
|
||||
{# 1. PRODUIT #}
|
||||
<div class="lg:col-span-9">
|
||||
<label class="{{ label_class }}">Options</label>
|
||||
<select data-load="options" name="options[0][product_id]" class="{{ input_class }}" required>
|
||||
<option value="">Sélectionner...</option>
|
||||
<select data-load="options" name="options[{{ key }}][product_id]" class="{{ input_class }}" required >
|
||||
{% if option.id is not defined%}
|
||||
<option value="">Sélectionner...</option>
|
||||
{% else %}
|
||||
{% for optionItem in optionsList %}
|
||||
<option {% if optionItem.id == option.product_id %}selected{% endif %} value="{{ optionItem.id }}">{{ optionItem.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
{# 3. PRIX HT J1 #}
|
||||
<div class="lg:col-span-2">
|
||||
<label class="{{ label_class }}">Prix Ht (€)</label>
|
||||
<input type="number" step="0.01" name="options[0][price_ht]" placeholder="0.00" class="{{ input_class }} text-right font-mono" required />
|
||||
<input type="number" step="0.01" value="{{ option.price_ht }}" name="options[{{ key }}][price_ht]" placeholder="0.00" class="{{ input_class }} text-right font-mono" required />
|
||||
</div>
|
||||
{# 6. SUPPRIMER #}
|
||||
<div class="lg:col-span-1 flex justify-center pb-1">
|
||||
@@ -177,6 +207,7 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
<div class="mt-6 px-4">
|
||||
<button type="button" data-ref="addButton" class="w-full py-4 border-2 border-dashed border-white/10 hover:border-purple-500/50 bg-white/5 hover:bg-purple-500/10 rounded-3xl text-purple-400 text-[10px] font-black uppercase tracking-[0.4em] transition-all flex items-center justify-center space-x-3 group">
|
||||
|
||||
Reference in New Issue
Block a user