diff --git a/frontend/src/lib/components/dashboard/csv-upload/CsvParamsBar.svelte b/frontend/src/lib/components/dashboard/csv-upload/CsvParamsBar.svelte new file mode 100644 index 00000000..45c640e8 --- /dev/null +++ b/frontend/src/lib/components/dashboard/csv-upload/CsvParamsBar.svelte @@ -0,0 +1,124 @@ + + + +
diff --git a/frontend/src/lib/config/csv-upload.ts b/frontend/src/lib/config/csv-upload.ts index 8c7420ec..f665a1d4 100644 --- a/frontend/src/lib/config/csv-upload.ts +++ b/frontend/src/lib/config/csv-upload.ts @@ -44,6 +44,80 @@ export interface CsvUploadField { defaultValue?: any; } +/** Global parameters shown in the CSV upload footer bar (one option or the other via select). */ +export interface GlobalCsvParam { + name: string; + label: string; + type: 'select'; + options: { label: string; value: string }[]; + defaultValue: string; +} + +/** Global parameters for all CSV loads; merged with tab-specific settings when sending footer_config. */ +export const globalCsvParams: GlobalCsvParam[] = [ + { + name: 'mode', + label: 'Modo de Carga', + type: 'select', + options: [ + { label: 'Actualizar', value: 'update' }, + { label: 'Reemplazar', value: 'replace' } + ], + defaultValue: 'update' + }, + { + name: 'dateFormat', + label: 'Formato de Fecha', + type: 'select', + options: [ + { label: 'DD/MM/YYYY', value: 'dd/mm/yyyy' }, + { label: 'MM/DD/YYYY', value: 'mm/dd/yyyy' }, + { label: 'YYYY-MM-DD', value: 'yyyy-mm-dd' } + ], + defaultValue: 'dd/mm/yyyy' + }, + { + name: 'weight_unit', + label: 'Unidad de Peso', + type: 'select', + options: [ + { label: 'Kilos (Kgs)', value: 'kgs' }, + { label: 'Libras (Lbs)', value: 'lbs' } + ], + defaultValue: 'kgs' + }, + { + name: 'autonumber_series', + label: 'Autonumerar Partidas/Series', + type: 'select', + options: [ + { label: 'Sí', value: 'true' }, + { label: 'No', value: 'false' } + ], + defaultValue: 'false' + }, + { + name: 'load_subpartidas', + label: 'Levantar Subpartidas', + type: 'select', + options: [ + { label: 'Sí', value: 'true' }, + { label: 'No', value: 'false' } + ], + defaultValue: 'false' + }, + { + name: 'recalculate_pedimento_date', + label: 'Recalcular Fecha Pedimento', + type: 'select', + options: [ + { label: 'Sí', value: 'true' }, + { label: 'No', value: 'false' } + ], + defaultValue: 'false' + } +]; + // Map of Tab ID -> Array of Fields export const tabSettings: Record