sigo-package 1.2.178 → 1.2.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +151 -1
- package/dist/index.d.ts +151 -1
- package/dist/index.js +273 -36
- package/dist/index.mjs +247 -36
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -210,6 +210,129 @@ interface ILineaValidacion {
|
|
|
210
210
|
declare function ValidarRelacionMOHijasAL04(moUo: MoUoType$2[], manoObraDB: any): IResultadoValidacionMOHijas[];
|
|
211
211
|
declare function FormatearErrorValidacionMOHijas(violaciones: IResultadoValidacionMOHijas[]): string | null;
|
|
212
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Reglas de Preliquidar AL04 compartidas por la PWA (formulario) y pex-procesos (motor en el servidor).
|
|
215
|
+
* Legacy: sigo-pwa-mobile TrabajosDEAL04/Preliquidar y TrabajosDEAL04/DocHP; sic-backend TrabajosService/UpdateTrabajo.js.
|
|
216
|
+
* Son reglas propias de AL04: no se mezclan con las de AL02.
|
|
217
|
+
*/
|
|
218
|
+
/** Tipo de preliquidación: troncal o por HomePass (Clientes = Residential, No Clientes = Business) */
|
|
219
|
+
type TipoPreliquidacionAL04 = 'Troncal' | 'Residential' | 'Business';
|
|
220
|
+
/** Material consumido del almacén (todo lo que no es ducto) */
|
|
221
|
+
declare const motivoConsumoAlmacenAL04 = "CONSUMO_MATERIAL_AUTOMATICO_DUCTOS";
|
|
222
|
+
declare const estadoRechazadaPorMetrajeAL04 = "RECHAZADA POR METRAJE";
|
|
223
|
+
/** Asignaciones que no se preliquidan (getDataAsignaciones: UseCasePreLiquidationProcesses.ts L28) */
|
|
224
|
+
declare const codMONoPreliquidablesAL04: string[];
|
|
225
|
+
/** Baliza: una por AddressID entre los trabajos de la GOM (verificarUnaBalizaXDireccion.js) */
|
|
226
|
+
declare const codBalizaPreliquidarAL04 = "HP01";
|
|
227
|
+
/** Baremo único por DP: solo una valorización activa entre los trabajos de la GOM (verificarBaremoUnicoXDP.js) */
|
|
228
|
+
declare const codBaremoUnicoDPAL04: string[];
|
|
229
|
+
/** AP02 y ExtraWide no pueden superar lo preliquidado de AP01 en la obra (UpdateTrabajo.js L10-29, L330-347) */
|
|
230
|
+
declare const codMOAsfaltoMadreAL04 = "AP01";
|
|
231
|
+
declare const codMOAsfaltoHijasAL04: string[];
|
|
232
|
+
/** MO que se puede preliquidar en troncal (Preliquidar/Components/View.tsx L143) */
|
|
233
|
+
declare const codMOPreliquidarTroncalAL04: string[];
|
|
234
|
+
/** MO permitida por HomePass: No Clientes codMOFTTFAL04 (HP01); Clientes codMODROPAL04 (DocHP/Components/Documentacion.tsx L179-187) */
|
|
235
|
+
declare function obtenerCodMOHomePassAL04(tipo: Exclude<TipoPreliquidacionAL04, 'Troncal'>): string[];
|
|
236
|
+
type EstadoCierreAL04 = {
|
|
237
|
+
Estado: unknown;
|
|
238
|
+
Especialidad: string;
|
|
239
|
+
} | undefined;
|
|
240
|
+
/** Cierres OC / ASPH / SOP del trabajo (Ultima_PreLiquidacion) o del HomePass */
|
|
241
|
+
interface CierresPreliquidarAL04 {
|
|
242
|
+
Asfaltado?: EstadoCierreAL04;
|
|
243
|
+
OC?: EstadoCierreAL04;
|
|
244
|
+
Soplado?: EstadoCierreAL04;
|
|
245
|
+
}
|
|
246
|
+
/** Especialidades ocultas tras un cierre: solo si OC está cerrada (filtro `arr[1]`, Preliquidar/Components/View.tsx L144-151) */
|
|
247
|
+
declare function obtenerEspecialidadesCerradasAL04(cierres: CierresPreliquidarAL04): string[];
|
|
248
|
+
/**
|
|
249
|
+
* La asignación se puede preliquidar en ese tipo: MO troncal o permitida para el HomePass y sin especialidad cerrada.
|
|
250
|
+
* El estado de la asignación y codMONoPreliquidablesAL04 se comprueban aparte (getDataAsignaciones del legacy).
|
|
251
|
+
*/
|
|
252
|
+
declare function esAsignacionPreliquidableAL04(asignacion: {
|
|
253
|
+
ManoObra: {
|
|
254
|
+
Codigo: string;
|
|
255
|
+
};
|
|
256
|
+
Especialidad: {
|
|
257
|
+
Codigo: string;
|
|
258
|
+
};
|
|
259
|
+
}, tipo: TipoPreliquidacionAL04, especialidadesCerradas: string[]): boolean;
|
|
260
|
+
/** Ductos: se consumen del stock personal (técnico); el resto, del almacén */
|
|
261
|
+
declare const esMaterialDuctoAL04: (codigo: string) => boolean;
|
|
262
|
+
/** Materiales que no se muestran en el stock personal porque se añaden como hijos de un ducto (generarDataMaterial.ts L15) */
|
|
263
|
+
declare const codMaterialesOcultosAL04: string[];
|
|
264
|
+
/**
|
|
265
|
+
* Cómo se informan los materiales de la MO:
|
|
266
|
+
* - automatico: el mapa fija los materiales (GD01, HP01, NVT01) y se añaden solos
|
|
267
|
+
* - elegir: solo se pueden elegir los materiales del mapa (ductos de obra civil y soplado)
|
|
268
|
+
* - sinMaterial: la MO no lleva materiales (AP02, EXTRA01, PP01…)
|
|
269
|
+
* - libre: la MO no está en el mapa; se puede elegir cualquier material (p. ej. ExtraWide AP02_*)
|
|
270
|
+
*/
|
|
271
|
+
type ModoMaterialesAL04 = 'automatico' | 'elegir' | 'sinMaterial' | 'libre';
|
|
272
|
+
declare function modoMaterialesAL04(codMO: string): ModoMaterialesAL04;
|
|
273
|
+
/** Cantidad fija de la MO (HP01, NVT01 = 1): el campo queda deshabilitado (FormAdd.tsx L366-367, L474-479) */
|
|
274
|
+
declare function cantidadFijaMOAL04(codMO: string): number | undefined;
|
|
275
|
+
interface MaterialRequeridoAL04 {
|
|
276
|
+
Codigo: string;
|
|
277
|
+
Cantidad: number;
|
|
278
|
+
/** Ducto: stock personal; si no, stock de almacén */
|
|
279
|
+
StockPersonal: boolean;
|
|
280
|
+
}
|
|
281
|
+
/** Materiales automáticos: (CantidadFija ? Cantidad : cantidad de MO) × Factor (verificarReglas, FormAdd.tsx L255-297) */
|
|
282
|
+
declare function materialesAutomaticosAL04(codMO: string, cantidadMO: number): MaterialRequeridoAL04[];
|
|
283
|
+
/** Códigos que se pueden elegir; undefined si la MO no restringe los materiales (AddedMaterial.tsx L263-271) */
|
|
284
|
+
declare function materialesSeleccionablesAL04(codMO: string): string[] | undefined;
|
|
285
|
+
interface CantidadMaterialAL04 {
|
|
286
|
+
/** Cantidad que se fija al elegir el material; undefined si la informa el usuario */
|
|
287
|
+
Cantidad?: number;
|
|
288
|
+
Bloqueada: boolean;
|
|
289
|
+
/** El material lleva hijos (conectores / empalmes) cuya cantidad son los empalmes × Factor */
|
|
290
|
+
PideEmpalmes: boolean;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Cantidad del material elegido (AddedMaterial.tsx L194-219): CantidadPadre = cantidad de MO × Factor;
|
|
294
|
+
* CantidadFija = Cantidad × Factor. Si sus hijos no tienen cantidad fija, se piden los empalmes.
|
|
295
|
+
*/
|
|
296
|
+
declare function cantidadMaterialAL04(codMO: string, codMaterial: string, cantidadMO: number): CantidadMaterialAL04;
|
|
297
|
+
/**
|
|
298
|
+
* Hijos del material elegido (agregarSubMateriales, AddedMaterial.tsx L113-156):
|
|
299
|
+
* (CantidadFija ? Cantidad : CantidadPadre ? cantidad del material : empalmes) × Factor.
|
|
300
|
+
* Sin empalmes no se añaden; si no hay forma de obtener la cantidad es error.
|
|
301
|
+
*/
|
|
302
|
+
declare function subMaterialesAL04(codMO: string, codMaterial: string, cantidadMaterial: number, empalmes: number): MaterialRequeridoAL04[];
|
|
303
|
+
/**
|
|
304
|
+
* División por exceso (UseCasePreliquidar.ts L438-469): los ductos se reparten entre la valorización padre y la hija
|
|
305
|
+
* según la cantidad de cada una; el resto de materiales queda en el padre.
|
|
306
|
+
* Decisión 2026-10-14: el padre se redondea a 2 decimales y la hija lleva el total menos el padre.
|
|
307
|
+
*/
|
|
308
|
+
declare function prorratearMaterialesAL04<T extends {
|
|
309
|
+
Codigo: string;
|
|
310
|
+
Cantidad: number;
|
|
311
|
+
CantidadInformada: number;
|
|
312
|
+
}>(materiales: T[], cantidadPadre: number, cantidadTotal: number): {
|
|
313
|
+
padre: T[];
|
|
314
|
+
hija: T[];
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Lo preliquidado en la obra de AP02 + ExtraWide no puede superar a AP01 (tolerancia 0.001). Solo se valida si
|
|
318
|
+
* la preliquidación incluye alguno de esos códigos. Devuelve el mensaje de error o null.
|
|
319
|
+
* @param moUo resumen de todos los trabajos de la obra (CalcularResumenValorizacionesAlemania)
|
|
320
|
+
* @param manoObra ManoObra de la GOM: diccionario LineaCodigoCub → código de la MO
|
|
321
|
+
* @param codigosNuevos códigos de MO de las valorizaciones nuevas
|
|
322
|
+
*/
|
|
323
|
+
declare function validarAsfaltoAL04(moUo: {
|
|
324
|
+
LineaCodigoCub: string;
|
|
325
|
+
Cantidad: number;
|
|
326
|
+
}[], manoObra: {
|
|
327
|
+
Valorizacion: {
|
|
328
|
+
Codigo: string;
|
|
329
|
+
Descripcion?: string;
|
|
330
|
+
DetalleChile?: {
|
|
331
|
+
LineaCodigoCub?: string;
|
|
332
|
+
};
|
|
333
|
+
}[];
|
|
334
|
+
}, codigosNuevos: string[]): string | null;
|
|
335
|
+
|
|
213
336
|
declare const codMOTroncalAL02OC: never[];
|
|
214
337
|
declare const codMOTroncalAL02Soplado: never[];
|
|
215
338
|
declare const codMOTroncalAL02Asfaltado: never[];
|
|
@@ -579,6 +702,33 @@ interface iMapaEspecialidades9612 {
|
|
|
579
702
|
}
|
|
580
703
|
declare const MapeoEspecialidades9612: iMapaEspecialidades9612[];
|
|
581
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Reglas del parte diario CHILE 9512 compartidas por la PWA (formulario) y pex-procesos (save-daily-report).
|
|
707
|
+
* Legacy: sigo-pwa-mobile Programados/Trabajos/ParteDiario (sigo-pwa job/docs/REGLAS_NEGOCIO_CHILE_9512.md §6).
|
|
708
|
+
*/
|
|
709
|
+
declare const timeZoneCHILE9512 = "America/Santiago";
|
|
710
|
+
interface EstadoParteDiarioCHILE9512 {
|
|
711
|
+
Descripcion: string;
|
|
712
|
+
}
|
|
713
|
+
interface ParteDiarioEstadosCHILE9512 {
|
|
714
|
+
UltimoEstadoInterno?: EstadoParteDiarioCHILE9512;
|
|
715
|
+
EstadosInternos?: EstadoParteDiarioCHILE9512[];
|
|
716
|
+
}
|
|
717
|
+
/** Código YYYYMMDD del parte de hoy en hora de Chile (el mismo en el dispositivo y en el servidor) */
|
|
718
|
+
declare const codigoParteDiarioHoyCHILE9512: () => string;
|
|
719
|
+
/** El parte está APROBADO si lo es su último estado o alguno de sus estados (legacy ParteDiario/Components/View.tsx L109-121) */
|
|
720
|
+
declare const esParteDiarioAprobadoCHILE9512: (parte: ParteDiarioEstadosCHILE9512) => boolean;
|
|
721
|
+
/**
|
|
722
|
+
* Editable: el parte de hoy (nuevo o existente) y cualquiera que no esté APROBADO, cada uno en su propio Codigo
|
|
723
|
+
* (corrección del bug B6 del legacy, que guardaba siempre en el parte de hoy; decidido 2026-10-16).
|
|
724
|
+
*/
|
|
725
|
+
declare const esParteDiarioEditableCHILE9512: (codigo: string, parte?: ParteDiarioEstadosCHILE9512) => boolean;
|
|
726
|
+
/** Título de la foto por su orden: la 0 es la principal (legacy ParteDiario/Application/UseCaseUpdateTrabajo.ts L149-160) */
|
|
727
|
+
declare const tituloFotoParteDiarioCHILE9512: (index: number) => {
|
|
728
|
+
Titulo: string;
|
|
729
|
+
Descripcion: string;
|
|
730
|
+
};
|
|
731
|
+
|
|
582
732
|
interface Zona {
|
|
583
733
|
Descripcion: string;
|
|
584
734
|
Codigo: string;
|
|
@@ -973,4 +1123,4 @@ declare function getCookieToken(req: Request<any>, webOrigins: string[]): string
|
|
|
973
1123
|
|
|
974
1124
|
declare function validateUUIDv4Param(BadRequestException: ClassConstructor<Error>, req: Request<any>, _res: Response, next: NextFunction): Promise<void>;
|
|
975
1125
|
|
|
976
|
-
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CierresPreliquidarAL02, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SomacylPhotoKey, type TARGET, type TipoPreliquidacionAL02, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codClientes, codIssueByPeriodoAL02, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVT, empresas, esAsignacionPreliquidableAL02, esCadenaFechaISOValida, esObjetoFecha, estadoRechazadaPorMetraje, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, throwSomacylError, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
|
1126
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CantidadMaterialAL04, type CierresPreliquidarAL02, type CierresPreliquidarAL04, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MaterialRequeridoAL04, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, type ModoMaterialesAL04, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SomacylPhotoKey, type TARGET, type TipoPreliquidacionAL02, type TipoPreliquidacionAL04, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, cantidadFijaMOAL04, cantidadMaterialAL04, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codBalizaPreliquidarAL04, codBaremoUnicoDPAL04, codClientes, codIssueByPeriodoAL02, codMOAsfaltoHijasAL04, codMOAsfaltoMadreAL04, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMONoPreliquidablesAL04, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPreliquidarTroncalAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codMaterialesOcultosAL04, codNoCliente, codSopladoRD, codigoParteDiarioHoyCHILE9512, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVT, empresas, esAsignacionPreliquidableAL02, esAsignacionPreliquidableAL04, esCadenaFechaISOValida, esMaterialDuctoAL04, esObjetoFecha, esParteDiarioAprobadoCHILE9512, esParteDiarioEditableCHILE9512, estadoRechazadaPorMetraje, estadoRechazadaPorMetrajeAL04, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, materialesAutomaticosAL04, materialesSeleccionablesAL04, modoMaterialesAL04, motivoConsumoAlmacenAL04, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerCodMOHomePassAL04, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerEspecialidadesCerradasAL04, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, prorratearMaterialesAL04, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, subMaterialesAL04, throwSomacylError, timeZoneCHILE9512, tituloFotoParteDiarioCHILE9512, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validarAsfaltoAL04, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
package/dist/index.d.ts
CHANGED
|
@@ -210,6 +210,129 @@ interface ILineaValidacion {
|
|
|
210
210
|
declare function ValidarRelacionMOHijasAL04(moUo: MoUoType$2[], manoObraDB: any): IResultadoValidacionMOHijas[];
|
|
211
211
|
declare function FormatearErrorValidacionMOHijas(violaciones: IResultadoValidacionMOHijas[]): string | null;
|
|
212
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Reglas de Preliquidar AL04 compartidas por la PWA (formulario) y pex-procesos (motor en el servidor).
|
|
215
|
+
* Legacy: sigo-pwa-mobile TrabajosDEAL04/Preliquidar y TrabajosDEAL04/DocHP; sic-backend TrabajosService/UpdateTrabajo.js.
|
|
216
|
+
* Son reglas propias de AL04: no se mezclan con las de AL02.
|
|
217
|
+
*/
|
|
218
|
+
/** Tipo de preliquidación: troncal o por HomePass (Clientes = Residential, No Clientes = Business) */
|
|
219
|
+
type TipoPreliquidacionAL04 = 'Troncal' | 'Residential' | 'Business';
|
|
220
|
+
/** Material consumido del almacén (todo lo que no es ducto) */
|
|
221
|
+
declare const motivoConsumoAlmacenAL04 = "CONSUMO_MATERIAL_AUTOMATICO_DUCTOS";
|
|
222
|
+
declare const estadoRechazadaPorMetrajeAL04 = "RECHAZADA POR METRAJE";
|
|
223
|
+
/** Asignaciones que no se preliquidan (getDataAsignaciones: UseCasePreLiquidationProcesses.ts L28) */
|
|
224
|
+
declare const codMONoPreliquidablesAL04: string[];
|
|
225
|
+
/** Baliza: una por AddressID entre los trabajos de la GOM (verificarUnaBalizaXDireccion.js) */
|
|
226
|
+
declare const codBalizaPreliquidarAL04 = "HP01";
|
|
227
|
+
/** Baremo único por DP: solo una valorización activa entre los trabajos de la GOM (verificarBaremoUnicoXDP.js) */
|
|
228
|
+
declare const codBaremoUnicoDPAL04: string[];
|
|
229
|
+
/** AP02 y ExtraWide no pueden superar lo preliquidado de AP01 en la obra (UpdateTrabajo.js L10-29, L330-347) */
|
|
230
|
+
declare const codMOAsfaltoMadreAL04 = "AP01";
|
|
231
|
+
declare const codMOAsfaltoHijasAL04: string[];
|
|
232
|
+
/** MO que se puede preliquidar en troncal (Preliquidar/Components/View.tsx L143) */
|
|
233
|
+
declare const codMOPreliquidarTroncalAL04: string[];
|
|
234
|
+
/** MO permitida por HomePass: No Clientes codMOFTTFAL04 (HP01); Clientes codMODROPAL04 (DocHP/Components/Documentacion.tsx L179-187) */
|
|
235
|
+
declare function obtenerCodMOHomePassAL04(tipo: Exclude<TipoPreliquidacionAL04, 'Troncal'>): string[];
|
|
236
|
+
type EstadoCierreAL04 = {
|
|
237
|
+
Estado: unknown;
|
|
238
|
+
Especialidad: string;
|
|
239
|
+
} | undefined;
|
|
240
|
+
/** Cierres OC / ASPH / SOP del trabajo (Ultima_PreLiquidacion) o del HomePass */
|
|
241
|
+
interface CierresPreliquidarAL04 {
|
|
242
|
+
Asfaltado?: EstadoCierreAL04;
|
|
243
|
+
OC?: EstadoCierreAL04;
|
|
244
|
+
Soplado?: EstadoCierreAL04;
|
|
245
|
+
}
|
|
246
|
+
/** Especialidades ocultas tras un cierre: solo si OC está cerrada (filtro `arr[1]`, Preliquidar/Components/View.tsx L144-151) */
|
|
247
|
+
declare function obtenerEspecialidadesCerradasAL04(cierres: CierresPreliquidarAL04): string[];
|
|
248
|
+
/**
|
|
249
|
+
* La asignación se puede preliquidar en ese tipo: MO troncal o permitida para el HomePass y sin especialidad cerrada.
|
|
250
|
+
* El estado de la asignación y codMONoPreliquidablesAL04 se comprueban aparte (getDataAsignaciones del legacy).
|
|
251
|
+
*/
|
|
252
|
+
declare function esAsignacionPreliquidableAL04(asignacion: {
|
|
253
|
+
ManoObra: {
|
|
254
|
+
Codigo: string;
|
|
255
|
+
};
|
|
256
|
+
Especialidad: {
|
|
257
|
+
Codigo: string;
|
|
258
|
+
};
|
|
259
|
+
}, tipo: TipoPreliquidacionAL04, especialidadesCerradas: string[]): boolean;
|
|
260
|
+
/** Ductos: se consumen del stock personal (técnico); el resto, del almacén */
|
|
261
|
+
declare const esMaterialDuctoAL04: (codigo: string) => boolean;
|
|
262
|
+
/** Materiales que no se muestran en el stock personal porque se añaden como hijos de un ducto (generarDataMaterial.ts L15) */
|
|
263
|
+
declare const codMaterialesOcultosAL04: string[];
|
|
264
|
+
/**
|
|
265
|
+
* Cómo se informan los materiales de la MO:
|
|
266
|
+
* - automatico: el mapa fija los materiales (GD01, HP01, NVT01) y se añaden solos
|
|
267
|
+
* - elegir: solo se pueden elegir los materiales del mapa (ductos de obra civil y soplado)
|
|
268
|
+
* - sinMaterial: la MO no lleva materiales (AP02, EXTRA01, PP01…)
|
|
269
|
+
* - libre: la MO no está en el mapa; se puede elegir cualquier material (p. ej. ExtraWide AP02_*)
|
|
270
|
+
*/
|
|
271
|
+
type ModoMaterialesAL04 = 'automatico' | 'elegir' | 'sinMaterial' | 'libre';
|
|
272
|
+
declare function modoMaterialesAL04(codMO: string): ModoMaterialesAL04;
|
|
273
|
+
/** Cantidad fija de la MO (HP01, NVT01 = 1): el campo queda deshabilitado (FormAdd.tsx L366-367, L474-479) */
|
|
274
|
+
declare function cantidadFijaMOAL04(codMO: string): number | undefined;
|
|
275
|
+
interface MaterialRequeridoAL04 {
|
|
276
|
+
Codigo: string;
|
|
277
|
+
Cantidad: number;
|
|
278
|
+
/** Ducto: stock personal; si no, stock de almacén */
|
|
279
|
+
StockPersonal: boolean;
|
|
280
|
+
}
|
|
281
|
+
/** Materiales automáticos: (CantidadFija ? Cantidad : cantidad de MO) × Factor (verificarReglas, FormAdd.tsx L255-297) */
|
|
282
|
+
declare function materialesAutomaticosAL04(codMO: string, cantidadMO: number): MaterialRequeridoAL04[];
|
|
283
|
+
/** Códigos que se pueden elegir; undefined si la MO no restringe los materiales (AddedMaterial.tsx L263-271) */
|
|
284
|
+
declare function materialesSeleccionablesAL04(codMO: string): string[] | undefined;
|
|
285
|
+
interface CantidadMaterialAL04 {
|
|
286
|
+
/** Cantidad que se fija al elegir el material; undefined si la informa el usuario */
|
|
287
|
+
Cantidad?: number;
|
|
288
|
+
Bloqueada: boolean;
|
|
289
|
+
/** El material lleva hijos (conectores / empalmes) cuya cantidad son los empalmes × Factor */
|
|
290
|
+
PideEmpalmes: boolean;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Cantidad del material elegido (AddedMaterial.tsx L194-219): CantidadPadre = cantidad de MO × Factor;
|
|
294
|
+
* CantidadFija = Cantidad × Factor. Si sus hijos no tienen cantidad fija, se piden los empalmes.
|
|
295
|
+
*/
|
|
296
|
+
declare function cantidadMaterialAL04(codMO: string, codMaterial: string, cantidadMO: number): CantidadMaterialAL04;
|
|
297
|
+
/**
|
|
298
|
+
* Hijos del material elegido (agregarSubMateriales, AddedMaterial.tsx L113-156):
|
|
299
|
+
* (CantidadFija ? Cantidad : CantidadPadre ? cantidad del material : empalmes) × Factor.
|
|
300
|
+
* Sin empalmes no se añaden; si no hay forma de obtener la cantidad es error.
|
|
301
|
+
*/
|
|
302
|
+
declare function subMaterialesAL04(codMO: string, codMaterial: string, cantidadMaterial: number, empalmes: number): MaterialRequeridoAL04[];
|
|
303
|
+
/**
|
|
304
|
+
* División por exceso (UseCasePreliquidar.ts L438-469): los ductos se reparten entre la valorización padre y la hija
|
|
305
|
+
* según la cantidad de cada una; el resto de materiales queda en el padre.
|
|
306
|
+
* Decisión 2026-10-14: el padre se redondea a 2 decimales y la hija lleva el total menos el padre.
|
|
307
|
+
*/
|
|
308
|
+
declare function prorratearMaterialesAL04<T extends {
|
|
309
|
+
Codigo: string;
|
|
310
|
+
Cantidad: number;
|
|
311
|
+
CantidadInformada: number;
|
|
312
|
+
}>(materiales: T[], cantidadPadre: number, cantidadTotal: number): {
|
|
313
|
+
padre: T[];
|
|
314
|
+
hija: T[];
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Lo preliquidado en la obra de AP02 + ExtraWide no puede superar a AP01 (tolerancia 0.001). Solo se valida si
|
|
318
|
+
* la preliquidación incluye alguno de esos códigos. Devuelve el mensaje de error o null.
|
|
319
|
+
* @param moUo resumen de todos los trabajos de la obra (CalcularResumenValorizacionesAlemania)
|
|
320
|
+
* @param manoObra ManoObra de la GOM: diccionario LineaCodigoCub → código de la MO
|
|
321
|
+
* @param codigosNuevos códigos de MO de las valorizaciones nuevas
|
|
322
|
+
*/
|
|
323
|
+
declare function validarAsfaltoAL04(moUo: {
|
|
324
|
+
LineaCodigoCub: string;
|
|
325
|
+
Cantidad: number;
|
|
326
|
+
}[], manoObra: {
|
|
327
|
+
Valorizacion: {
|
|
328
|
+
Codigo: string;
|
|
329
|
+
Descripcion?: string;
|
|
330
|
+
DetalleChile?: {
|
|
331
|
+
LineaCodigoCub?: string;
|
|
332
|
+
};
|
|
333
|
+
}[];
|
|
334
|
+
}, codigosNuevos: string[]): string | null;
|
|
335
|
+
|
|
213
336
|
declare const codMOTroncalAL02OC: never[];
|
|
214
337
|
declare const codMOTroncalAL02Soplado: never[];
|
|
215
338
|
declare const codMOTroncalAL02Asfaltado: never[];
|
|
@@ -579,6 +702,33 @@ interface iMapaEspecialidades9612 {
|
|
|
579
702
|
}
|
|
580
703
|
declare const MapeoEspecialidades9612: iMapaEspecialidades9612[];
|
|
581
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Reglas del parte diario CHILE 9512 compartidas por la PWA (formulario) y pex-procesos (save-daily-report).
|
|
707
|
+
* Legacy: sigo-pwa-mobile Programados/Trabajos/ParteDiario (sigo-pwa job/docs/REGLAS_NEGOCIO_CHILE_9512.md §6).
|
|
708
|
+
*/
|
|
709
|
+
declare const timeZoneCHILE9512 = "America/Santiago";
|
|
710
|
+
interface EstadoParteDiarioCHILE9512 {
|
|
711
|
+
Descripcion: string;
|
|
712
|
+
}
|
|
713
|
+
interface ParteDiarioEstadosCHILE9512 {
|
|
714
|
+
UltimoEstadoInterno?: EstadoParteDiarioCHILE9512;
|
|
715
|
+
EstadosInternos?: EstadoParteDiarioCHILE9512[];
|
|
716
|
+
}
|
|
717
|
+
/** Código YYYYMMDD del parte de hoy en hora de Chile (el mismo en el dispositivo y en el servidor) */
|
|
718
|
+
declare const codigoParteDiarioHoyCHILE9512: () => string;
|
|
719
|
+
/** El parte está APROBADO si lo es su último estado o alguno de sus estados (legacy ParteDiario/Components/View.tsx L109-121) */
|
|
720
|
+
declare const esParteDiarioAprobadoCHILE9512: (parte: ParteDiarioEstadosCHILE9512) => boolean;
|
|
721
|
+
/**
|
|
722
|
+
* Editable: el parte de hoy (nuevo o existente) y cualquiera que no esté APROBADO, cada uno en su propio Codigo
|
|
723
|
+
* (corrección del bug B6 del legacy, que guardaba siempre en el parte de hoy; decidido 2026-10-16).
|
|
724
|
+
*/
|
|
725
|
+
declare const esParteDiarioEditableCHILE9512: (codigo: string, parte?: ParteDiarioEstadosCHILE9512) => boolean;
|
|
726
|
+
/** Título de la foto por su orden: la 0 es la principal (legacy ParteDiario/Application/UseCaseUpdateTrabajo.ts L149-160) */
|
|
727
|
+
declare const tituloFotoParteDiarioCHILE9512: (index: number) => {
|
|
728
|
+
Titulo: string;
|
|
729
|
+
Descripcion: string;
|
|
730
|
+
};
|
|
731
|
+
|
|
582
732
|
interface Zona {
|
|
583
733
|
Descripcion: string;
|
|
584
734
|
Codigo: string;
|
|
@@ -973,4 +1123,4 @@ declare function getCookieToken(req: Request<any>, webOrigins: string[]): string
|
|
|
973
1123
|
|
|
974
1124
|
declare function validateUUIDv4Param(BadRequestException: ClassConstructor<Error>, req: Request<any>, _res: Response, next: NextFunction): Promise<void>;
|
|
975
1125
|
|
|
976
|
-
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CierresPreliquidarAL02, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SomacylPhotoKey, type TARGET, type TipoPreliquidacionAL02, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codClientes, codIssueByPeriodoAL02, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVT, empresas, esAsignacionPreliquidableAL02, esCadenaFechaISOValida, esObjetoFecha, estadoRechazadaPorMetraje, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, throwSomacylError, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
|
1126
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CantidadMaterialAL04, type CierresPreliquidarAL02, type CierresPreliquidarAL04, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MaterialRequeridoAL04, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, type ModoMaterialesAL04, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SomacylPhotoKey, type TARGET, type TipoPreliquidacionAL02, type TipoPreliquidacionAL04, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, cantidadFijaMOAL04, cantidadMaterialAL04, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codBalizaPreliquidarAL04, codBaremoUnicoDPAL04, codClientes, codIssueByPeriodoAL02, codMOAsfaltoHijasAL04, codMOAsfaltoMadreAL04, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMONoPreliquidablesAL04, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPreliquidarTroncalAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codMaterialesOcultosAL04, codNoCliente, codSopladoRD, codigoParteDiarioHoyCHILE9512, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVT, empresas, esAsignacionPreliquidableAL02, esAsignacionPreliquidableAL04, esCadenaFechaISOValida, esMaterialDuctoAL04, esObjetoFecha, esParteDiarioAprobadoCHILE9512, esParteDiarioEditableCHILE9512, estadoRechazadaPorMetraje, estadoRechazadaPorMetrajeAL04, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, materialesAutomaticosAL04, materialesSeleccionablesAL04, modoMaterialesAL04, motivoConsumoAlmacenAL04, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerCodMOHomePassAL04, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerEspecialidadesCerradasAL04, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, prorratearMaterialesAL04, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, subMaterialesAL04, throwSomacylError, timeZoneCHILE9512, tituloFotoParteDiarioCHILE9512, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validarAsfaltoAL04, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
package/dist/index.js
CHANGED
|
@@ -73,12 +73,18 @@ __export(index_exports, {
|
|
|
73
73
|
buildReservaMOJobMajorProjectsAlemaniaAL04: () => buildReservaMOJobMajorProjectsAlemaniaAL04,
|
|
74
74
|
buildTenantCollectionName: () => buildTenantCollectionName,
|
|
75
75
|
calcularTotalMaterialValorizacionPeru9112: () => calcularTotalMaterialValorizacionPeru9112,
|
|
76
|
+
cantidadFijaMOAL04: () => cantidadFijaMOAL04,
|
|
77
|
+
cantidadMaterialAL04: () => cantidadMaterialAL04,
|
|
76
78
|
checkAndBuildMaterialsFromStock: () => checkAndBuildMaterialsFromStock,
|
|
77
79
|
checkMaterialAvailability: () => checkMaterialAvailability,
|
|
78
80
|
codBalizaAL02: () => codBalizaAL02,
|
|
79
81
|
codBalizaAL04: () => codBalizaAL04,
|
|
82
|
+
codBalizaPreliquidarAL04: () => codBalizaPreliquidarAL04,
|
|
83
|
+
codBaremoUnicoDPAL04: () => codBaremoUnicoDPAL04,
|
|
80
84
|
codClientes: () => codClientes,
|
|
81
85
|
codIssueByPeriodoAL02: () => codIssueByPeriodoAL02,
|
|
86
|
+
codMOAsfaltoHijasAL04: () => codMOAsfaltoHijasAL04,
|
|
87
|
+
codMOAsfaltoMadreAL04: () => codMOAsfaltoMadreAL04,
|
|
82
88
|
codMOClientesAL02: () => codMOClientesAL02,
|
|
83
89
|
codMOClientesAL02Asfaltado: () => codMOClientesAL02Asfaltado,
|
|
84
90
|
codMOClientesAL02OC: () => codMOClientesAL02OC,
|
|
@@ -94,8 +100,10 @@ __export(index_exports, {
|
|
|
94
100
|
codMONoClientesAL02OC: () => codMONoClientesAL02OC,
|
|
95
101
|
codMONoClientesAL02Soplado: () => codMONoClientesAL02Soplado,
|
|
96
102
|
codMONoClientes_ReglaLiquidacion1: () => codMONoClientes_ReglaLiquidacion1,
|
|
103
|
+
codMONoPreliquidablesAL04: () => codMONoPreliquidablesAL04,
|
|
97
104
|
codMOOcultosAL04: () => codMOOcultosAL04,
|
|
98
105
|
codMOPreliquidarTroncalAL02: () => codMOPreliquidarTroncalAL02,
|
|
106
|
+
codMOPreliquidarTroncalAL04: () => codMOPreliquidarTroncalAL04,
|
|
99
107
|
codMOPublico: () => codMOPublico,
|
|
100
108
|
codMOTroncalAL02: () => codMOTroncalAL02,
|
|
101
109
|
codMOTroncalAL02Asfaltado: () => codMOTroncalAL02Asfaltado,
|
|
@@ -108,8 +116,10 @@ __export(index_exports, {
|
|
|
108
116
|
codMOTroncalAL04Soplado: () => codMOTroncalAL04Soplado,
|
|
109
117
|
codMOTroncalHistoricoAL02: () => codMOTroncalHistoricoAL02,
|
|
110
118
|
codMOTroncal_ReglaLiquidacion1: () => codMOTroncal_ReglaLiquidacion1,
|
|
119
|
+
codMaterialesOcultosAL04: () => codMaterialesOcultosAL04,
|
|
111
120
|
codNoCliente: () => codNoCliente,
|
|
112
121
|
codSopladoRD: () => codSopladoRD,
|
|
122
|
+
codigoParteDiarioHoyCHILE9512: () => codigoParteDiarioHoyCHILE9512,
|
|
113
123
|
codigosBaremosSubcontrataAL02: () => codigosBaremosSubcontrataAL02,
|
|
114
124
|
codigosMOT1_F2: () => codigosMOT1_F2,
|
|
115
125
|
codigosMaterialDuctos: () => codigosMaterialDuctos,
|
|
@@ -124,9 +134,14 @@ __export(index_exports, {
|
|
|
124
134
|
documentRequirementAltasNVT: () => documentRequirementAltasNVT,
|
|
125
135
|
empresas: () => empresas,
|
|
126
136
|
esAsignacionPreliquidableAL02: () => esAsignacionPreliquidableAL02,
|
|
137
|
+
esAsignacionPreliquidableAL04: () => esAsignacionPreliquidableAL04,
|
|
127
138
|
esCadenaFechaISOValida: () => esCadenaFechaISOValida,
|
|
139
|
+
esMaterialDuctoAL04: () => esMaterialDuctoAL04,
|
|
128
140
|
esObjetoFecha: () => esObjetoFecha,
|
|
141
|
+
esParteDiarioAprobadoCHILE9512: () => esParteDiarioAprobadoCHILE9512,
|
|
142
|
+
esParteDiarioEditableCHILE9512: () => esParteDiarioEditableCHILE9512,
|
|
129
143
|
estadoRechazadaPorMetraje: () => estadoRechazadaPorMetraje,
|
|
144
|
+
estadoRechazadaPorMetrajeAL04: () => estadoRechazadaPorMetrajeAL04,
|
|
130
145
|
formatCurrencyV1: () => formatCurrencyV1,
|
|
131
146
|
formatNumberSmart: () => formatNumberSmart,
|
|
132
147
|
formatNumberV1: () => formatNumberV1,
|
|
@@ -160,23 +175,33 @@ __export(index_exports, {
|
|
|
160
175
|
mapaReglaSopladoClientes: () => mapaReglaSopladoClientes,
|
|
161
176
|
mapaReglaSopladoTroncal: () => mapaReglaSopladoTroncal,
|
|
162
177
|
mapeoZonasSimilares: () => mapeoZonasSimilares,
|
|
178
|
+
materialesAutomaticosAL04: () => materialesAutomaticosAL04,
|
|
179
|
+
materialesSeleccionablesAL04: () => materialesSeleccionablesAL04,
|
|
180
|
+
modoMaterialesAL04: () => modoMaterialesAL04,
|
|
181
|
+
motivoConsumoAlmacenAL04: () => motivoConsumoAlmacenAL04,
|
|
163
182
|
motivoConsumoMaterialAutomaticoDuctos: () => motivoConsumoMaterialAutomaticoDuctos,
|
|
164
183
|
newCodMOTroncalReglaLiquidacion1: () => newCodMOTroncalReglaLiquidacion1,
|
|
165
184
|
obtenerCodMOHomePass: () => obtenerCodMOHomePass,
|
|
185
|
+
obtenerCodMOHomePassAL04: () => obtenerCodMOHomePassAL04,
|
|
166
186
|
obtenerDocumentacionClientes: () => obtenerDocumentacionClientes,
|
|
167
187
|
obtenerDocumentacionNoClientes: () => obtenerDocumentacionNoClientes,
|
|
168
188
|
obtenerEspecialidadesCerradas: () => obtenerEspecialidadesCerradas,
|
|
189
|
+
obtenerEspecialidadesCerradasAL04: () => obtenerEspecialidadesCerradasAL04,
|
|
169
190
|
obtenerPrecioContratistaMaterial: () => obtenerPrecioContratistaMaterial,
|
|
170
191
|
obtenerPrecioManoObraAL02: () => obtenerPrecioManoObraAL02,
|
|
171
192
|
obtenerPrecioManoObraAL04: () => obtenerPrecioManoObraAL04,
|
|
172
193
|
obtenerTipoYCodigoMO: () => obtenerTipoYCodigoMO,
|
|
173
194
|
paisMap: () => paisMap,
|
|
174
195
|
parseDuplicateKeyError: () => parseDuplicateKeyError,
|
|
196
|
+
prorratearMaterialesAL04: () => prorratearMaterialesAL04,
|
|
175
197
|
roundNumber: () => roundNumber,
|
|
176
198
|
searchCurrentContractorSpecialtyPrice: () => searchCurrentContractorSpecialtyPrice,
|
|
177
199
|
setColModels: () => setColModels,
|
|
178
200
|
setContext: () => setContext,
|
|
201
|
+
subMaterialesAL04: () => subMaterialesAL04,
|
|
179
202
|
throwSomacylError: () => throwSomacylError,
|
|
203
|
+
timeZoneCHILE9512: () => timeZoneCHILE9512,
|
|
204
|
+
tituloFotoParteDiarioCHILE9512: () => tituloFotoParteDiarioCHILE9512,
|
|
180
205
|
updatePriceContractorMOAL02: () => updatePriceContractorMOAL02,
|
|
181
206
|
updatePriceContractorMOAL04: () => updatePriceContractorMOAL04,
|
|
182
207
|
updatePriceMOAL02: () => updatePriceMOAL02,
|
|
@@ -184,6 +209,7 @@ __export(index_exports, {
|
|
|
184
209
|
updatePricePBBudgetAlemaniaAL02: () => updatePricePBBudgetAlemaniaAL02,
|
|
185
210
|
updatePricePBBudgetAlemaniaAL04: () => updatePricePBBudgetAlemaniaAL04,
|
|
186
211
|
uuidRegex: () => uuidRegex,
|
|
212
|
+
validarAsfaltoAL04: () => validarAsfaltoAL04,
|
|
187
213
|
validateNoLookup: () => validateNoLookup,
|
|
188
214
|
validateUUIDv4Param: () => validateUUIDv4Param,
|
|
189
215
|
verifyDetailsFinalizeSomacyl: () => verifyDetailsFinalizeSomacyl,
|
|
@@ -4126,6 +4152,196 @@ Debe preliquidar primero al menos ${v.DiferenciaExcedida.toFixed(2)} de ${v.Codi
|
|
|
4126
4152
|
}
|
|
4127
4153
|
__name(FormatearErrorValidacionMOHijas, "FormatearErrorValidacionMOHijas");
|
|
4128
4154
|
|
|
4155
|
+
// src/Programados/Alemania/AL02/codigosMOT1_F2.ts
|
|
4156
|
+
var codigosMOT1_F2 = [
|
|
4157
|
+
"010601600",
|
|
4158
|
+
"010600500",
|
|
4159
|
+
"031406300",
|
|
4160
|
+
"T13",
|
|
4161
|
+
"052208800",
|
|
4162
|
+
"010601300",
|
|
4163
|
+
"010600700",
|
|
4164
|
+
"073100600",
|
|
4165
|
+
"073101000",
|
|
4166
|
+
"073101300",
|
|
4167
|
+
"073101600",
|
|
4168
|
+
"010600600",
|
|
4169
|
+
"073100500",
|
|
4170
|
+
"010601000",
|
|
4171
|
+
"073100700"
|
|
4172
|
+
];
|
|
4173
|
+
|
|
4174
|
+
// src/Programados/Alemania/AL04/reglasPreliquidarAL04.ts
|
|
4175
|
+
var motivoConsumoAlmacenAL04 = "CONSUMO_MATERIAL_AUTOMATICO_DUCTOS";
|
|
4176
|
+
var estadoRechazadaPorMetrajeAL04 = "RECHAZADA POR METRAJE";
|
|
4177
|
+
var codMONoPreliquidablesAL04 = codigosMOT1_F2;
|
|
4178
|
+
var codBalizaPreliquidarAL04 = codBalizaAL04;
|
|
4179
|
+
var codBaremoUnicoDPAL04 = [
|
|
4180
|
+
"NVT01"
|
|
4181
|
+
];
|
|
4182
|
+
var codMOAsfaltoMadreAL04 = "AP01";
|
|
4183
|
+
var codMOAsfaltoHijasAL04 = codMOTroncalAL04Asfaltado;
|
|
4184
|
+
var codMOPreliquidarTroncalAL04 = codMOTroncalAL04;
|
|
4185
|
+
function obtenerCodMOHomePassAL04(tipo) {
|
|
4186
|
+
return tipo === "Business" ? codMOFTTFAL04 : codMODROPAL04;
|
|
4187
|
+
}
|
|
4188
|
+
__name(obtenerCodMOHomePassAL04, "obtenerCodMOHomePassAL04");
|
|
4189
|
+
function obtenerEspecialidadesCerradasAL04(cierres) {
|
|
4190
|
+
return [
|
|
4191
|
+
cierres.Asfaltado,
|
|
4192
|
+
cierres.OC,
|
|
4193
|
+
cierres.Soplado
|
|
4194
|
+
].filter((e, _i, arr) => arr[1]?.Estado && e?.Estado).map((e) => e?.Especialidad ?? "");
|
|
4195
|
+
}
|
|
4196
|
+
__name(obtenerEspecialidadesCerradasAL04, "obtenerEspecialidadesCerradasAL04");
|
|
4197
|
+
function esAsignacionPreliquidableAL04(asignacion, tipo, especialidadesCerradas) {
|
|
4198
|
+
const codMO = asignacion.ManoObra.Codigo;
|
|
4199
|
+
const permitida = tipo === "Troncal" ? codMOPreliquidarTroncalAL04.includes(codMO.trim()) : obtenerCodMOHomePassAL04(tipo).includes(codMO);
|
|
4200
|
+
return permitida && !especialidadesCerradas.includes(asignacion.Especialidad.Codigo);
|
|
4201
|
+
}
|
|
4202
|
+
__name(esAsignacionPreliquidableAL04, "esAsignacionPreliquidableAL04");
|
|
4203
|
+
var esMaterialDuctoAL04 = /* @__PURE__ */ __name((codigo) => CodigosMaterialDuctosAL04.includes(codigo), "esMaterialDuctoAL04");
|
|
4204
|
+
var codMaterialesOcultosAL04 = codMOOcultosAL04;
|
|
4205
|
+
function modoMaterialesAL04(codMO) {
|
|
4206
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
4207
|
+
if (!regla) return "libre";
|
|
4208
|
+
if (regla.Materiales instanceof Map) return "elegir";
|
|
4209
|
+
return regla.Materiales.length ? "automatico" : "sinMaterial";
|
|
4210
|
+
}
|
|
4211
|
+
__name(modoMaterialesAL04, "modoMaterialesAL04");
|
|
4212
|
+
function cantidadFijaMOAL04(codMO) {
|
|
4213
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
4214
|
+
return regla?.CantidadFija ? regla.Cantidad : void 0;
|
|
4215
|
+
}
|
|
4216
|
+
__name(cantidadFijaMOAL04, "cantidadFijaMOAL04");
|
|
4217
|
+
function materialesAutomaticosAL04(codMO, cantidadMO) {
|
|
4218
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
4219
|
+
if (!regla || !Array.isArray(regla.Materiales)) return [];
|
|
4220
|
+
return regla.Materiales.map((material) => ({
|
|
4221
|
+
Codigo: material.Codigo,
|
|
4222
|
+
Cantidad: (material.CantidadFija ? material.Cantidad : cantidadMO) * material.Factor,
|
|
4223
|
+
StockPersonal: esMaterialDuctoAL04(material.Codigo)
|
|
4224
|
+
}));
|
|
4225
|
+
}
|
|
4226
|
+
__name(materialesAutomaticosAL04, "materialesAutomaticosAL04");
|
|
4227
|
+
function materialesSeleccionablesAL04(codMO) {
|
|
4228
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
4229
|
+
if (!regla) return void 0;
|
|
4230
|
+
return regla.Materiales instanceof Map ? [
|
|
4231
|
+
...regla.Materiales.keys()
|
|
4232
|
+
] : regla.Materiales.map((e) => e.Codigo);
|
|
4233
|
+
}
|
|
4234
|
+
__name(materialesSeleccionablesAL04, "materialesSeleccionablesAL04");
|
|
4235
|
+
var reglaMaterialAL04 = /* @__PURE__ */ __name((codMO, codMaterial) => {
|
|
4236
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
4237
|
+
return regla && regla.Materiales instanceof Map ? regla.Materiales.get(codMaterial) : void 0;
|
|
4238
|
+
}, "reglaMaterialAL04");
|
|
4239
|
+
function cantidadMaterialAL04(codMO, codMaterial, cantidadMO) {
|
|
4240
|
+
const regla = reglaMaterialAL04(codMO, codMaterial);
|
|
4241
|
+
if (!regla || !Array.isArray(regla.Materiales)) return {
|
|
4242
|
+
Bloqueada: false,
|
|
4243
|
+
PideEmpalmes: false
|
|
4244
|
+
};
|
|
4245
|
+
const PideEmpalmes = regla.Materiales.some((e) => !e.CantidadFija);
|
|
4246
|
+
if (regla.CantidadPadre) return {
|
|
4247
|
+
Cantidad: cantidadMO * regla.Factor,
|
|
4248
|
+
Bloqueada: true,
|
|
4249
|
+
PideEmpalmes
|
|
4250
|
+
};
|
|
4251
|
+
if (regla.CantidadFija) return {
|
|
4252
|
+
Cantidad: regla.Cantidad * regla.Factor,
|
|
4253
|
+
Bloqueada: true,
|
|
4254
|
+
PideEmpalmes
|
|
4255
|
+
};
|
|
4256
|
+
return {
|
|
4257
|
+
Bloqueada: false,
|
|
4258
|
+
PideEmpalmes
|
|
4259
|
+
};
|
|
4260
|
+
}
|
|
4261
|
+
__name(cantidadMaterialAL04, "cantidadMaterialAL04");
|
|
4262
|
+
function subMaterialesAL04(codMO, codMaterial, cantidadMaterial, empalmes) {
|
|
4263
|
+
const regla = reglaMaterialAL04(codMO, codMaterial);
|
|
4264
|
+
if (!regla || !Array.isArray(regla.Materiales)) return [];
|
|
4265
|
+
const pideEmpalmes = regla.Materiales.some((e) => !e.CantidadFija);
|
|
4266
|
+
const result = [];
|
|
4267
|
+
for (const material of regla.Materiales) {
|
|
4268
|
+
const cantidad = (material.CantidadFija ? material.Cantidad : material.CantidadPadre ? cantidadMaterial : pideEmpalmes ? empalmes : 0) * material.Factor;
|
|
4269
|
+
if (cantidad === 0 && pideEmpalmes) continue;
|
|
4270
|
+
if (cantidad === 0) throw new Error("Error al obtener cantidad");
|
|
4271
|
+
result.push({
|
|
4272
|
+
Codigo: material.Codigo,
|
|
4273
|
+
Cantidad: cantidad,
|
|
4274
|
+
StockPersonal: esMaterialDuctoAL04(material.Codigo)
|
|
4275
|
+
});
|
|
4276
|
+
}
|
|
4277
|
+
return result;
|
|
4278
|
+
}
|
|
4279
|
+
__name(subMaterialesAL04, "subMaterialesAL04");
|
|
4280
|
+
function prorratearMaterialesAL04(materiales, cantidadPadre, cantidadTotal) {
|
|
4281
|
+
const porcentaje = cantidadPadre / cantidadTotal;
|
|
4282
|
+
const padre = [];
|
|
4283
|
+
const hija = [];
|
|
4284
|
+
for (const material of materiales) {
|
|
4285
|
+
if (!esMaterialDuctoAL04(material.Codigo)) {
|
|
4286
|
+
padre.push(material);
|
|
4287
|
+
continue;
|
|
4288
|
+
}
|
|
4289
|
+
const cantidad = round2(material.Cantidad * porcentaje);
|
|
4290
|
+
const informada = round2(material.CantidadInformada * porcentaje);
|
|
4291
|
+
padre.push({
|
|
4292
|
+
...material,
|
|
4293
|
+
Cantidad: cantidad,
|
|
4294
|
+
CantidadInformada: informada
|
|
4295
|
+
});
|
|
4296
|
+
hija.push({
|
|
4297
|
+
...material,
|
|
4298
|
+
Cantidad: resta(material.Cantidad, cantidad),
|
|
4299
|
+
CantidadInformada: resta(material.CantidadInformada, informada)
|
|
4300
|
+
});
|
|
4301
|
+
}
|
|
4302
|
+
return {
|
|
4303
|
+
padre,
|
|
4304
|
+
hija
|
|
4305
|
+
};
|
|
4306
|
+
}
|
|
4307
|
+
__name(prorratearMaterialesAL04, "prorratearMaterialesAL04");
|
|
4308
|
+
var round2 = /* @__PURE__ */ __name((value) => Number(value.toFixed(2)), "round2");
|
|
4309
|
+
var resta = /* @__PURE__ */ __name((total, parte) => Math.round((total - parte) * 1e6) / 1e6, "resta");
|
|
4310
|
+
function validarAsfaltoAL04(moUo, manoObra, codigosNuevos) {
|
|
4311
|
+
const codigos = [
|
|
4312
|
+
codMOAsfaltoMadreAL04,
|
|
4313
|
+
...codMOAsfaltoHijasAL04
|
|
4314
|
+
];
|
|
4315
|
+
if (!codigosNuevos.some((e) => codigos.includes(e))) return null;
|
|
4316
|
+
const lineas = /* @__PURE__ */ new Map();
|
|
4317
|
+
for (const val of manoObra.Valorizacion ?? []) {
|
|
4318
|
+
const lcc = val.DetalleChile?.LineaCodigoCub;
|
|
4319
|
+
if (lcc) lineas.set(lcc, {
|
|
4320
|
+
codigo: val.Codigo,
|
|
4321
|
+
descripcion: val.Descripcion || ""
|
|
4322
|
+
});
|
|
4323
|
+
}
|
|
4324
|
+
let totalMadre = 0;
|
|
4325
|
+
let totalHija = 0;
|
|
4326
|
+
let descMadre = "";
|
|
4327
|
+
for (const item of moUo) {
|
|
4328
|
+
const info = lineas.get(item.LineaCodigoCub);
|
|
4329
|
+
if (!info) continue;
|
|
4330
|
+
if (info.codigo === codMOAsfaltoMadreAL04) {
|
|
4331
|
+
totalMadre += item.Cantidad;
|
|
4332
|
+
descMadre ||= info.descripcion;
|
|
4333
|
+
}
|
|
4334
|
+
if (codMOAsfaltoHijasAL04.includes(info.codigo)) totalHija += item.Cantidad;
|
|
4335
|
+
}
|
|
4336
|
+
if (totalHija - totalMadre <= 1e-3) return null;
|
|
4337
|
+
const grupo = "Asfalto (AP02 / ExtraWide)";
|
|
4338
|
+
const excedente = (totalHija - totalMadre).toFixed(2);
|
|
4339
|
+
return `No se puede preliquidar porque la cantidad total de ${grupo} (${totalHija.toFixed(2)} m) supera la cantidad de ${descMadre || codMOAsfaltoMadreAL04} (${codMOAsfaltoMadreAL04}: ${totalMadre.toFixed(2)} m) preliquidada en esta obra.
|
|
4340
|
+
Excedente: ${excedente} m.
|
|
4341
|
+
Debe preliquidar primero al menos ${excedente} m de ${codMOAsfaltoMadreAL04} antes de agregar m\xE1s ${grupo}.`;
|
|
4342
|
+
}
|
|
4343
|
+
__name(validarAsfaltoAL04, "validarAsfaltoAL04");
|
|
4344
|
+
|
|
4129
4345
|
// src/Programados/Alemania/codMOTroncal_ReglaLiquidacion1.ts
|
|
4130
4346
|
var codMOTroncal_ReglaLiquidacion1 = [
|
|
4131
4347
|
"011304100",
|
|
@@ -4272,25 +4488,6 @@ var codMOPublico = [
|
|
|
4272
4488
|
"073101500"
|
|
4273
4489
|
];
|
|
4274
4490
|
|
|
4275
|
-
// src/Programados/Alemania/AL02/codigosMOT1_F2.ts
|
|
4276
|
-
var codigosMOT1_F2 = [
|
|
4277
|
-
"010601600",
|
|
4278
|
-
"010600500",
|
|
4279
|
-
"031406300",
|
|
4280
|
-
"T13",
|
|
4281
|
-
"052208800",
|
|
4282
|
-
"010601300",
|
|
4283
|
-
"010600700",
|
|
4284
|
-
"073100600",
|
|
4285
|
-
"073101000",
|
|
4286
|
-
"073101300",
|
|
4287
|
-
"073101600",
|
|
4288
|
-
"010600600",
|
|
4289
|
-
"073100500",
|
|
4290
|
-
"010601000",
|
|
4291
|
-
"073100700"
|
|
4292
|
-
];
|
|
4293
|
-
|
|
4294
4491
|
// src/Programados/Alemania/codigosMOHP.ts
|
|
4295
4492
|
var codClientes = [
|
|
4296
4493
|
"031406300",
|
|
@@ -16041,6 +16238,37 @@ var MapeoEspecialidades9612 = [
|
|
|
16041
16238
|
}
|
|
16042
16239
|
];
|
|
16043
16240
|
|
|
16241
|
+
// src/shared/Utils/getDateInTimeZone.ts
|
|
16242
|
+
function getDateInTimeZone(timeZone) {
|
|
16243
|
+
return new Date((/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
16244
|
+
timeZone
|
|
16245
|
+
}));
|
|
16246
|
+
}
|
|
16247
|
+
__name(getDateInTimeZone, "getDateInTimeZone");
|
|
16248
|
+
|
|
16249
|
+
// src/Programados/Procesos/parteDiario/GetCodigoFechaActual.ts
|
|
16250
|
+
var GetCodigoFechaActual = /* @__PURE__ */ __name((fecha) => {
|
|
16251
|
+
const diaString = fecha ? fecha : /* @__PURE__ */ new Date();
|
|
16252
|
+
const dia = diaString.getDate().toString().padStart(2, "0");
|
|
16253
|
+
const mes = (diaString.getMonth() + 1).toString().padStart(2, "0");
|
|
16254
|
+
const a\u00F1o = diaString.getFullYear().toString();
|
|
16255
|
+
return `${a\u00F1o}${mes}${dia}`;
|
|
16256
|
+
}, "GetCodigoFechaActual");
|
|
16257
|
+
|
|
16258
|
+
// src/Programados/Chile/9512/reglasParteDiarioCHILE9512.ts
|
|
16259
|
+
var timeZoneCHILE9512 = "America/Santiago";
|
|
16260
|
+
var APROBADO = "APROBADO";
|
|
16261
|
+
var codigoParteDiarioHoyCHILE9512 = /* @__PURE__ */ __name(() => GetCodigoFechaActual(getDateInTimeZone(timeZoneCHILE9512)), "codigoParteDiarioHoyCHILE9512");
|
|
16262
|
+
var esParteDiarioAprobadoCHILE9512 = /* @__PURE__ */ __name((parte) => parte.UltimoEstadoInterno?.Descripcion === APROBADO || (parte.EstadosInternos ?? []).some((e) => e.Descripcion === APROBADO), "esParteDiarioAprobadoCHILE9512");
|
|
16263
|
+
var esParteDiarioEditableCHILE9512 = /* @__PURE__ */ __name((codigo, parte) => parte ? !esParteDiarioAprobadoCHILE9512(parte) : codigo === codigoParteDiarioHoyCHILE9512(), "esParteDiarioEditableCHILE9512");
|
|
16264
|
+
var tituloFotoParteDiarioCHILE9512 = /* @__PURE__ */ __name((index) => index === 0 ? {
|
|
16265
|
+
Titulo: "Foto Principal",
|
|
16266
|
+
Descripcion: "Foto Cuadrilla"
|
|
16267
|
+
} : {
|
|
16268
|
+
Titulo: `Foto Auxiliar ${index}`,
|
|
16269
|
+
Descripcion: `Foto Auxiliar ${index}`
|
|
16270
|
+
}, "tituloFotoParteDiarioCHILE9512");
|
|
16271
|
+
|
|
16044
16272
|
// src/Programados/BuscarZonaContratista.ts
|
|
16045
16273
|
function BuscarZonaContratista(EmpresaContratistaEnPrecioEspecialidad, Obra, ZonaAsignada) {
|
|
16046
16274
|
const zonaSearchMapping = {
|
|
@@ -16352,15 +16580,6 @@ var CompararFechas = /* @__PURE__ */ __name((Fecha1, Fecha2) => {
|
|
|
16352
16580
|
return fecParteDiario.getTime() === hoy.getTime();
|
|
16353
16581
|
}, "CompararFechas");
|
|
16354
16582
|
|
|
16355
|
-
// src/Programados/Procesos/parteDiario/GetCodigoFechaActual.ts
|
|
16356
|
-
var GetCodigoFechaActual = /* @__PURE__ */ __name((fecha) => {
|
|
16357
|
-
const diaString = fecha ? fecha : /* @__PURE__ */ new Date();
|
|
16358
|
-
const dia = diaString.getDate().toString().padStart(2, "0");
|
|
16359
|
-
const mes = (diaString.getMonth() + 1).toString().padStart(2, "0");
|
|
16360
|
-
const a\u00F1o = diaString.getFullYear().toString();
|
|
16361
|
-
return `${a\u00F1o}${mes}${dia}`;
|
|
16362
|
-
}, "GetCodigoFechaActual");
|
|
16363
|
-
|
|
16364
16583
|
// src/shared/Utils/CurrencyFormat.ts
|
|
16365
16584
|
var Params = class Params2 {
|
|
16366
16585
|
static {
|
|
@@ -16552,14 +16771,6 @@ function getChannelName(id) {
|
|
|
16552
16771
|
}
|
|
16553
16772
|
__name(getChannelName, "getChannelName");
|
|
16554
16773
|
|
|
16555
|
-
// src/shared/Utils/getDateInTimeZone.ts
|
|
16556
|
-
function getDateInTimeZone(timeZone) {
|
|
16557
|
-
return new Date((/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
16558
|
-
timeZone
|
|
16559
|
-
}));
|
|
16560
|
-
}
|
|
16561
|
-
__name(getDateInTimeZone, "getDateInTimeZone");
|
|
16562
|
-
|
|
16563
16774
|
// src/shared/Utils/generateUniqueNumber.ts
|
|
16564
16775
|
function generateUniqueNumber() {
|
|
16565
16776
|
const base = 1e7;
|
|
@@ -17579,12 +17790,18 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17579
17790
|
buildReservaMOJobMajorProjectsAlemaniaAL04,
|
|
17580
17791
|
buildTenantCollectionName,
|
|
17581
17792
|
calcularTotalMaterialValorizacionPeru9112,
|
|
17793
|
+
cantidadFijaMOAL04,
|
|
17794
|
+
cantidadMaterialAL04,
|
|
17582
17795
|
checkAndBuildMaterialsFromStock,
|
|
17583
17796
|
checkMaterialAvailability,
|
|
17584
17797
|
codBalizaAL02,
|
|
17585
17798
|
codBalizaAL04,
|
|
17799
|
+
codBalizaPreliquidarAL04,
|
|
17800
|
+
codBaremoUnicoDPAL04,
|
|
17586
17801
|
codClientes,
|
|
17587
17802
|
codIssueByPeriodoAL02,
|
|
17803
|
+
codMOAsfaltoHijasAL04,
|
|
17804
|
+
codMOAsfaltoMadreAL04,
|
|
17588
17805
|
codMOClientesAL02,
|
|
17589
17806
|
codMOClientesAL02Asfaltado,
|
|
17590
17807
|
codMOClientesAL02OC,
|
|
@@ -17600,8 +17817,10 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17600
17817
|
codMONoClientesAL02OC,
|
|
17601
17818
|
codMONoClientesAL02Soplado,
|
|
17602
17819
|
codMONoClientes_ReglaLiquidacion1,
|
|
17820
|
+
codMONoPreliquidablesAL04,
|
|
17603
17821
|
codMOOcultosAL04,
|
|
17604
17822
|
codMOPreliquidarTroncalAL02,
|
|
17823
|
+
codMOPreliquidarTroncalAL04,
|
|
17605
17824
|
codMOPublico,
|
|
17606
17825
|
codMOTroncalAL02,
|
|
17607
17826
|
codMOTroncalAL02Asfaltado,
|
|
@@ -17614,8 +17833,10 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17614
17833
|
codMOTroncalAL04Soplado,
|
|
17615
17834
|
codMOTroncalHistoricoAL02,
|
|
17616
17835
|
codMOTroncal_ReglaLiquidacion1,
|
|
17836
|
+
codMaterialesOcultosAL04,
|
|
17617
17837
|
codNoCliente,
|
|
17618
17838
|
codSopladoRD,
|
|
17839
|
+
codigoParteDiarioHoyCHILE9512,
|
|
17619
17840
|
codigosBaremosSubcontrataAL02,
|
|
17620
17841
|
codigosMOT1_F2,
|
|
17621
17842
|
codigosMaterialDuctos,
|
|
@@ -17630,9 +17851,14 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17630
17851
|
documentRequirementAltasNVT,
|
|
17631
17852
|
empresas,
|
|
17632
17853
|
esAsignacionPreliquidableAL02,
|
|
17854
|
+
esAsignacionPreliquidableAL04,
|
|
17633
17855
|
esCadenaFechaISOValida,
|
|
17856
|
+
esMaterialDuctoAL04,
|
|
17634
17857
|
esObjetoFecha,
|
|
17858
|
+
esParteDiarioAprobadoCHILE9512,
|
|
17859
|
+
esParteDiarioEditableCHILE9512,
|
|
17635
17860
|
estadoRechazadaPorMetraje,
|
|
17861
|
+
estadoRechazadaPorMetrajeAL04,
|
|
17636
17862
|
formatCurrencyV1,
|
|
17637
17863
|
formatNumberSmart,
|
|
17638
17864
|
formatNumberV1,
|
|
@@ -17666,23 +17892,33 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17666
17892
|
mapaReglaSopladoClientes,
|
|
17667
17893
|
mapaReglaSopladoTroncal,
|
|
17668
17894
|
mapeoZonasSimilares,
|
|
17895
|
+
materialesAutomaticosAL04,
|
|
17896
|
+
materialesSeleccionablesAL04,
|
|
17897
|
+
modoMaterialesAL04,
|
|
17898
|
+
motivoConsumoAlmacenAL04,
|
|
17669
17899
|
motivoConsumoMaterialAutomaticoDuctos,
|
|
17670
17900
|
newCodMOTroncalReglaLiquidacion1,
|
|
17671
17901
|
obtenerCodMOHomePass,
|
|
17902
|
+
obtenerCodMOHomePassAL04,
|
|
17672
17903
|
obtenerDocumentacionClientes,
|
|
17673
17904
|
obtenerDocumentacionNoClientes,
|
|
17674
17905
|
obtenerEspecialidadesCerradas,
|
|
17906
|
+
obtenerEspecialidadesCerradasAL04,
|
|
17675
17907
|
obtenerPrecioContratistaMaterial,
|
|
17676
17908
|
obtenerPrecioManoObraAL02,
|
|
17677
17909
|
obtenerPrecioManoObraAL04,
|
|
17678
17910
|
obtenerTipoYCodigoMO,
|
|
17679
17911
|
paisMap,
|
|
17680
17912
|
parseDuplicateKeyError,
|
|
17913
|
+
prorratearMaterialesAL04,
|
|
17681
17914
|
roundNumber,
|
|
17682
17915
|
searchCurrentContractorSpecialtyPrice,
|
|
17683
17916
|
setColModels,
|
|
17684
17917
|
setContext,
|
|
17918
|
+
subMaterialesAL04,
|
|
17685
17919
|
throwSomacylError,
|
|
17920
|
+
timeZoneCHILE9512,
|
|
17921
|
+
tituloFotoParteDiarioCHILE9512,
|
|
17686
17922
|
updatePriceContractorMOAL02,
|
|
17687
17923
|
updatePriceContractorMOAL04,
|
|
17688
17924
|
updatePriceMOAL02,
|
|
@@ -17690,6 +17926,7 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17690
17926
|
updatePricePBBudgetAlemaniaAL02,
|
|
17691
17927
|
updatePricePBBudgetAlemaniaAL04,
|
|
17692
17928
|
uuidRegex,
|
|
17929
|
+
validarAsfaltoAL04,
|
|
17693
17930
|
validateNoLookup,
|
|
17694
17931
|
validateUUIDv4Param,
|
|
17695
17932
|
verifyDetailsFinalizeSomacyl,
|
package/dist/index.mjs
CHANGED
|
@@ -3931,6 +3931,196 @@ Debe preliquidar primero al menos ${v.DiferenciaExcedida.toFixed(2)} de ${v.Codi
|
|
|
3931
3931
|
}
|
|
3932
3932
|
__name(FormatearErrorValidacionMOHijas, "FormatearErrorValidacionMOHijas");
|
|
3933
3933
|
|
|
3934
|
+
// src/Programados/Alemania/AL02/codigosMOT1_F2.ts
|
|
3935
|
+
var codigosMOT1_F2 = [
|
|
3936
|
+
"010601600",
|
|
3937
|
+
"010600500",
|
|
3938
|
+
"031406300",
|
|
3939
|
+
"T13",
|
|
3940
|
+
"052208800",
|
|
3941
|
+
"010601300",
|
|
3942
|
+
"010600700",
|
|
3943
|
+
"073100600",
|
|
3944
|
+
"073101000",
|
|
3945
|
+
"073101300",
|
|
3946
|
+
"073101600",
|
|
3947
|
+
"010600600",
|
|
3948
|
+
"073100500",
|
|
3949
|
+
"010601000",
|
|
3950
|
+
"073100700"
|
|
3951
|
+
];
|
|
3952
|
+
|
|
3953
|
+
// src/Programados/Alemania/AL04/reglasPreliquidarAL04.ts
|
|
3954
|
+
var motivoConsumoAlmacenAL04 = "CONSUMO_MATERIAL_AUTOMATICO_DUCTOS";
|
|
3955
|
+
var estadoRechazadaPorMetrajeAL04 = "RECHAZADA POR METRAJE";
|
|
3956
|
+
var codMONoPreliquidablesAL04 = codigosMOT1_F2;
|
|
3957
|
+
var codBalizaPreliquidarAL04 = codBalizaAL04;
|
|
3958
|
+
var codBaremoUnicoDPAL04 = [
|
|
3959
|
+
"NVT01"
|
|
3960
|
+
];
|
|
3961
|
+
var codMOAsfaltoMadreAL04 = "AP01";
|
|
3962
|
+
var codMOAsfaltoHijasAL04 = codMOTroncalAL04Asfaltado;
|
|
3963
|
+
var codMOPreliquidarTroncalAL04 = codMOTroncalAL04;
|
|
3964
|
+
function obtenerCodMOHomePassAL04(tipo) {
|
|
3965
|
+
return tipo === "Business" ? codMOFTTFAL04 : codMODROPAL04;
|
|
3966
|
+
}
|
|
3967
|
+
__name(obtenerCodMOHomePassAL04, "obtenerCodMOHomePassAL04");
|
|
3968
|
+
function obtenerEspecialidadesCerradasAL04(cierres) {
|
|
3969
|
+
return [
|
|
3970
|
+
cierres.Asfaltado,
|
|
3971
|
+
cierres.OC,
|
|
3972
|
+
cierres.Soplado
|
|
3973
|
+
].filter((e, _i, arr) => arr[1]?.Estado && e?.Estado).map((e) => e?.Especialidad ?? "");
|
|
3974
|
+
}
|
|
3975
|
+
__name(obtenerEspecialidadesCerradasAL04, "obtenerEspecialidadesCerradasAL04");
|
|
3976
|
+
function esAsignacionPreliquidableAL04(asignacion, tipo, especialidadesCerradas) {
|
|
3977
|
+
const codMO = asignacion.ManoObra.Codigo;
|
|
3978
|
+
const permitida = tipo === "Troncal" ? codMOPreliquidarTroncalAL04.includes(codMO.trim()) : obtenerCodMOHomePassAL04(tipo).includes(codMO);
|
|
3979
|
+
return permitida && !especialidadesCerradas.includes(asignacion.Especialidad.Codigo);
|
|
3980
|
+
}
|
|
3981
|
+
__name(esAsignacionPreliquidableAL04, "esAsignacionPreliquidableAL04");
|
|
3982
|
+
var esMaterialDuctoAL04 = /* @__PURE__ */ __name((codigo) => CodigosMaterialDuctosAL04.includes(codigo), "esMaterialDuctoAL04");
|
|
3983
|
+
var codMaterialesOcultosAL04 = codMOOcultosAL04;
|
|
3984
|
+
function modoMaterialesAL04(codMO) {
|
|
3985
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
3986
|
+
if (!regla) return "libre";
|
|
3987
|
+
if (regla.Materiales instanceof Map) return "elegir";
|
|
3988
|
+
return regla.Materiales.length ? "automatico" : "sinMaterial";
|
|
3989
|
+
}
|
|
3990
|
+
__name(modoMaterialesAL04, "modoMaterialesAL04");
|
|
3991
|
+
function cantidadFijaMOAL04(codMO) {
|
|
3992
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
3993
|
+
return regla?.CantidadFija ? regla.Cantidad : void 0;
|
|
3994
|
+
}
|
|
3995
|
+
__name(cantidadFijaMOAL04, "cantidadFijaMOAL04");
|
|
3996
|
+
function materialesAutomaticosAL04(codMO, cantidadMO) {
|
|
3997
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
3998
|
+
if (!regla || !Array.isArray(regla.Materiales)) return [];
|
|
3999
|
+
return regla.Materiales.map((material) => ({
|
|
4000
|
+
Codigo: material.Codigo,
|
|
4001
|
+
Cantidad: (material.CantidadFija ? material.Cantidad : cantidadMO) * material.Factor,
|
|
4002
|
+
StockPersonal: esMaterialDuctoAL04(material.Codigo)
|
|
4003
|
+
}));
|
|
4004
|
+
}
|
|
4005
|
+
__name(materialesAutomaticosAL04, "materialesAutomaticosAL04");
|
|
4006
|
+
function materialesSeleccionablesAL04(codMO) {
|
|
4007
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
4008
|
+
if (!regla) return void 0;
|
|
4009
|
+
return regla.Materiales instanceof Map ? [
|
|
4010
|
+
...regla.Materiales.keys()
|
|
4011
|
+
] : regla.Materiales.map((e) => e.Codigo);
|
|
4012
|
+
}
|
|
4013
|
+
__name(materialesSeleccionablesAL04, "materialesSeleccionablesAL04");
|
|
4014
|
+
var reglaMaterialAL04 = /* @__PURE__ */ __name((codMO, codMaterial) => {
|
|
4015
|
+
const regla = mapaMOMaterialAL04.get(codMO);
|
|
4016
|
+
return regla && regla.Materiales instanceof Map ? regla.Materiales.get(codMaterial) : void 0;
|
|
4017
|
+
}, "reglaMaterialAL04");
|
|
4018
|
+
function cantidadMaterialAL04(codMO, codMaterial, cantidadMO) {
|
|
4019
|
+
const regla = reglaMaterialAL04(codMO, codMaterial);
|
|
4020
|
+
if (!regla || !Array.isArray(regla.Materiales)) return {
|
|
4021
|
+
Bloqueada: false,
|
|
4022
|
+
PideEmpalmes: false
|
|
4023
|
+
};
|
|
4024
|
+
const PideEmpalmes = regla.Materiales.some((e) => !e.CantidadFija);
|
|
4025
|
+
if (regla.CantidadPadre) return {
|
|
4026
|
+
Cantidad: cantidadMO * regla.Factor,
|
|
4027
|
+
Bloqueada: true,
|
|
4028
|
+
PideEmpalmes
|
|
4029
|
+
};
|
|
4030
|
+
if (regla.CantidadFija) return {
|
|
4031
|
+
Cantidad: regla.Cantidad * regla.Factor,
|
|
4032
|
+
Bloqueada: true,
|
|
4033
|
+
PideEmpalmes
|
|
4034
|
+
};
|
|
4035
|
+
return {
|
|
4036
|
+
Bloqueada: false,
|
|
4037
|
+
PideEmpalmes
|
|
4038
|
+
};
|
|
4039
|
+
}
|
|
4040
|
+
__name(cantidadMaterialAL04, "cantidadMaterialAL04");
|
|
4041
|
+
function subMaterialesAL04(codMO, codMaterial, cantidadMaterial, empalmes) {
|
|
4042
|
+
const regla = reglaMaterialAL04(codMO, codMaterial);
|
|
4043
|
+
if (!regla || !Array.isArray(regla.Materiales)) return [];
|
|
4044
|
+
const pideEmpalmes = regla.Materiales.some((e) => !e.CantidadFija);
|
|
4045
|
+
const result = [];
|
|
4046
|
+
for (const material of regla.Materiales) {
|
|
4047
|
+
const cantidad = (material.CantidadFija ? material.Cantidad : material.CantidadPadre ? cantidadMaterial : pideEmpalmes ? empalmes : 0) * material.Factor;
|
|
4048
|
+
if (cantidad === 0 && pideEmpalmes) continue;
|
|
4049
|
+
if (cantidad === 0) throw new Error("Error al obtener cantidad");
|
|
4050
|
+
result.push({
|
|
4051
|
+
Codigo: material.Codigo,
|
|
4052
|
+
Cantidad: cantidad,
|
|
4053
|
+
StockPersonal: esMaterialDuctoAL04(material.Codigo)
|
|
4054
|
+
});
|
|
4055
|
+
}
|
|
4056
|
+
return result;
|
|
4057
|
+
}
|
|
4058
|
+
__name(subMaterialesAL04, "subMaterialesAL04");
|
|
4059
|
+
function prorratearMaterialesAL04(materiales, cantidadPadre, cantidadTotal) {
|
|
4060
|
+
const porcentaje = cantidadPadre / cantidadTotal;
|
|
4061
|
+
const padre = [];
|
|
4062
|
+
const hija = [];
|
|
4063
|
+
for (const material of materiales) {
|
|
4064
|
+
if (!esMaterialDuctoAL04(material.Codigo)) {
|
|
4065
|
+
padre.push(material);
|
|
4066
|
+
continue;
|
|
4067
|
+
}
|
|
4068
|
+
const cantidad = round2(material.Cantidad * porcentaje);
|
|
4069
|
+
const informada = round2(material.CantidadInformada * porcentaje);
|
|
4070
|
+
padre.push({
|
|
4071
|
+
...material,
|
|
4072
|
+
Cantidad: cantidad,
|
|
4073
|
+
CantidadInformada: informada
|
|
4074
|
+
});
|
|
4075
|
+
hija.push({
|
|
4076
|
+
...material,
|
|
4077
|
+
Cantidad: resta(material.Cantidad, cantidad),
|
|
4078
|
+
CantidadInformada: resta(material.CantidadInformada, informada)
|
|
4079
|
+
});
|
|
4080
|
+
}
|
|
4081
|
+
return {
|
|
4082
|
+
padre,
|
|
4083
|
+
hija
|
|
4084
|
+
};
|
|
4085
|
+
}
|
|
4086
|
+
__name(prorratearMaterialesAL04, "prorratearMaterialesAL04");
|
|
4087
|
+
var round2 = /* @__PURE__ */ __name((value) => Number(value.toFixed(2)), "round2");
|
|
4088
|
+
var resta = /* @__PURE__ */ __name((total, parte) => Math.round((total - parte) * 1e6) / 1e6, "resta");
|
|
4089
|
+
function validarAsfaltoAL04(moUo, manoObra, codigosNuevos) {
|
|
4090
|
+
const codigos = [
|
|
4091
|
+
codMOAsfaltoMadreAL04,
|
|
4092
|
+
...codMOAsfaltoHijasAL04
|
|
4093
|
+
];
|
|
4094
|
+
if (!codigosNuevos.some((e) => codigos.includes(e))) return null;
|
|
4095
|
+
const lineas = /* @__PURE__ */ new Map();
|
|
4096
|
+
for (const val of manoObra.Valorizacion ?? []) {
|
|
4097
|
+
const lcc = val.DetalleChile?.LineaCodigoCub;
|
|
4098
|
+
if (lcc) lineas.set(lcc, {
|
|
4099
|
+
codigo: val.Codigo,
|
|
4100
|
+
descripcion: val.Descripcion || ""
|
|
4101
|
+
});
|
|
4102
|
+
}
|
|
4103
|
+
let totalMadre = 0;
|
|
4104
|
+
let totalHija = 0;
|
|
4105
|
+
let descMadre = "";
|
|
4106
|
+
for (const item of moUo) {
|
|
4107
|
+
const info = lineas.get(item.LineaCodigoCub);
|
|
4108
|
+
if (!info) continue;
|
|
4109
|
+
if (info.codigo === codMOAsfaltoMadreAL04) {
|
|
4110
|
+
totalMadre += item.Cantidad;
|
|
4111
|
+
descMadre ||= info.descripcion;
|
|
4112
|
+
}
|
|
4113
|
+
if (codMOAsfaltoHijasAL04.includes(info.codigo)) totalHija += item.Cantidad;
|
|
4114
|
+
}
|
|
4115
|
+
if (totalHija - totalMadre <= 1e-3) return null;
|
|
4116
|
+
const grupo = "Asfalto (AP02 / ExtraWide)";
|
|
4117
|
+
const excedente = (totalHija - totalMadre).toFixed(2);
|
|
4118
|
+
return `No se puede preliquidar porque la cantidad total de ${grupo} (${totalHija.toFixed(2)} m) supera la cantidad de ${descMadre || codMOAsfaltoMadreAL04} (${codMOAsfaltoMadreAL04}: ${totalMadre.toFixed(2)} m) preliquidada en esta obra.
|
|
4119
|
+
Excedente: ${excedente} m.
|
|
4120
|
+
Debe preliquidar primero al menos ${excedente} m de ${codMOAsfaltoMadreAL04} antes de agregar m\xE1s ${grupo}.`;
|
|
4121
|
+
}
|
|
4122
|
+
__name(validarAsfaltoAL04, "validarAsfaltoAL04");
|
|
4123
|
+
|
|
3934
4124
|
// src/Programados/Alemania/codMOTroncal_ReglaLiquidacion1.ts
|
|
3935
4125
|
var codMOTroncal_ReglaLiquidacion1 = [
|
|
3936
4126
|
"011304100",
|
|
@@ -4077,25 +4267,6 @@ var codMOPublico = [
|
|
|
4077
4267
|
"073101500"
|
|
4078
4268
|
];
|
|
4079
4269
|
|
|
4080
|
-
// src/Programados/Alemania/AL02/codigosMOT1_F2.ts
|
|
4081
|
-
var codigosMOT1_F2 = [
|
|
4082
|
-
"010601600",
|
|
4083
|
-
"010600500",
|
|
4084
|
-
"031406300",
|
|
4085
|
-
"T13",
|
|
4086
|
-
"052208800",
|
|
4087
|
-
"010601300",
|
|
4088
|
-
"010600700",
|
|
4089
|
-
"073100600",
|
|
4090
|
-
"073101000",
|
|
4091
|
-
"073101300",
|
|
4092
|
-
"073101600",
|
|
4093
|
-
"010600600",
|
|
4094
|
-
"073100500",
|
|
4095
|
-
"010601000",
|
|
4096
|
-
"073100700"
|
|
4097
|
-
];
|
|
4098
|
-
|
|
4099
4270
|
// src/Programados/Alemania/codigosMOHP.ts
|
|
4100
4271
|
var codClientes = [
|
|
4101
4272
|
"031406300",
|
|
@@ -15846,6 +16017,37 @@ var MapeoEspecialidades9612 = [
|
|
|
15846
16017
|
}
|
|
15847
16018
|
];
|
|
15848
16019
|
|
|
16020
|
+
// src/shared/Utils/getDateInTimeZone.ts
|
|
16021
|
+
function getDateInTimeZone(timeZone) {
|
|
16022
|
+
return new Date((/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
16023
|
+
timeZone
|
|
16024
|
+
}));
|
|
16025
|
+
}
|
|
16026
|
+
__name(getDateInTimeZone, "getDateInTimeZone");
|
|
16027
|
+
|
|
16028
|
+
// src/Programados/Procesos/parteDiario/GetCodigoFechaActual.ts
|
|
16029
|
+
var GetCodigoFechaActual = /* @__PURE__ */ __name((fecha) => {
|
|
16030
|
+
const diaString = fecha ? fecha : /* @__PURE__ */ new Date();
|
|
16031
|
+
const dia = diaString.getDate().toString().padStart(2, "0");
|
|
16032
|
+
const mes = (diaString.getMonth() + 1).toString().padStart(2, "0");
|
|
16033
|
+
const a\u00F1o = diaString.getFullYear().toString();
|
|
16034
|
+
return `${a\u00F1o}${mes}${dia}`;
|
|
16035
|
+
}, "GetCodigoFechaActual");
|
|
16036
|
+
|
|
16037
|
+
// src/Programados/Chile/9512/reglasParteDiarioCHILE9512.ts
|
|
16038
|
+
var timeZoneCHILE9512 = "America/Santiago";
|
|
16039
|
+
var APROBADO = "APROBADO";
|
|
16040
|
+
var codigoParteDiarioHoyCHILE9512 = /* @__PURE__ */ __name(() => GetCodigoFechaActual(getDateInTimeZone(timeZoneCHILE9512)), "codigoParteDiarioHoyCHILE9512");
|
|
16041
|
+
var esParteDiarioAprobadoCHILE9512 = /* @__PURE__ */ __name((parte) => parte.UltimoEstadoInterno?.Descripcion === APROBADO || (parte.EstadosInternos ?? []).some((e) => e.Descripcion === APROBADO), "esParteDiarioAprobadoCHILE9512");
|
|
16042
|
+
var esParteDiarioEditableCHILE9512 = /* @__PURE__ */ __name((codigo, parte) => parte ? !esParteDiarioAprobadoCHILE9512(parte) : codigo === codigoParteDiarioHoyCHILE9512(), "esParteDiarioEditableCHILE9512");
|
|
16043
|
+
var tituloFotoParteDiarioCHILE9512 = /* @__PURE__ */ __name((index) => index === 0 ? {
|
|
16044
|
+
Titulo: "Foto Principal",
|
|
16045
|
+
Descripcion: "Foto Cuadrilla"
|
|
16046
|
+
} : {
|
|
16047
|
+
Titulo: `Foto Auxiliar ${index}`,
|
|
16048
|
+
Descripcion: `Foto Auxiliar ${index}`
|
|
16049
|
+
}, "tituloFotoParteDiarioCHILE9512");
|
|
16050
|
+
|
|
15849
16051
|
// src/Programados/BuscarZonaContratista.ts
|
|
15850
16052
|
function BuscarZonaContratista(EmpresaContratistaEnPrecioEspecialidad, Obra, ZonaAsignada) {
|
|
15851
16053
|
const zonaSearchMapping = {
|
|
@@ -16157,15 +16359,6 @@ var CompararFechas = /* @__PURE__ */ __name((Fecha1, Fecha2) => {
|
|
|
16157
16359
|
return fecParteDiario.getTime() === hoy.getTime();
|
|
16158
16360
|
}, "CompararFechas");
|
|
16159
16361
|
|
|
16160
|
-
// src/Programados/Procesos/parteDiario/GetCodigoFechaActual.ts
|
|
16161
|
-
var GetCodigoFechaActual = /* @__PURE__ */ __name((fecha) => {
|
|
16162
|
-
const diaString = fecha ? fecha : /* @__PURE__ */ new Date();
|
|
16163
|
-
const dia = diaString.getDate().toString().padStart(2, "0");
|
|
16164
|
-
const mes = (diaString.getMonth() + 1).toString().padStart(2, "0");
|
|
16165
|
-
const a\u00F1o = diaString.getFullYear().toString();
|
|
16166
|
-
return `${a\u00F1o}${mes}${dia}`;
|
|
16167
|
-
}, "GetCodigoFechaActual");
|
|
16168
|
-
|
|
16169
16362
|
// src/shared/Utils/CurrencyFormat.ts
|
|
16170
16363
|
var Params = class Params2 {
|
|
16171
16364
|
static {
|
|
@@ -16357,14 +16550,6 @@ function getChannelName(id) {
|
|
|
16357
16550
|
}
|
|
16358
16551
|
__name(getChannelName, "getChannelName");
|
|
16359
16552
|
|
|
16360
|
-
// src/shared/Utils/getDateInTimeZone.ts
|
|
16361
|
-
function getDateInTimeZone(timeZone) {
|
|
16362
|
-
return new Date((/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
16363
|
-
timeZone
|
|
16364
|
-
}));
|
|
16365
|
-
}
|
|
16366
|
-
__name(getDateInTimeZone, "getDateInTimeZone");
|
|
16367
|
-
|
|
16368
16553
|
// src/shared/Utils/generateUniqueNumber.ts
|
|
16369
16554
|
function generateUniqueNumber() {
|
|
16370
16555
|
const base = 1e7;
|
|
@@ -17383,12 +17568,18 @@ export {
|
|
|
17383
17568
|
buildReservaMOJobMajorProjectsAlemaniaAL04,
|
|
17384
17569
|
buildTenantCollectionName,
|
|
17385
17570
|
calcularTotalMaterialValorizacionPeru9112,
|
|
17571
|
+
cantidadFijaMOAL04,
|
|
17572
|
+
cantidadMaterialAL04,
|
|
17386
17573
|
checkAndBuildMaterialsFromStock,
|
|
17387
17574
|
checkMaterialAvailability,
|
|
17388
17575
|
codBalizaAL02,
|
|
17389
17576
|
codBalizaAL04,
|
|
17577
|
+
codBalizaPreliquidarAL04,
|
|
17578
|
+
codBaremoUnicoDPAL04,
|
|
17390
17579
|
codClientes,
|
|
17391
17580
|
codIssueByPeriodoAL02,
|
|
17581
|
+
codMOAsfaltoHijasAL04,
|
|
17582
|
+
codMOAsfaltoMadreAL04,
|
|
17392
17583
|
codMOClientesAL02,
|
|
17393
17584
|
codMOClientesAL02Asfaltado,
|
|
17394
17585
|
codMOClientesAL02OC,
|
|
@@ -17404,8 +17595,10 @@ export {
|
|
|
17404
17595
|
codMONoClientesAL02OC,
|
|
17405
17596
|
codMONoClientesAL02Soplado,
|
|
17406
17597
|
codMONoClientes_ReglaLiquidacion1,
|
|
17598
|
+
codMONoPreliquidablesAL04,
|
|
17407
17599
|
codMOOcultosAL04,
|
|
17408
17600
|
codMOPreliquidarTroncalAL02,
|
|
17601
|
+
codMOPreliquidarTroncalAL04,
|
|
17409
17602
|
codMOPublico,
|
|
17410
17603
|
codMOTroncalAL02,
|
|
17411
17604
|
codMOTroncalAL02Asfaltado,
|
|
@@ -17418,8 +17611,10 @@ export {
|
|
|
17418
17611
|
codMOTroncalAL04Soplado,
|
|
17419
17612
|
codMOTroncalHistoricoAL02,
|
|
17420
17613
|
codMOTroncal_ReglaLiquidacion1,
|
|
17614
|
+
codMaterialesOcultosAL04,
|
|
17421
17615
|
codNoCliente,
|
|
17422
17616
|
codSopladoRD,
|
|
17617
|
+
codigoParteDiarioHoyCHILE9512,
|
|
17423
17618
|
codigosBaremosSubcontrataAL02,
|
|
17424
17619
|
codigosMOT1_F2,
|
|
17425
17620
|
codigosMaterialDuctos,
|
|
@@ -17434,9 +17629,14 @@ export {
|
|
|
17434
17629
|
documentRequirementAltasNVT,
|
|
17435
17630
|
empresas,
|
|
17436
17631
|
esAsignacionPreliquidableAL02,
|
|
17632
|
+
esAsignacionPreliquidableAL04,
|
|
17437
17633
|
esCadenaFechaISOValida,
|
|
17634
|
+
esMaterialDuctoAL04,
|
|
17438
17635
|
esObjetoFecha,
|
|
17636
|
+
esParteDiarioAprobadoCHILE9512,
|
|
17637
|
+
esParteDiarioEditableCHILE9512,
|
|
17439
17638
|
estadoRechazadaPorMetraje,
|
|
17639
|
+
estadoRechazadaPorMetrajeAL04,
|
|
17440
17640
|
formatCurrencyV1,
|
|
17441
17641
|
formatNumberSmart,
|
|
17442
17642
|
formatNumberV1,
|
|
@@ -17470,23 +17670,33 @@ export {
|
|
|
17470
17670
|
mapaReglaSopladoClientes,
|
|
17471
17671
|
mapaReglaSopladoTroncal,
|
|
17472
17672
|
mapeoZonasSimilares,
|
|
17673
|
+
materialesAutomaticosAL04,
|
|
17674
|
+
materialesSeleccionablesAL04,
|
|
17675
|
+
modoMaterialesAL04,
|
|
17676
|
+
motivoConsumoAlmacenAL04,
|
|
17473
17677
|
motivoConsumoMaterialAutomaticoDuctos,
|
|
17474
17678
|
newCodMOTroncalReglaLiquidacion1,
|
|
17475
17679
|
obtenerCodMOHomePass,
|
|
17680
|
+
obtenerCodMOHomePassAL04,
|
|
17476
17681
|
obtenerDocumentacionClientes,
|
|
17477
17682
|
obtenerDocumentacionNoClientes,
|
|
17478
17683
|
obtenerEspecialidadesCerradas,
|
|
17684
|
+
obtenerEspecialidadesCerradasAL04,
|
|
17479
17685
|
obtenerPrecioContratistaMaterial,
|
|
17480
17686
|
obtenerPrecioManoObraAL02,
|
|
17481
17687
|
obtenerPrecioManoObraAL04,
|
|
17482
17688
|
obtenerTipoYCodigoMO,
|
|
17483
17689
|
paisMap,
|
|
17484
17690
|
parseDuplicateKeyError,
|
|
17691
|
+
prorratearMaterialesAL04,
|
|
17485
17692
|
roundNumber,
|
|
17486
17693
|
searchCurrentContractorSpecialtyPrice,
|
|
17487
17694
|
setColModels,
|
|
17488
17695
|
setContext,
|
|
17696
|
+
subMaterialesAL04,
|
|
17489
17697
|
throwSomacylError,
|
|
17698
|
+
timeZoneCHILE9512,
|
|
17699
|
+
tituloFotoParteDiarioCHILE9512,
|
|
17490
17700
|
updatePriceContractorMOAL02,
|
|
17491
17701
|
updatePriceContractorMOAL04,
|
|
17492
17702
|
updatePriceMOAL02,
|
|
@@ -17494,6 +17704,7 @@ export {
|
|
|
17494
17704
|
updatePricePBBudgetAlemaniaAL02,
|
|
17495
17705
|
updatePricePBBudgetAlemaniaAL04,
|
|
17496
17706
|
uuidRegex,
|
|
17707
|
+
validarAsfaltoAL04,
|
|
17497
17708
|
validateNoLookup,
|
|
17498
17709
|
validateUUIDv4Param,
|
|
17499
17710
|
verifyDetailsFinalizeSomacyl,
|