formulario de items en por tipo de factura: exportaciones y reparaciones de exportacion

This commit is contained in:
2026-03-17 09:26:52 -05:00
parent 63cbdf2124
commit d178ea34fa
2 changed files with 107 additions and 77 deletions

View File

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