From fa70b747ecea7a2a67d8bbfdb1e3391c64c2a05e Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Fri, 19 Dec 2025 11:30:47 -0600 Subject: [PATCH] feat: convert operation_type from string to number for existing invoices --- .../dashboard/invoices/edit/general-tab-form.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/dashboard/invoices/edit/general-tab-form.svelte b/frontend/src/lib/components/dashboard/invoices/edit/general-tab-form.svelte index 42f9cba2..37940c56 100644 --- a/frontend/src/lib/components/dashboard/invoices/edit/general-tab-form.svelte +++ b/frontend/src/lib/components/dashboard/invoices/edit/general-tab-form.svelte @@ -24,8 +24,14 @@ if (!formData) { if (invoice) { // Editando una factura existente + // Convertir operation_type de string ('imp'/'exp') a nĂºmero (1/2) + let operationType: number | null = null; + if (invoice.operation_type) { + operationType = invoice.operation_type === 'exp' ? 1 : 2; + } + formData = { - operation_type: invoice.operation_type || null, + operation_type: operationType, invoice_type: invoice.invoice_type || '', invoice_number: invoice.invoice_number || '', invoice_date: invoice.invoice_date || '',