feat: convert operation_type from string to number for existing invoices

This commit is contained in:
AlexeerCT
2025-12-19 11:30:47 -06:00
parent f8fbfb0c4b
commit fa70b747ec

View File

@@ -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 || '',