From 7585cedd3e9eb366e863e7da0a493a67fff22642 Mon Sep 17 00:00:00 2001 From: Galindo97 Date: Wed, 24 Dec 2025 09:10:10 -0600 Subject: [PATCH] feat: add partidas tab form component with CRUD functionality - Implemented the partidas tab form in Svelte for managing partidas. - Added functionality to create, edit, delete, and list partidas. - Integrated a dialog for adding and editing partidas with validation. - Included a checkbox component for selecting partidas. - Added total calculations for partidas in the UI. - Enhanced UI with buttons for various actions and a responsive table layout. --- .../general_catalogs/exchange_rate/routes.py | 2 +- .../lib/api/dashboard/a76/exchange-rate.ts | 18 +- .../src/lib/api/dashboard/a76/pedimentos.ts | 52 +- .../edit/bultos-transportes-tab-form.svelte | 1117 +++++++++++ .../edit/contribuciones-tab-form.svelte | 547 ++++++ .../edit/cuentas-compensacion-tab-form.svelte | 632 ++++++ .../pedimentos/edit/dates-tab-form.svelte | 138 +- .../pedimentos/edit/descargas-tab-form.svelte | 495 +++++ .../edit/digitalizacion-tab-form.svelte | 414 ++++ .../pedimentos/edit/facturas-tab-form.svelte | 530 +++++ .../pedimentos/edit/general-tab-form.svelte | 586 +++++- .../edit/otros-datos-tab-form.svelte | 1709 +++++++++++++++++ .../pedimentos/edit/partidas-tab-form.svelte | 543 ++++++ .../components/ui/checkbox/checkbox.svelte | 36 + .../src/lib/components/ui/checkbox/index.ts | 6 + .../pedimentos/edit/[id]/+page.svelte | 436 +++-- 16 files changed, 6971 insertions(+), 290 deletions(-) create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/bultos-transportes-tab-form.svelte create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/contribuciones-tab-form.svelte create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/cuentas-compensacion-tab-form.svelte create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/descargas-tab-form.svelte create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/digitalizacion-tab-form.svelte create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/facturas-tab-form.svelte create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/otros-datos-tab-form.svelte create mode 100644 frontend/src/lib/components/dashboard/pedimentos/edit/partidas-tab-form.svelte create mode 100644 frontend/src/lib/components/ui/checkbox/checkbox.svelte create mode 100644 frontend/src/lib/components/ui/checkbox/index.ts diff --git a/backend/api/v1/modules/a76/general_catalogs/exchange_rate/routes.py b/backend/api/v1/modules/a76/general_catalogs/exchange_rate/routes.py index 99f0b786..546ead36 100644 --- a/backend/api/v1/modules/a76/general_catalogs/exchange_rate/routes.py +++ b/backend/api/v1/modules/a76/general_catalogs/exchange_rate/routes.py @@ -14,7 +14,7 @@ router = TenantCRUDRoutes( resource_name="Exchange Rate", id_name="id", # Using numeric ID enable_list=True, # Enable GET /exchange-rate with pagination - enable_filters=True, # Enable filtering by date, local_currency, foreign_currency + enable_filters=False, default_page_size=50, max_page_size=100, ).router diff --git a/frontend/src/lib/api/dashboard/a76/exchange-rate.ts b/frontend/src/lib/api/dashboard/a76/exchange-rate.ts index d7843807..81b14e90 100644 --- a/frontend/src/lib/api/dashboard/a76/exchange-rate.ts +++ b/frontend/src/lib/api/dashboard/a76/exchange-rate.ts @@ -24,16 +24,20 @@ export interface ExchangeRateListResponse { /** * Get exchange rate by date */ -export async function getExchangeRateByDate(date: string): Promise { +export async function getExchangeRateByDate(date: string, companyId: number): Promise { try { - // Convert date to ISO format with time for backend datetime field - const dateWithTime = `${date}T00:00:00`; - const response = await api.get(`/v1/a76/exchange-rate?date=${dateWithTime}`); + // Get all exchange rates and filter by date on client side + const response = await api.get(`/v1/a76/exchange-rate/?company_id=${companyId}`); if (response.data && response.data.items && response.data.items.length > 0) { - // Find USD exchange rate - const usdRate = response.data.items.find(rate => rate.foreign_currency === 'USD'); - return usdRate || null; + // Filter by date and find USD exchange rate + const dateOnly = date.split('T')[0]; // Get YYYY-MM-DD part + const matchingRates = response.data.items.filter(rate => { + const rateDate = rate.date.split('T')[0]; + return rateDate === dateOnly && rate.foreign_currency === 'USD'; + }); + + return matchingRates.length > 0 ? matchingRates[0] : null; } return null; diff --git a/frontend/src/lib/api/dashboard/a76/pedimentos.ts b/frontend/src/lib/api/dashboard/a76/pedimentos.ts index 175c9a79..fea0001e 100644 --- a/frontend/src/lib/api/dashboard/a76/pedimentos.ts +++ b/frontend/src/lib/api/dashboard/a76/pedimentos.ts @@ -50,6 +50,41 @@ export interface PedimentoValidation { responsible_id?: number | null; } +export interface PedimentoIncrementables { + insured_value?: number | null; + packaging?: number | null; + freight?: number | null; + deductibles?: number | null; + currency?: string | null; + not_affect_usd_value?: number | null; + not_affect_customs_value?: number | null; +} + +export interface PedimentoDecrementables { + freight?: number | null; + insurance?: number | null; + loading?: number | null; + unloading?: number | null; + others?: number | null; + currency?: string | null; + not_affect_usd_value?: number | null; +} + +export interface PedimentoIndexes { + update_factor_type?: number | null; + update_factor?: number | null; + manual_update_factor?: number | null; +} + +export interface PedimentoConfigAdditional { + manual_pedimento_year?: string | null; + add_po_identifier?: number | null; + do_not_exempt_norms_complement_x?: number | null; + enable_import_invoice_recipient?: number | null; + send_502_validation_file_for_consolidated?: number | null; + add_remove_norms?: number | null; +} + export interface Pedimento { id: number; tenant_id: number; @@ -67,12 +102,17 @@ export interface Pedimento { paid_price?: number | null; gross_weight?: number | null; exchange_rate?: number | null; + observaciones?: string | null; created_at: string; // Sub-resources pedimento_dates?: PedimentoDates | null; pedimento_payments?: PedimentoPayments | null; pedimento_transport_means?: PedimentoTransportMeans | null; - pedimento_validation?: PedimentoValidation | null; + pedimento_validation?: PedimentoValidation | null; + pedimento_incrementables?: PedimentoIncrementables | null; + pedimento_decrementables?: PedimentoDecrementables | null; + pedimento_indexes?: PedimentoIndexes | null; + pedimento_config_additional?: PedimentoConfigAdditional | null; } export interface PedimentoListResponse { @@ -97,11 +137,16 @@ export interface CreatePedimentoData { paid_price?: number | null; gross_weight?: number | null; exchange_rate?: number | null; + observaciones?: string | null; // Sub-resources pedimento_dates?: PedimentoDates | null; pedimento_payments?: PedimentoPayments | null; pedimento_transport_means?: PedimentoTransportMeans | null; pedimento_validation?: PedimentoValidation | null; + pedimento_incrementables?: PedimentoIncrementables | null; + pedimento_decrementables?: PedimentoDecrementables | null; + pedimento_indexes?: PedimentoIndexes | null; + pedimento_config_additional?: PedimentoConfigAdditional | null; } export interface UpdatePedimentoData { @@ -119,11 +164,16 @@ export interface UpdatePedimentoData { paid_price?: number | null; gross_weight?: number | null; exchange_rate?: number | null; + observaciones?: string | null; // Sub-resources pedimento_dates?: PedimentoDates | null; pedimento_payments?: PedimentoPayments | null; pedimento_transport_means?: PedimentoTransportMeans | null; pedimento_validation?: PedimentoValidation | null; + pedimento_incrementables?: PedimentoIncrementables | null; + pedimento_decrementables?: PedimentoDecrementables | null; + pedimento_indexes?: PedimentoIndexes | null; + pedimento_config_additional?: PedimentoConfigAdditional | null; } export interface PedimentoFilters { diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/bultos-transportes-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/bultos-transportes-tab-form.svelte new file mode 100644 index 00000000..eb469557 --- /dev/null +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/bultos-transportes-tab-form.svelte @@ -0,0 +1,1117 @@ + + + + + +
+ +
+ + + + Bultos + + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + + + Transportes + + +
+ + + + Identificación + País + Acciones + + + + {#if !formData?.transportes || formData.transportes.length === 0} + + + No hay transportes registrados + + + {:else} + {#each formData.transportes as transporte, index} + + {transporte.identificacion} + {transporte.pais} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+
+ + + + +
+
+
+
+ + + + + Guías + + +
+ + + + Guía + Identificador + Acciones + + + + {#if !formData?.guias || formData.guias.length === 0} + + + No hay guías registradas + + + {:else} + {#each formData.guias as guia, index} + + {guia.guia} + {guia.identificador} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+
+ + + +
+
+
+ + +
+ + + + Transportes, Precintos + + +
+ + + + Número + Identificación + Acciones + + + + {#if !formData?.precintos || formData.precintos.length === 0} + + + No hay precintos registrados + + + {:else} + {#each formData.precintos as precinto, index} + + {precinto.numero} + {precinto.identificacion} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+
+ + + +
+
+
+ + + + + Contenedores + + +
+ + + + Número + Identificación + Tipo + Acciones + + + + {#if !formData?.contenedores || formData.contenedores.length === 0} + + + No hay contenedores registrados + + + {:else} + {#each formData.contenedores as contenedor, index} + + {contenedor.numero} + {contenedor.identificacion} + {contenedor.tipo} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+
+ + + + + +
+
+
+
+
+ + + + + + Transportes del Pedimento + + +
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+
+ + +
+
+ + v && (currentTransporte.estado = v)} + > + + {currentTransporte.estado || 'Seleccionar estado'} + + + {#each estadosMexico as estado} + {estado} + {/each} + + +
+
+ +
+ +
+ + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + + +
+
+ + + + + + + {editingPrecintoIndex !== null ? 'Editar Precinto' : 'Nuevo Precinto'} + + + +
+
+ + +
+ +
+ + +
+
+ + + + + +
+
+ + + + + + + {editingContenedorIndex !== null ? 'Editar Contenedor' : 'Nuevo Contenedor'} + + + +
+
+ + +
+ +
+ + v && (currentContenedor.tipo = v)} + > + + {currentContenedor.tipo || 'Seleccionar tipo'} + + + {#each tiposContenedor as tipo} + {tipo} + {/each} + + +
+
+ + + + + +
+
+ + + (isTransportesPrecintosDialogOpen = open)}> + + + Transportes y Precintos + +
+ +
+

Listado de transportes separados por comas

+
+
+ + + +
+
+ + +
+
+
+ + +
+

Listado de precintos separados por comas

+
+ + +
+
+
+ + + + +
+
+ + + (isGuiasDialogOpen = open)}> + + + Guías de Pedimento + +
+
+ + +
+ +
+ + v && (currentGuia.identificador = v)} + > + + {currentGuia.identificador || 'Seleccionar identificador'} + + + Maestra + + +
+
+ + + + + +
+
diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/contribuciones-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/contribuciones-tab-form.svelte new file mode 100644 index 00000000..4b4b3827 --- /dev/null +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/contribuciones-tab-form.svelte @@ -0,0 +1,547 @@ + + + + + +
+ + + + + +
+ + +
+ {#if activeTab === 'DTA'} +
+
+ + +
+
+ + +

(dejar en cero para calcular automático)

+
+
+ + +

(dejar en cero para calcular automático)

+
+
+ {:else if activeTab === 'PREV'} +
+
+ + +
+
+ {:else if activeTab === 'ECI'} +
+
+ + +
+
+ + +

+ (dejar en cero para que el sistema calcule el importe) +

+
+
+ {:else if activeTab === 'MULT'} +
+
+ + +
+
+ + +
+
+ {:else if activeTab === 'REC'} +
+
+ + +
+
+ + +
+
+ {/if} +
+ + +
+ + + + Contribución + T.T. + Tasa + F.P. + Importe + Gravamen + Abreviación + F.P. + Importe + Acciones + + + + {#if !formData?.contribuciones || formData.contribuciones.length === 0} + + + No hay contribuciones registradas + + + {:else} + {#each formData.contribuciones as contribucion, index} + + {contribucion.contribucion} + {contribucion.tipo_tasa} + {contribucion.tasa.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 5 + })} + {contribucion.forma_pago} + {contribucion.importe.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + {contribucion.gravamen} + {contribucion.abreviacion} + {contribucion.forma_pago_2} + {contribucion.importe_2.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ + +
+
+
+ + formData && (formData.calculo_manual = checked === true)} + /> + +
+ +
+ + formData && (formData.operaciones_regla_31_40 = checked === true)} + /> + +
+
+ +
+ + + +
+
+
+
+ + + + + + + {editingIndex !== null ? 'Editar Contribución' : 'Nueva Contribución'} + + + +
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+
+ + + + + +
+
diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/cuentas-compensacion-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/cuentas-compensacion-tab-form.svelte new file mode 100644 index 00000000..bf791baa --- /dev/null +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/cuentas-compensacion-tab-form.svelte @@ -0,0 +1,632 @@ + + +
+ + + +
+ + + + Institución Emisora + Número Contrato + Total Garantía + Folio Constancia + Fecha Constancia + UM + Valor Unitario + Acciones + + + + {#if !formData?.cuentas_garantia || formData.cuentas_garantia.length === 0} + + + No hay cuentas de garantía registradas + + + {:else} + {#each formData.cuentas_garantia as cuenta, index} + + {cuenta.institucion_emisora} + {cuenta.numero_contrato} + {cuenta.total_garantia.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + {cuenta.folio_constancia} + {cuenta.fecha_constancia} + {cuenta.um} + {cuenta.valor_unitario.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ +
+ + + +
+
+
+ + +
+ + + + Compensaciones + + +
+ + + + Patente Original + Pedimento Original + Acciones + + + + {#if !formData?.compensaciones || formData.compensaciones.length === 0} + + + No hay compensaciones registradas + + + {:else} + {#each formData.compensaciones as compensacion, index} + + {compensacion.patente_original} + {compensacion.pedimento_original} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ +
+ + + +
+
+
+ + + + + Documentos que amparan las Formas de Pago + + +
+ + + + Forma de Pago + Dependencia + Acciones + + + + {#if !formData?.documentos_pago || formData.documentos_pago.length === 0} + + + No hay documentos registrados + + + {:else} + {#each formData.documentos_pago as documento, index} + + {documento.forma_pago} + {documento.dependencia} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ +
+ + + +
+
+
+
+
+ + + + + + + {editingCuentaIndex !== null ? 'Editar Cuenta Garantía' : 'Nueva Cuenta Garantía'} + + + +
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + + + +
+
+ + + + + + + {editingCompensacionIndex !== null ? 'Editar Compensación' : 'Nueva Compensación'} + + + +
+
+ + +
+ +
+ + +
+
+ + + + + +
+
+ + + + + + + {editingDocumentoIndex !== null ? 'Editar Documento' : 'Nuevo Documento'} + + + +
+
+ + +
+ +
+ + +
+
+ + + + + +
+
diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte index 106ca429..070c664b 100644 --- a/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte @@ -1,107 +1,83 @@ - Fechas del Pedimento + Observaciones - Gestiona las fechas importantes del pedimento + Agrega notas y observaciones sobre el pedimento -
-
- -
- - +
+ +
+
+
+ Tipo de Pedimento: + {tipoPedimentoNombre}
- - -
- - -
- - -
- - -
- - -
- - -
+ {#if pedimentoNumber} +
+ Número de Pedimento: + {pedimentoNumber} +
+ {/if}
- - \ No newline at end of file + +
+ + +
+
+ + \ No newline at end of file diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/descargas-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/descargas-tab-form.svelte new file mode 100644 index 00000000..7695298b --- /dev/null +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/descargas-tab-form.svelte @@ -0,0 +1,495 @@ + + +
+ + + + Descargos + + +
+ + + + Patente + Pedimento + Aduana + Clave + Fecha Pago + Fracción + UMT + Cantidad Tarifa + Acciones + + + + {#if !formData?.descargos || formData.descargos.length === 0} + + + No hay descargos registrados + + + {:else} + {#each formData.descargos as descargo, index} + + {descargo.patente} + {descargo.pedimento} + {descargo.aduana} + {descargo.clave} + {descargo.fecha_pago} + {descargo.fraccion} + {descargo.umt} + {descargo.cantidad_tarifa.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ +
+ + + + + +
+
+
+ + + + + Destinatarios + + +
+ + + + Clave + Identificación Fiscal + Nombre + Acciones + + + + {#if !formData?.destinatarios || formData.destinatarios.length === 0} + + + No hay destinatarios registrados + + + {:else} + {#each formData.destinatarios as destinatario, index} + + {destinatario.clave} + {destinatario.identificacion_fiscal} + {destinatario.nombre} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ +
+ + + +
+
+
+
+ + + + + + + {editingDescargoIndex !== null ? 'Editar Descargo' : 'Nuevo Descargo'} + + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + + + +
+
+ + + + + + + {editingDestinatarioIndex !== null ? 'Editar Destinatario' : 'Nuevo Destinatario'} + + + +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+
diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/digitalizacion-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/digitalizacion-tab-form.svelte new file mode 100644 index 00000000..689ee413 --- /dev/null +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/digitalizacion-tab-form.svelte @@ -0,0 +1,414 @@ + + + + + +
+ + + + Línea + Clave + Documento + E-Document + Operación + Observaciones + Acciones + + + + {#if !formData?.digitalizaciones || formData.digitalizaciones.length === 0} + + + No hay digitalizaciones registradas + + + {:else if paginatedDigitalizaciones.length === 0} + + + No hay datos en esta página + + + {:else} + {#each paginatedDigitalizaciones as digitalizacion, index} + + {digitalizacion.linea} + {digitalizacion.clave} + {digitalizacion.documento} + {digitalizacion.e_document} + {digitalizacion.operacion} + + {digitalizacion.observaciones} + + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ + + {#if formData?.digitalizaciones && formData.digitalizaciones.length > 0} +
+ + + + Página {currentPage + 1} de {totalPages || 1} + + + +
+ {/if} + + +
+ + + + + + + + + +
+
+
+ + + + + + + {editingIndex !== null ? 'Editar Digitalización' : 'Nueva Digitalización'} + + + +
+
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + + {/if} + + + {#if showNotas} + + + Notas del Pedimento + + + +
+ + + + Usuario + Creada + Comentario + + + + Fecha + Hora + + + + + {#if notasPedimento.length === 0} + + + No hay notas registradas + + + {:else} + {#each visibleNotas as nota} + + {nota.usuario} + {nota.fecha} + {nota.hora} + {nota.comentario} + + {/each} + {/if} + +
+
+ + +
+
+ + + + Página {currentNotasPage + 1} de {totalNotasPages || 1} + + + +
+
+ + +
+ + + +
+
+
+ {/if} + + + {#if showSeleccionAutomatizada} + + + Selección Automatizada + + +
+
+ + +
+ +
+ + { + if (v) seleccionAutomatizadaFormData.primera_revision = v; + }} + > + + + {seleccionAutomatizadaFormData.primera_revision || 'Seleccionar'} + + + + Rojo + Verde + + +
+ +
+ + +
+ +
+ + { + if (v) seleccionAutomatizadaFormData.segunda_revision = v; + }} + > + + + {seleccionAutomatizadaFormData.segunda_revision || 'Seleccionar'} + + + + Rojo + Verde + + +
+ +
+ + +
+
+
+
+ {/if} + + + {#if showMultas} + + + Multas + + +
+ + { + if (v) multasFormData.cargo = v; + }} + > + + + {multasFormData.cargo || 'Seleccionar'} + + + + cargo oficina + cargo cliente + + +
+
+
+ {/if} +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/partidas-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/partidas-tab-form.svelte new file mode 100644 index 00000000..6e90abf8 --- /dev/null +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/partidas-tab-form.svelte @@ -0,0 +1,543 @@ + + + + + +
+ + + + + + + + +
+ + +
+ + + + Sel. + Línea + Fracción + Sub + Descripción + Tipo + Sector + Origen + Cant. Comercial + UMC + Dólares + Acciones + + + + {#if !formData?.partidas || formData.partidas.length === 0} + + + No hay partidas registradas. Haga clic en "Nuevo" para agregar una. + + + {:else} + {#each formData.partidas as partida, index} + + + toggleSelectPartida(index)} + /> + + {partida.linea} + {partida.fraccion} + {partida.sub} + + {partida.descripcion} + + {partida.tipo} + {partida.sector} + {partida.origen} + {partida.cantidad_comercial.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + {partida.umc} + {partida.dolares.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} + +
+ + +
+
+
+ {/each} + {/if} +
+
+
+ + +
+
+
+ Partidas: + {totalPartidas} +
+
+ Dólares: + {totalDolares.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} USD +
+
+ Pesos: + 0.00 MXN +
+
+ Valor Comercial: + 0.00 +
+
+ +
+
+ Cant. UMC: + {totalCantidadComercial.toLocaleString('es-MX', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + })} +
+
+ Cant. UMT: + 0.00 +
+
+ Val Agreg. Pesos: + 0.00 MXN +
+
+ Val Agreg. Dólares: + 0.00 USD +
+
+
+ + +
+ + formData && (formData.convertir_uma_umc = checked === true)} + /> + +
+
+
+ + + + + + {editingIndex !== null ? 'Editar Partida' : 'Nueva Partida'} + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +