feat: convert operation_type from string to number for existing invoices
This commit is contained in:
@@ -24,8 +24,14 @@
|
|||||||
if (!formData) {
|
if (!formData) {
|
||||||
if (invoice) {
|
if (invoice) {
|
||||||
// Editando una factura existente
|
// 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 = {
|
formData = {
|
||||||
operation_type: invoice.operation_type || null,
|
operation_type: operationType,
|
||||||
invoice_type: invoice.invoice_type || '',
|
invoice_type: invoice.invoice_type || '',
|
||||||
invoice_number: invoice.invoice_number || '',
|
invoice_number: invoice.invoice_number || '',
|
||||||
invoice_date: invoice.invoice_date || '',
|
invoice_date: invoice.invoice_date || '',
|
||||||
|
|||||||
Reference in New Issue
Block a user