From 0f50ae3d617f6710a91617b83df00fc1ee776e4c Mon Sep 17 00:00:00 2001 From: Kevin_Ramirez Date: Mon, 9 Feb 2026 17:39:24 -0600 Subject: [PATCH 1/6] Cambio parcial en el formulario de invoices --- .../src/lib/api/dashboard/a76/invoices.ts | 3 + .../invoices/edit/general-tab-form.svelte | 1299 +++++++++-------- .../invoices/edit/items/items-tab-form.svelte | 188 ++- .../edit/observations-tab-form.svelte | 683 ++++++--- .../dashboard/invoices/edit/save-invoice.ts | 31 +- .../dashboard/invoices/edit/[id]/+page.svelte | 85 +- 6 files changed, 1411 insertions(+), 878 deletions(-) diff --git a/frontend/src/lib/api/dashboard/a76/invoices.ts b/frontend/src/lib/api/dashboard/a76/invoices.ts index 91cc735e..b2a855c0 100644 --- a/frontend/src/lib/api/dashboard/a76/invoices.ts +++ b/frontend/src/lib/api/dashboard/a76/invoices.ts @@ -103,6 +103,7 @@ export interface InvoiceFinancials { insurance_value?: number | null; packaging?: number | null; other_increments?: number | null; + other_deductibles?: number | null; total_increments_mn?: number | null; total_increments_me?: number | null; iva_mn?: number | null; @@ -158,6 +159,8 @@ export interface InvoiceLogistics { payment_date?: string | null; payment_receipt_num?: string | null; is_ctm_process?: string | null; + is_subdivision?: boolean | null; + acts_as_cd?: boolean | null; } export interface InvoiceSalesDetails { 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 ba02ac9a..0b8ff489 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 @@ -1,4 +1,4 @@ -
-
-
+
+

Items de la Factura

@@ -710,49 +717,89 @@
- Línea - P/S - Clase - Descripcion Clase - Cant. Importada - U.M. - Preferencia - Contiene Subpartida - Partida Principal - Acciones + {#if operationType === 1} + Línea + Factura Impo + Lin Impo + P/S + Cant. Exportada + Clase + Num Parte + Descripción Esp. + Subpartidas + Partida Princ. + {:else} + Línea + P/S + Clase + Descripcion Clase + Cant. Importada + U.M. + Preferencia + Contiene Subpartida + Partida Principal + {/if} + Acciones {#if displayedItems.length === 0} - + No hay items disponibles {:else} {#each displayedItems as item (item.id)} - - {item.line_number} - {item.is_subitem ? 'S' : 'P'} - {item.class_code || '-'} - {item.class_description || '-'} - {item.quantity?.quantity || '0'} - {item.unit_of_measure_code || '-'} - {item.reference_number || '-'} - {item.fa_data?.contains_subitems ? 'Sí' : 'No'} - {item.warehouse || '-'} + handleRowClick(item)} + class="cursor-pointer transition-colors hover:bg-muted/50 {focusedLine?.id === + item.id + ? 'bg-muted ring-1 ring-primary/20 ring-inset' + : ''}" + > + {#if operationType === 1} + {item.line_number} + {item.fa_data?.search_invoice || '-'} + {item.fa_data?.search_line || '-'} + {item.is_subitem ? 'S' : 'P'} + {item.quantity?.quantity || '0'} + {item.class_code || '-'} + {item.part_number || '-'} + + {item.description?.description_spanish || '-'} + + {item.fa_data?.contains_subitems ? 'Sí' : 'No'} + {item.warehouse || '-'} + {:else} + {item.line_number} + {item.is_subitem ? 'S' : 'P'} + {item.class_code || '-'} + {item.class_description || '-'} + {item.quantity?.quantity || '0'} + {item.unit_of_measure_code || '-'} + {item.reference_number || '-'} + {item.fa_data?.contains_subitems ? 'Sí' : 'No'} + {item.warehouse || '-'} + {/if}
@@ -760,7 +807,7 @@ {/each} {#if isLoadingMore} - + Cargando más items... @@ -771,43 +818,66 @@
{#if flattenedLines.length > 0} -
+
Mostrando {displayedItems.length} de {flattenedLines.length} líneas
{/if}
-
-
-

Cantidades:

-
-
-
- Partidas: {items.length || 0} -
-
- Bultos: 0 -
+
+ {#if operationType === 1} + +
+

+ Descripción en español: +

+
+ {#if focusedLine} +

+ {focusedLine.description?.description_spanish || 'Sin descripción disponible.'} +

+ {:else} +

+ Selecciona una fila para ver la descripción. +

+ {/if}
- Importada:{imported || 0}
- Peso neto: {net_weight || 0}
- Peso bruto: {gross_weight || 0}
+ {/if} + + +
+
+

Cantidades:

+
+
+
+ Partidas: {items.length || 0} +
+
+ Bultos: 0 +
+
+
+ Importada:{imported || 0}
+ Peso neto: {net_weight || 0}
+ Peso bruto: {gross_weight || 0}
+
+ +

+ Valores de importacion: +

+ Dolares:0 USD
+ Pesos: 0 MXN
+ De Captura: 0 USD + +

+ spacer +

+ + Aduana:0 USD
+ Aduana: 0 MXN
- -

- Valores de importacion: -

- Dolares:0 USD
- Pesos: 0 MXN
- De Captura: 0 USD - -

- spacer -

- - Aduana:0 USD
- Aduana: 0 MXN
@@ -850,7 +920,7 @@