Actualizar Honduras y dist validado para produccion
This commit is contained in:
@@ -67,6 +67,7 @@ export default function BambooCorrectionModal({
|
||||
if (country.code === 'TT') return 'Laurele Nicome-Jack';
|
||||
if (country.code === 'PA') return 'Delarys Peñalba';
|
||||
if (country.code === 'SV') return 'Carlos Antonio Malta Méndez';
|
||||
if (country.code === 'HN') return 'Melody Chang Blandin';
|
||||
return 'haguirre@gomezleemarketing.com';
|
||||
}, [country.code]);
|
||||
|
||||
|
||||
@@ -91,6 +91,13 @@ function getReconciliationUrl(countryCode: string) {
|
||||
);
|
||||
}
|
||||
|
||||
if (countryCode === 'HN') {
|
||||
return (
|
||||
(import.meta.env.VITE_N8N_HONDURAS_WEBHOOK_URL as string | undefined) ||
|
||||
'https://agenteit.digitalcompass.agency/webhook/nominahn-bamboo-test'
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
(import.meta.env.VITE_N8N_GUATEMALA_WEBHOOK_URL as string | undefined) ||
|
||||
(import.meta.env.VITE_N8N_WEBHOOK_URL as string | undefined) ||
|
||||
@@ -674,8 +681,19 @@ function detectPeriodFromPayrollFilename(fileName: string): Partial<DetectedPayr
|
||||
}
|
||||
}
|
||||
|
||||
// Honduras usa frecuentemente nombres compactos como "Nomina 7.1 2026 GLM HN"
|
||||
// y "Nomina 7.2 2026 GLM HN": el primer número es el mes y el segundo la quincena.
|
||||
const compactHnMatch = normalized.match(/\b(1[0-2]|[1-9])\s+(1|2)\s+(20\d{2})\b/);
|
||||
if (!month && compactHnMatch) {
|
||||
month = Number(compactHnMatch[1]);
|
||||
}
|
||||
|
||||
let periodType: PeriodType | undefined;
|
||||
if (/\b(?:1q|q1|quincena\s*15|primera\s+quincena)\b/.test(normalized)) {
|
||||
if (compactHnMatch?.[2] === '1') {
|
||||
periodType = 'quincena_15';
|
||||
} else if (compactHnMatch?.[2] === '2') {
|
||||
periodType = 'quincena_30';
|
||||
} else if (/\b(?:1q|q1|quincena\s*15|primera\s+quincena)\b/.test(normalized)) {
|
||||
periodType = 'quincena_15';
|
||||
} else if (/\b(?:2q|q2|quincena\s*30|segunda\s+quincena|fin\s+de\s+mes)\b/.test(normalized)) {
|
||||
periodType = 'quincena_30';
|
||||
@@ -795,6 +813,7 @@ export default function Dashboard({
|
||||
const defaultPeriod = useMemo(() => readStoredPeriod(country.code), [country.code]);
|
||||
const isPanama = country.code === 'PA';
|
||||
const isElSalvador = country.code === 'SV';
|
||||
const isHonduras = country.code === 'HN';
|
||||
const isMultiPayrollCountry = isPanama || isElSalvador;
|
||||
const [isProcessing, setIsProcessing] = useState(false);
|
||||
const [processingStep, setProcessingStep] = useState('');
|
||||
@@ -1648,7 +1667,8 @@ export default function Dashboard({
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{isMultiPayrollCountry && (uploadedPayrollFiles.length > 0 || uploadedBankFiles.length > 0) && (
|
||||
{(isMultiPayrollCountry || isHonduras) &&
|
||||
(uploadedPayroll !== null || uploadedPayrollFiles.length > 0 || uploadedBankFiles.length > 0) && (
|
||||
<div className="flex justify-end" style={{ marginBottom: '-20px' }}>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -47,6 +47,13 @@ function getHistoryUrl(countryCode: string) {
|
||||
);
|
||||
}
|
||||
|
||||
if (countryCode === 'HN') {
|
||||
return (
|
||||
(import.meta.env.VITE_HISTORICOS_HN_URL as string | undefined) ||
|
||||
'https://agenteit.digitalcompass.agency/webhook/cruce-cuentas-hn-historicos'
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
(import.meta.env.VITE_HISTORICOS_GT_URL as string | undefined) ||
|
||||
'https://agenteit.digitalcompass.agency/webhook/cruce-cuentas-gt-historicos'
|
||||
@@ -72,6 +79,13 @@ function getMarkResolvedUrl(countryCode: string) {
|
||||
);
|
||||
}
|
||||
|
||||
if (countryCode === 'HN') {
|
||||
return (
|
||||
(import.meta.env.VITE_MARCAR_RESUELTO_HN_URL as string | undefined) ||
|
||||
'https://agenteit.digitalcompass.agency/webhook/cruce-cuentas-hn-marcar-resuelto'
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
(import.meta.env.VITE_MARCAR_RESUELTO_GT_URL as string | undefined) ||
|
||||
'https://agenteit.digitalcompass.agency/webhook/cruce-cuentas-gt-marcar-resuelto'
|
||||
@@ -157,7 +171,7 @@ function normalizeReports(input: unknown, country: CountryConfig): HistoricalRep
|
||||
|
||||
return {
|
||||
id: String(report.id ?? `reporte-${index + 1}`),
|
||||
country: (rawCountry === 'TT' ? 'TT' : rawCountry === 'PA' ? 'PA' : rawCountry === 'SV' ? 'SV' : 'GT') as HistoricalReport['country'],
|
||||
country: (rawCountry === 'TT' ? 'TT' : rawCountry === 'PA' ? 'PA' : rawCountry === 'SV' ? 'SV' : rawCountry === 'HN' ? 'HN' : 'GT') as HistoricalReport['country'],
|
||||
date: formatDate(report.fecha ?? report.period_end ?? rawExecutionDate, country.locale),
|
||||
executionDate: formatDateTime(rawExecutionDate, country.locale),
|
||||
period: String(report.periodo ?? report.period_label ?? report.period ?? 'Período no especificado'),
|
||||
@@ -471,7 +485,7 @@ export default function History({
|
||||
if (!isCurrentRequest()) return;
|
||||
|
||||
// Respaldo temporal: webhook histórico existente. También se envía el país
|
||||
// para impedir que se mezclen reportes de Guatemala, Trinidad y Tobago, Panamá y El Salvador.
|
||||
// para impedir que se mezclen reportes de Guatemala, Trinidad y Tobago, Panamá, El Salvador y Honduras.
|
||||
const historyUrl = getHistoryUrl(country.code);
|
||||
if (!historyUrl) {
|
||||
throw new Error(`No está configurado el origen histórico de ${country.name}.`);
|
||||
|
||||
@@ -33,6 +33,14 @@ export const COUNTRIES: CountryConfig[] = [
|
||||
locale: 'es-SV',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
code: 'HN',
|
||||
name: 'Honduras',
|
||||
flag: 'https://dbit.digitalcompass.agency/storage/v1/object/public/public-assets/Bandera%20de%20Honduras.webp',
|
||||
currency: 'HNL',
|
||||
locale: 'es-HN',
|
||||
enabled: true,
|
||||
},
|
||||
];
|
||||
|
||||
export const DEFAULT_COUNTRY_CODE: CountryCode = 'GT';
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ export type ViewType = 'cruce' | 'historial';
|
||||
|
||||
export type ToastType = 'success' | 'error' | 'info';
|
||||
|
||||
export type CountryCode = 'GT' | 'TT' | 'PA' | 'SV';
|
||||
export type CountryCode = 'GT' | 'TT' | 'PA' | 'SV' | 'HN';
|
||||
|
||||
export interface CountryConfig {
|
||||
code: CountryCode;
|
||||
|
||||
Vendored
+6
@@ -5,12 +5,18 @@ interface ImportMetaEnv {
|
||||
readonly VITE_N8N_GUATEMALA_WEBHOOK_URL?: string;
|
||||
readonly VITE_N8N_TRINIDAD_WEBHOOK_URL?: string;
|
||||
readonly VITE_N8N_PANAMA_WEBHOOK_URL?: string;
|
||||
readonly VITE_N8N_EL_SALVADOR_WEBHOOK_URL?: string;
|
||||
readonly VITE_N8N_HONDURAS_WEBHOOK_URL?: string;
|
||||
readonly VITE_HISTORICOS_GT_URL?: string;
|
||||
readonly VITE_MARCAR_RESUELTO_GT_URL?: string;
|
||||
readonly VITE_HISTORICOS_TT_URL?: string;
|
||||
readonly VITE_MARCAR_RESUELTO_TT_URL?: string;
|
||||
readonly VITE_HISTORICOS_PA_URL?: string;
|
||||
readonly VITE_MARCAR_RESUELTO_PA_URL?: string;
|
||||
readonly VITE_HISTORICOS_SV_URL?: string;
|
||||
readonly VITE_MARCAR_RESUELTO_SV_URL?: string;
|
||||
readonly VITE_HISTORICOS_HN_URL?: string;
|
||||
readonly VITE_MARCAR_RESUELTO_HN_URL?: string;
|
||||
readonly VITE_ANALIZAR_NOMINA_URL?: string;
|
||||
readonly VITE_REPORTAR_BAMBOO_URL?: string;
|
||||
readonly VITE_REPORTAR_APP_URL?: string;
|
||||
|
||||
Reference in New Issue
Block a user