Actualizar index.html
This commit is contained in:
16
index.html
16
index.html
@@ -926,14 +926,20 @@ lucide.createIcons();
|
|||||||
|
|
||||||
let itemsHtml = '';
|
let itemsHtml = '';
|
||||||
if (itemsArr.length > 0) {
|
if (itemsArr.length > 0) {
|
||||||
itemsHtml = itemsArr.map(item => `
|
itemsHtml = itemsArr.map(item => {
|
||||||
|
const priceNum = parseFloat(item.price) || 0;
|
||||||
|
const qtyNum = parseFloat(item.qty) || 0;
|
||||||
|
const subNum = priceNum * qtyNum;
|
||||||
|
const isZero = priceNum === 0;
|
||||||
|
|
||||||
|
return `
|
||||||
<tr style="page-break-inside: avoid;">
|
<tr style="page-break-inside: avoid;">
|
||||||
<td style="padding: 12px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155; text-align: justify; line-height: 1.5;">${item.concept.replace(/\n/g, '<br>')}</td>
|
<td style="padding: 12px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155; text-align: justify; line-height: 1.5;">${item.concept.replace(/\n/g, '<br>')}</td>
|
||||||
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155; text-align: center;">${item.qty}</td>
|
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155; text-align: center;">${isZero ? '' : item.qty}</td>
|
||||||
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155; text-align: right;">${parseFloat(item.price).toFixed(2)} €</td>
|
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155; text-align: right;">${isZero ? '' : priceNum.toFixed(2) + ' €'}</td>
|
||||||
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; font-weight: 700; color: #0f172a; text-align: right;">${(item.qty * item.price).toFixed(2)} €</td>
|
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; font-weight: 700; color: #0f172a; text-align: right;">${isZero ? '' : subNum.toFixed(2) + ' €'}</td>
|
||||||
</tr>
|
</tr>
|
||||||
`).join('');
|
`}).join('');
|
||||||
} else {
|
} else {
|
||||||
itemsHtml = `<tr>
|
itemsHtml = `<tr>
|
||||||
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155;">${budget.title || "Presupuesto General de Reparación"}</td>
|
<td style="padding: 8px 10px; border-bottom: 1px solid #e2e8f0; font-size: 12px; color: #334155;">${budget.title || "Presupuesto General de Reparación"}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user