From c5aab5e1fcd438f8958b6afdd2819ac040434cb6 Mon Sep 17 00:00:00 2001 From: javiermengual Date: Tue, 3 Feb 2026 16:55:40 +0100 Subject: [PATCH] Refactor invoice components for improved structure and styling --- src/components/InvoiceItem.js | 29 ++--- src/components/InvoiceModal.js | 19 ++- src/pages/Facturas.js | 47 ++++--- src/pages/pagesRegistry.js | 19 +-- src/style.css | 222 +++++++++++++++------------------ src/styles/modal.css | 1 + 6 files changed, 150 insertions(+), 187 deletions(-) diff --git a/src/components/InvoiceItem.js b/src/components/InvoiceItem.js index f79c2d7..275e0e8 100644 --- a/src/components/InvoiceItem.js +++ b/src/components/InvoiceItem.js @@ -1,5 +1,5 @@ export function InvoiceItem(invoice, onView) { - const item = document.createElement('div'); + const item = document.createElement('tr'); item.className = 'invoice-item'; // Formatear fecha @@ -41,27 +41,24 @@ export function InvoiceItem(invoice, onView) { }; item.innerHTML = /*html*/` -
- -
-
${invoice.number}
-
+ ${invoice.number} + ${getStatusText(invoice.status)} -
-
- 👤 + + + ${invoice.clientName || 'Sin nombre'} -
-
${formatDate(invoice.date)}
-
${formatCurrency(invoice.total)}
-
${formatCurrency(invoice.remainToPay)}
-
+ + ${formatDate(invoice.date)} + ${formatCurrency(invoice.total)} + ${formatCurrency(invoice.remainToPay)} + -
+ `; // Event listener para el botón de ver diff --git a/src/components/InvoiceModal.js b/src/components/InvoiceModal.js index c02febd..42f1bb2 100644 --- a/src/components/InvoiceModal.js +++ b/src/components/InvoiceModal.js @@ -138,20 +138,14 @@ export function InvoiceModal(invoiceId, onClose, onUpdate) {
- +
- +
@@ -239,7 +233,7 @@ export function InvoiceModal(invoiceId, onClose, onUpdate) {