Refactor invoice status labels and update navigation toast functionality

This commit is contained in:
javiermengual 2026-02-11 13:56:28 +01:00
parent 4719bf61e3
commit 23c79cc7e4
6 changed files with 429 additions and 414 deletions

View File

@ -20,7 +20,7 @@ export function InvoiceItem(invoice, onView) {
const getStatusClass = (status) => { const getStatusClass = (status) => {
const statusMap = { const statusMap = {
'draft': 'status-draft', 'draft': 'status-draft',
'validated': 'status-validated', 'validated': 'status-unpaid',
'paid': 'status-paid', 'paid': 'status-paid',
'unpaid': 'status-unpaid', 'unpaid': 'status-unpaid',
'canceled': 'status-canceled' 'canceled': 'status-canceled'
@ -32,9 +32,9 @@ export function InvoiceItem(invoice, onView) {
const getStatusText = (status) => { const getStatusText = (status) => {
const statusTextMap = { const statusTextMap = {
'draft': 'Borrador', 'draft': 'Borrador',
'validated': 'Validada', 'validated': 'Pte. Pago',
'paid': 'Pagada', 'paid': 'Pagada',
'unpaid': 'Impagada', 'unpaid': 'Pte. Pago',
'canceled': 'Cancelada' 'canceled': 'Cancelada'
}; };
return statusTextMap[status] || status; return statusTextMap[status] || status;

View File

@ -39,9 +39,9 @@ export function InvoiceModal(invoiceId, onClose, onUpdate) {
const getStatusText = (status) => { const getStatusText = (status) => {
const statusTextMap = { const statusTextMap = {
'draft': 'Borrador', 'draft': 'Borrador',
'validated': 'Validada', 'validated': 'Pte. Pago',
'paid': 'Pagada', 'paid': 'Pagada',
'unpaid': 'Impagada', 'unpaid': 'Pte. Pago',
'canceled': 'Cancelada' 'canceled': 'Cancelada'
}; };
return statusTextMap[status] || status; return statusTextMap[status] || status;
@ -144,14 +144,14 @@ export function InvoiceModal(invoiceId, onClose, onUpdate) {
<div class="form-row"> <div class="form-row">
<div class="form-group full-width"> <div class="form-group full-width">
<label>Nota Pública</label> <label>Nota Pública</label>
<textarea name="note_public" rows="3">${invoice.note_public || ''}</textarea> <textarea name="note_public" rows="3">${invoice.notePublic || ''}</textarea>
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group full-width"> <div class="form-group full-width">
<label>Nota Privada</label> <label>Nota Privada</label>
<textarea name="note_private" rows="3">${invoice.note_private || ''}</textarea> <textarea name="note_private" rows="3">${invoice.notePrivate || ''}</textarea>
</div> </div>
</div> </div>
</div> </div>

View File

@ -24,9 +24,8 @@ export function renderFacturasPage() {
<select class="filter-status"> <select class="filter-status">
<option value="">Todos los estados</option> <option value="">Todos los estados</option>
<option value="draft">Borrador</option> <option value="draft">Borrador</option>
<option value="unpaid">Pte. Pago</option>
<option value="paid">Pagada</option> <option value="paid">Pagada</option>
<option value="unpaid">Impagada</option>
<option value="canceled">Cancelada</option>
</select> </select>
<button class="btn-new-invoice">+ Nueva Factura</button> <button class="btn-new-invoice">+ Nueva Factura</button>
</div> </div>

View File

@ -95,7 +95,9 @@
/* ============================================ /* ============================================
Reset & Base Reset & Base
============================================ */ ============================================ */
*, *::before, *::after { *,
*::before,
*::after {
box-sizing: border-box; box-sizing: border-box;
} }
@ -115,7 +117,12 @@ a:hover {
color: var(--primary-hover); color: var(--primary-hover);
} }
h1, h2, h3, h4, h5, h6 { h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0; margin: 0;
font-weight: 600; font-weight: 600;
line-height: 1.3; line-height: 1.3;
@ -123,9 +130,17 @@ h1, h2, h3, h4, h5, h6 {
letter-spacing: -0.01em; letter-spacing: -0.01em;
} }
h1 { font-size: 1.5rem; } h1 {
h2 { font-size: 1.25rem; } font-size: 1.5rem;
h3 { font-size: 1rem; } }
h2 {
font-size: 1.25rem;
}
h3 {
font-size: 1rem;
}
#app { #app {
width: 100%; width: 100%;
@ -1622,6 +1637,7 @@ button:disabled {
} }
@media (max-width: 1024px) { @media (max-width: 1024px) {
.clientes-page, .clientes-page,
.facturas-page { .facturas-page {
padding: var(--space-4); padding: var(--space-4);