diff --git a/frontend/src/lib/components/dashboard/invoices/edit/items/fa/tab-labeling.svelte b/frontend/src/lib/components/dashboard/invoices/edit/items/fa/tab-labeling.svelte index 997558ea..bc9d3eb9 100644 --- a/frontend/src/lib/components/dashboard/invoices/edit/items/fa/tab-labeling.svelte +++ b/frontend/src/lib/components/dashboard/invoices/edit/items/fa/tab-labeling.svelte @@ -80,99 +80,103 @@ } -
- -
- Labeling & Valuation - - {#if visibility.showLabelingStandard} +
+ {#if visibility.showLabelingLeftSection} + +
+ Labeling & Valuation + + {#if visibility.showLabelingStandard} +
+
+ + +
+
+ + +
+
+ {/if} +
-
- - -
-
- - -
+ {#if visibility.showLabelingEnhanced} + {#if visibility.showLabelingQuantity} +
+ + +
+ {/if} + {#if visibility.showLabelingValuationValue} +
+ + +
+ {/if} + {/if}
- {/if} -
{#if visibility.showLabelingEnhanced} - {#if visibility.showLabelingQuantity} + {#if visibility.showLabelingValuationMethod}
- - + +
+ + +
{/if} - {#if visibility.showLabelingValuationValue} + + {#if visibility.showUsageReason}
- +
{/if} {/if} -
- {#if visibility.showLabelingEnhanced} -
- -
- - -
-
- {#if visibility.showUsageReason} + {#if visibility.showLabelingObservations}
- - + +
{/if} - {/if} - - - {#if visibility.showLabelingObservations} -
- - -
- {/if} -
+
+ {/if} {#if visibility.showLabelingEnhanced} diff --git a/frontend/src/lib/config/invoice-item-visibility.ts b/frontend/src/lib/config/invoice-item-visibility.ts index c1f702f9..d040537d 100644 --- a/frontend/src/lib/config/invoice-item-visibility.ts +++ b/frontend/src/lib/config/invoice-item-visibility.ts @@ -47,6 +47,10 @@ export interface InvoiceItemVisibility { showLabelingObservations: boolean; /** Etiquetado tab: Valuation field (Valor Det). */ showLabelingValuationValue: boolean; + /** Etiquetado tab: Valuation Method selector. */ + showLabelingValuationMethod: boolean; + /** Etiquetado tab: Whole left section (Legend + all fields). */ + showLabelingLeftSection: boolean; } const defaultVisibility: InvoiceItemVisibility = { @@ -74,7 +78,9 @@ const defaultVisibility: InvoiceItemVisibility = { showLabelingStandard: true, showLabelingQuantity: false, showLabelingObservations: true, - showLabelingValuationValue: false + showLabelingValuationValue: false, + showLabelingValuationMethod: true, + showLabelingLeftSection: true }; function normalizeInvoiceType(invoiceType?: string | null): string { @@ -130,8 +136,27 @@ export function getVisibility( const expVisibility: InvoiceItemVisibility = { ...defaultVisibility, showExportLinkToImportBlock: true, - showExportValuationFields: true + showExportValuationFields: true, + showLabelingEnhanced: true, + showUsageReason: true, + showLabelingValuationValue: true, + showLabelingStandard: false, + showLabelingObservations: false, + showLabelingQuantity: false }; + + // CHECK FOR EXPORT REPAIR (REP / REPAR) + const upInvoiceType = normalizeInvoiceType(invoiceType); + if (upInvoiceType === 'REP' || upInvoiceType === 'REPAR') { + return { + ...expVisibility, + showLabelingValuationMethod: false, + showLabelingValuationValue: false, + showUsageReason: false, + showLabelingLeftSection: false + }; + } + // Per-type overrides can be added here (e.g. hide valuation for SCRAP). switch (exportType) { case 'NODES': @@ -193,7 +218,8 @@ export function getVisibility( showLabelingQuantity: true, showLabelingStandard: true, showLabelingObservations: false, - showLabelingValuationValue: false + showLabelingValuationValue: false, + showLabelingValuationMethod: true }; case 'MEX':