Fix generate pdf error

This commit is contained in:
Serreau Jovann
2026-02-13 19:53:14 +01:00
parent c30fe8363e
commit 20d70b4c1b

View File

@@ -56,7 +56,7 @@ export class SearchOptionsDevis extends HTMLButtonElement {
<span class="w-2 h-2 bg-blue-500 rounded-full mr-3 animate-pulse shadow-[0_0_8px_#3b82f6]"></span> <span class="w-2 h-2 bg-blue-500 rounded-full mr-3 animate-pulse shadow-[0_0_8px_#3b82f6]"></span>
Sélection Option Sélection Option
</h3> </h3>
<button type="button" onclick="this.closest('#modal-search-options').classList.add('hidden')" class="p-2 text-slate-400 hover:text-white transition-colors"> <button type="button" class="cvr p-2 text-slate-400 hover:text-white transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12"/></svg> <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12"/></svg>
</button> </button>
</div> </div>
@@ -77,6 +77,10 @@ export class SearchOptionsDevis extends HTMLButtonElement {
</div> </div>
</div> </div>
`; `;
div.querySelector('.cvr').addEventListener('click',rvt=>{
rvt.preventDefault();
div.classList.add('hidden');
})
return div; return div;
} }
@@ -132,7 +136,8 @@ export class SearchOptionsDevis extends HTMLButtonElement {
} }
fillOptionLine(option) { fillOptionLine(option) {
const row = this.closest('.form-repeater__row'); let row = this.parentElement.parentElement.parentElement.parentElement.parentElement
console.log(row);
if (row) { if (row) {
const nameInput = row.querySelector('input[name*="[product]"]'); const nameInput = row.querySelector('input[name*="[product]"]');
const priceInput = row.querySelector('input[name*="[price_ht]"]'); const priceInput = row.querySelector('input[name*="[price_ht]"]');
@@ -206,7 +211,7 @@ export class SearchProductDevis extends HTMLButtonElement {
<span class="w-2 h-2 bg-purple-500 rounded-full mr-3 animate-pulse shadow-[0_0_8px_#a855f7]"></span> <span class="w-2 h-2 bg-purple-500 rounded-full mr-3 animate-pulse shadow-[0_0_8px_#a855f7]"></span>
Sélection Produit Sélection Produit
</h3> </h3>
<button type="button" onclick="this.closest('#modal-search-product').classList.add('hidden')" class="p-2 text-slate-400 hover:text-white transition-colors"> <button type="button" class="cvr p-2 text-slate-400 hover:text-white transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12"/></svg> <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12"/></svg>
</button> </button>
</div> </div>
@@ -227,6 +232,10 @@ export class SearchProductDevis extends HTMLButtonElement {
</div> </div>
</div> </div>
`; `;
div.querySelector('.cvr').addEventListener('click',rvt=>{
rvt.preventDefault();
div.classList.add('hidden');
})
return div; return div;
} }
@@ -283,7 +292,7 @@ export class SearchProductDevis extends HTMLButtonElement {
} }
fillFormLine(product) { fillFormLine(product) {
const row = this.closest('.form-repeater__row'); let row = this.parentElement.parentElement.parentElement.parentElement.parentElement
if (row) { if (row) {
const nameInput = row.querySelector('input[name*="[product]"]'); const nameInput = row.querySelector('input[name*="[product]"]');
const priceInput = row.querySelector('input[name*="[price_ht]"]'); const priceInput = row.querySelector('input[name*="[price_ht]"]');