sigo-package 1.2.155 → 1.2.157

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 CHANGED
@@ -135,6 +135,81 @@ declare function updatePricePBBudgetAlemaniaAL04(ManoObra: CodigoNombreUMDTO, Ca
135
135
 
136
136
  declare function buildReservaMOJobMajorProjectsAlemaniaAL04(dataMOG: ManoObraGlobalENTITY[], priceContractorMOPropia: PrecioContratistaMOAL04ENTITY, codigoMacroObras: string, ExceptionClass?: new (message?: string, messageSigo?: boolean) => Error): ValorizacionManoObraDTO[];
137
137
 
138
+ declare const CalcularResumenValorizacionesAlemania: Funcion$5;
139
+ interface Funcion$5 {
140
+ (trabajo: TrabajoType$2, trabajos: any[]): ResumenLiquidacionesType;
141
+ }
142
+ interface ResumenLiquidacionesType {
143
+ MoUo: MoUoType$2[];
144
+ MatUtilizados: MatUtilizadosType$2[];
145
+ MatRetirados: MatRetiradosType[];
146
+ MatStockPersonal: MatStockPersonalType$2[];
147
+ MatStockAlmacen: MatStockAlmacenType[];
148
+ }
149
+ interface MatStockPersonalType$2 {
150
+ ID_Trabajo: number;
151
+ Identificacion: string;
152
+ Codigo: string;
153
+ CodigoLlave: string;
154
+ Cantidad: number;
155
+ }
156
+ interface MatStockAlmacenType {
157
+ ID_Trabajo: number;
158
+ CodigoLlave: string;
159
+ Codigo: string;
160
+ Cantidad: number;
161
+ Empresa: string;
162
+ }
163
+ interface MatRetiradosType {
164
+ Codigo: string;
165
+ Cantidad: number;
166
+ }
167
+ interface MatUtilizadosType$2 {
168
+ Codigo: string;
169
+ Cantidad: number;
170
+ }
171
+ interface MoUoType$2 {
172
+ LineaCodigoCub: string;
173
+ Cantidad: number;
174
+ CantidadUO: number;
175
+ }
176
+ interface TrabajoType$2 {
177
+ ID_Trabajo: number;
178
+ Ultima_PreLiquidacion: PreLiquidacionType$2;
179
+ }
180
+ interface PreLiquidacionType$2 {
181
+ Valorizacion: ValorizacionType$2[];
182
+ }
183
+ interface ValorizacionType$2 {
184
+ }
185
+
186
+ interface IResultadoValidacionMOHijas {
187
+ CodigoMOMadre: string;
188
+ CodigoMOHija: string;
189
+ TotalMadreUsado: number;
190
+ TotalHijaUsado: number;
191
+ DiferenciaExcedida: number;
192
+ LineasMadre: ILineaValidacion[];
193
+ LineasHija: ILineaValidacion[];
194
+ }
195
+ interface ILineaValidacion {
196
+ LineaCodigoCub: string;
197
+ Codigo: string;
198
+ Descripcion: string;
199
+ CantidadUsado: number;
200
+ }
201
+ /**
202
+ * Valida que el total preliquidado de MO hijas no supere al de sus MO madres.
203
+ *
204
+ * @param moUo — Suma de TODAS las valorizaciones de TODOS los trabajos de la obra
205
+ * (viene de CalcularResumenValorizacionesAlemania).
206
+ * Ya excluye INACTIVAS y certificaciones con Mes != 0.
207
+ * @param manoObraDB — Solo se usa como diccionario LineaCodigoCub → Codigo.
208
+ * NO se usa para cantidades.
209
+ */
210
+ declare function ValidarRelacionMOHijasAL04(moUo: MoUoType$2[], manoObraDB: any): IResultadoValidacionMOHijas[];
211
+ declare function FormatearErrorValidacionMOHijas(violaciones: IResultadoValidacionMOHijas[]): string | null;
212
+
138
213
  declare const codMOTroncalAL02OC: never[];
139
214
  declare const codMOTroncalAL02Soplado: never[];
140
215
  declare const codMOTroncalAL02Asfaltado: never[];
@@ -267,54 +342,6 @@ interface IDocumentacion {
267
342
  }
268
343
  declare const UpdateNodosDocDP: <T extends IDocumentacion>({ documentacion, obra, trabajo }: params$1<T>) => T;
269
344
 
270
- declare const CalcularResumenValorizacionesAlemania: Funcion$5;
271
- interface Funcion$5 {
272
- (trabajo: TrabajoType$2, trabajos: any[]): ResumenLiquidacionesType;
273
- }
274
- interface ResumenLiquidacionesType {
275
- MoUo: MoUoType$2[];
276
- MatUtilizados: MatUtilizadosType$2[];
277
- MatRetirados: MatRetiradosType[];
278
- MatStockPersonal: MatStockPersonalType$2[];
279
- MatStockAlmacen: MatStockAlmacenType[];
280
- }
281
- interface MatStockPersonalType$2 {
282
- ID_Trabajo: number;
283
- Identificacion: string;
284
- Codigo: string;
285
- CodigoLlave: string;
286
- Cantidad: number;
287
- }
288
- interface MatStockAlmacenType {
289
- ID_Trabajo: number;
290
- CodigoLlave: string;
291
- Codigo: string;
292
- Cantidad: number;
293
- Empresa: string;
294
- }
295
- interface MatRetiradosType {
296
- Codigo: string;
297
- Cantidad: number;
298
- }
299
- interface MatUtilizadosType$2 {
300
- Codigo: string;
301
- Cantidad: number;
302
- }
303
- interface MoUoType$2 {
304
- LineaCodigoCub: string;
305
- Cantidad: number;
306
- CantidadUO: number;
307
- }
308
- interface TrabajoType$2 {
309
- ID_Trabajo: number;
310
- Ultima_PreLiquidacion: PreLiquidacionType$2;
311
- }
312
- interface PreLiquidacionType$2 {
313
- Valorizacion: ValorizacionType$2[];
314
- }
315
- interface ValorizacionType$2 {
316
- }
317
-
318
345
  declare const ActualizarDataResumenValorizacionesAlemania: Funcion$4;
319
346
  interface Funcion$4 {
320
347
  (ManoObra: any, Reserva: any, StockPersonal: any[], ResumenPreLiquidado: ResumenLiquidacionesType): void;
@@ -776,6 +803,8 @@ declare const collections: Readonly<{
776
803
  PERU_9112_BantelOrderStock: "PERU_9112_BantelOrderStock";
777
804
  PERU_9112_ClaroOrder: "PERU_9112_ClaroOrder";
778
805
  PERU_9112_ClaroOrderStock: "PERU_9112_ClaroOrderStock";
806
+ CHILE_9512_ToaRequestNumberTTL: "CHILE_9512_ToaRequestNumberTTL";
807
+ COLOMBIA_9612_ToaRequestNumberTTL: "COLOMBIA_9612_ToaRequestNumberTTL";
779
808
  user: "users";
780
809
  systemOption: "systemOptions";
781
810
  profile: "profiles";
@@ -822,4 +851,4 @@ declare const buildMenu: (data: SystemOptionEntity[], t: TranslateFn) => MenuDto
822
851
 
823
852
  declare function validateUUIDv4Param(BadRequestException: ClassConstructor<Error>, req: Request<any>, _res: Response, next: NextFunction): Promise<void>;
824
853
 
825
- export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, 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, type TARGET, UpdateNodosDocDP, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL04, codClientes, codIssueByPeriodoAL02, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, empresas, esCadenaFechaISOValida, esObjetoFecha, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getChannelName, getContainerName, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, newCodMOTroncalReglaLiquidacion1, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validateNoLookup, validateUUIDv4Param };
854
+ export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, 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, type TARGET, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL04, codClientes, codIssueByPeriodoAL02, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, empresas, esCadenaFechaISOValida, esObjetoFecha, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getChannelName, getContainerName, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, newCodMOTroncalReglaLiquidacion1, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validateNoLookup, validateUUIDv4Param };
package/dist/index.d.ts CHANGED
@@ -135,6 +135,81 @@ declare function updatePricePBBudgetAlemaniaAL04(ManoObra: CodigoNombreUMDTO, Ca
135
135
 
136
136
  declare function buildReservaMOJobMajorProjectsAlemaniaAL04(dataMOG: ManoObraGlobalENTITY[], priceContractorMOPropia: PrecioContratistaMOAL04ENTITY, codigoMacroObras: string, ExceptionClass?: new (message?: string, messageSigo?: boolean) => Error): ValorizacionManoObraDTO[];
137
137
 
138
+ declare const CalcularResumenValorizacionesAlemania: Funcion$5;
139
+ interface Funcion$5 {
140
+ (trabajo: TrabajoType$2, trabajos: any[]): ResumenLiquidacionesType;
141
+ }
142
+ interface ResumenLiquidacionesType {
143
+ MoUo: MoUoType$2[];
144
+ MatUtilizados: MatUtilizadosType$2[];
145
+ MatRetirados: MatRetiradosType[];
146
+ MatStockPersonal: MatStockPersonalType$2[];
147
+ MatStockAlmacen: MatStockAlmacenType[];
148
+ }
149
+ interface MatStockPersonalType$2 {
150
+ ID_Trabajo: number;
151
+ Identificacion: string;
152
+ Codigo: string;
153
+ CodigoLlave: string;
154
+ Cantidad: number;
155
+ }
156
+ interface MatStockAlmacenType {
157
+ ID_Trabajo: number;
158
+ CodigoLlave: string;
159
+ Codigo: string;
160
+ Cantidad: number;
161
+ Empresa: string;
162
+ }
163
+ interface MatRetiradosType {
164
+ Codigo: string;
165
+ Cantidad: number;
166
+ }
167
+ interface MatUtilizadosType$2 {
168
+ Codigo: string;
169
+ Cantidad: number;
170
+ }
171
+ interface MoUoType$2 {
172
+ LineaCodigoCub: string;
173
+ Cantidad: number;
174
+ CantidadUO: number;
175
+ }
176
+ interface TrabajoType$2 {
177
+ ID_Trabajo: number;
178
+ Ultima_PreLiquidacion: PreLiquidacionType$2;
179
+ }
180
+ interface PreLiquidacionType$2 {
181
+ Valorizacion: ValorizacionType$2[];
182
+ }
183
+ interface ValorizacionType$2 {
184
+ }
185
+
186
+ interface IResultadoValidacionMOHijas {
187
+ CodigoMOMadre: string;
188
+ CodigoMOHija: string;
189
+ TotalMadreUsado: number;
190
+ TotalHijaUsado: number;
191
+ DiferenciaExcedida: number;
192
+ LineasMadre: ILineaValidacion[];
193
+ LineasHija: ILineaValidacion[];
194
+ }
195
+ interface ILineaValidacion {
196
+ LineaCodigoCub: string;
197
+ Codigo: string;
198
+ Descripcion: string;
199
+ CantidadUsado: number;
200
+ }
201
+ /**
202
+ * Valida que el total preliquidado de MO hijas no supere al de sus MO madres.
203
+ *
204
+ * @param moUo — Suma de TODAS las valorizaciones de TODOS los trabajos de la obra
205
+ * (viene de CalcularResumenValorizacionesAlemania).
206
+ * Ya excluye INACTIVAS y certificaciones con Mes != 0.
207
+ * @param manoObraDB — Solo se usa como diccionario LineaCodigoCub → Codigo.
208
+ * NO se usa para cantidades.
209
+ */
210
+ declare function ValidarRelacionMOHijasAL04(moUo: MoUoType$2[], manoObraDB: any): IResultadoValidacionMOHijas[];
211
+ declare function FormatearErrorValidacionMOHijas(violaciones: IResultadoValidacionMOHijas[]): string | null;
212
+
138
213
  declare const codMOTroncalAL02OC: never[];
139
214
  declare const codMOTroncalAL02Soplado: never[];
140
215
  declare const codMOTroncalAL02Asfaltado: never[];
@@ -267,54 +342,6 @@ interface IDocumentacion {
267
342
  }
268
343
  declare const UpdateNodosDocDP: <T extends IDocumentacion>({ documentacion, obra, trabajo }: params$1<T>) => T;
269
344
 
270
- declare const CalcularResumenValorizacionesAlemania: Funcion$5;
271
- interface Funcion$5 {
272
- (trabajo: TrabajoType$2, trabajos: any[]): ResumenLiquidacionesType;
273
- }
274
- interface ResumenLiquidacionesType {
275
- MoUo: MoUoType$2[];
276
- MatUtilizados: MatUtilizadosType$2[];
277
- MatRetirados: MatRetiradosType[];
278
- MatStockPersonal: MatStockPersonalType$2[];
279
- MatStockAlmacen: MatStockAlmacenType[];
280
- }
281
- interface MatStockPersonalType$2 {
282
- ID_Trabajo: number;
283
- Identificacion: string;
284
- Codigo: string;
285
- CodigoLlave: string;
286
- Cantidad: number;
287
- }
288
- interface MatStockAlmacenType {
289
- ID_Trabajo: number;
290
- CodigoLlave: string;
291
- Codigo: string;
292
- Cantidad: number;
293
- Empresa: string;
294
- }
295
- interface MatRetiradosType {
296
- Codigo: string;
297
- Cantidad: number;
298
- }
299
- interface MatUtilizadosType$2 {
300
- Codigo: string;
301
- Cantidad: number;
302
- }
303
- interface MoUoType$2 {
304
- LineaCodigoCub: string;
305
- Cantidad: number;
306
- CantidadUO: number;
307
- }
308
- interface TrabajoType$2 {
309
- ID_Trabajo: number;
310
- Ultima_PreLiquidacion: PreLiquidacionType$2;
311
- }
312
- interface PreLiquidacionType$2 {
313
- Valorizacion: ValorizacionType$2[];
314
- }
315
- interface ValorizacionType$2 {
316
- }
317
-
318
345
  declare const ActualizarDataResumenValorizacionesAlemania: Funcion$4;
319
346
  interface Funcion$4 {
320
347
  (ManoObra: any, Reserva: any, StockPersonal: any[], ResumenPreLiquidado: ResumenLiquidacionesType): void;
@@ -776,6 +803,8 @@ declare const collections: Readonly<{
776
803
  PERU_9112_BantelOrderStock: "PERU_9112_BantelOrderStock";
777
804
  PERU_9112_ClaroOrder: "PERU_9112_ClaroOrder";
778
805
  PERU_9112_ClaroOrderStock: "PERU_9112_ClaroOrderStock";
806
+ CHILE_9512_ToaRequestNumberTTL: "CHILE_9512_ToaRequestNumberTTL";
807
+ COLOMBIA_9612_ToaRequestNumberTTL: "COLOMBIA_9612_ToaRequestNumberTTL";
779
808
  user: "users";
780
809
  systemOption: "systemOptions";
781
810
  profile: "profiles";
@@ -822,4 +851,4 @@ declare const buildMenu: (data: SystemOptionEntity[], t: TranslateFn) => MenuDto
822
851
 
823
852
  declare function validateUUIDv4Param(BadRequestException: ClassConstructor<Error>, req: Request<any>, _res: Response, next: NextFunction): Promise<void>;
824
853
 
825
- export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, 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, type TARGET, UpdateNodosDocDP, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL04, codClientes, codIssueByPeriodoAL02, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, empresas, esCadenaFechaISOValida, esObjetoFecha, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getChannelName, getContainerName, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, newCodMOTroncalReglaLiquidacion1, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validateNoLookup, validateUUIDv4Param };
854
+ export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, 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, type TARGET, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL04, codClientes, codIssueByPeriodoAL02, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, empresas, esCadenaFechaISOValida, esObjetoFecha, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getChannelName, getContainerName, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, newCodMOTroncalReglaLiquidacion1, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validateNoLookup, validateUUIDv4Param };
package/dist/index.js CHANGED
@@ -47,6 +47,7 @@ __export(index_exports, {
47
47
  CurrencyFormat: () => CurrencyFormat,
48
48
  DocumentacionReplanteo: () => DocumentacionReplanteo,
49
49
  EstadoEspecialidad9612: () => EstadoEspecialidad9612,
50
+ FormatearErrorValidacionMOHijas: () => FormatearErrorValidacionMOHijas,
50
51
  GemeindeChangeNomenclatura: () => GemeindeChangeNomenclatura,
51
52
  GetCodigoFechaActual: () => GetCodigoFechaActual,
52
53
  MOCantidadNVT01: () => MOCantidadNVT01,
@@ -61,6 +62,7 @@ __export(index_exports, {
61
62
  ObtenerZonaAsignada: () => ObtenerZonaAsignada,
62
63
  SEGMENT_TY: () => SEGMENT_TY,
63
64
  UpdateNodosDocDP: () => UpdateNodosDocDP,
65
+ ValidarRelacionMOHijasAL04: () => ValidarRelacionMOHijasAL04,
64
66
  ValorizacionHelper: () => ValorizacionHelper,
65
67
  builSystemOption: () => builSystemOption,
66
68
  buildDataMOFromMaterialRules: () => buildDataMOFromMaterialRules,
@@ -3786,7 +3788,7 @@ var switchTipo = {
3786
3788
  function obtenerTipoYCodigoMO(codigoOriginal) {
3787
3789
  let CodigoMO = codigoOriginal;
3788
3790
  let TipoMO = null;
3789
- if (CodigoMO.includes("T_") || CodigoMO.includes("F_")) {
3791
+ if (/^[FT]\d+_/.test(CodigoMO)) {
3790
3792
  const letraTipo = CodigoMO.split("_")[0].slice(0, 1);
3791
3793
  TipoMO = switchTipo[letraTipo];
3792
3794
  if (!TipoMO) {
@@ -4033,6 +4035,75 @@ function buildReservaMOJobMajorProjectsAlemaniaAL04(dataMOG, priceContractorMOPr
4033
4035
  }
4034
4036
  __name(buildReservaMOJobMajorProjectsAlemaniaAL04, "buildReservaMOJobMajorProjectsAlemaniaAL04");
4035
4037
 
4038
+ // src/Programados/Alemania/AL04/ValidarRelacionMOHijasAL04.ts
4039
+ function ValidarRelacionMOHijasAL04(moUo, manoObraDB) {
4040
+ const violaciones = [];
4041
+ if (!manoObraDB?.Valorizacion || !Array.isArray(manoObraDB.Valorizacion)) {
4042
+ return violaciones;
4043
+ }
4044
+ const mapaLineaACodigo = /* @__PURE__ */ new Map();
4045
+ for (const val of manoObraDB.Valorizacion) {
4046
+ const lcc = val.DetalleChile?.LineaCodigoCub;
4047
+ if (lcc) mapaLineaACodigo.set(lcc, {
4048
+ codigo: val.Codigo,
4049
+ descripcion: val.Descripcion || ""
4050
+ });
4051
+ }
4052
+ for (const regla of MOHijasAL04) {
4053
+ const { CodigoMOMadre, CodigoMOHija } = regla;
4054
+ let totalMadre = 0;
4055
+ const detalleMadre = [];
4056
+ let totalHija = 0;
4057
+ const detalleHija = [];
4058
+ for (const item of moUo) {
4059
+ const info = mapaLineaACodigo.get(item.LineaCodigoCub);
4060
+ if (!info) continue;
4061
+ if (info.codigo === CodigoMOMadre) {
4062
+ totalMadre += item.Cantidad;
4063
+ detalleMadre.push({
4064
+ LineaCodigoCub: item.LineaCodigoCub,
4065
+ Codigo: info.codigo,
4066
+ Descripcion: info.descripcion,
4067
+ CantidadUsado: item.Cantidad
4068
+ });
4069
+ }
4070
+ if (info.codigo === CodigoMOHija) {
4071
+ totalHija += item.Cantidad;
4072
+ detalleHija.push({
4073
+ LineaCodigoCub: item.LineaCodigoCub,
4074
+ Codigo: info.codigo,
4075
+ Descripcion: info.descripcion,
4076
+ CantidadUsado: item.Cantidad
4077
+ });
4078
+ }
4079
+ }
4080
+ if (totalHija > totalMadre) {
4081
+ violaciones.push({
4082
+ CodigoMOMadre,
4083
+ CodigoMOHija,
4084
+ TotalMadreUsado: totalMadre,
4085
+ TotalHijaUsado: totalHija,
4086
+ DiferenciaExcedida: totalHija - totalMadre,
4087
+ LineasMadre: detalleMadre,
4088
+ LineasHija: detalleHija
4089
+ });
4090
+ }
4091
+ }
4092
+ return violaciones;
4093
+ }
4094
+ __name(ValidarRelacionMOHijasAL04, "ValidarRelacionMOHijasAL04");
4095
+ function FormatearErrorValidacionMOHijas(violaciones) {
4096
+ if (!violaciones.length) return null;
4097
+ return violaciones.map((v) => {
4098
+ const descMadre = v.LineasMadre[0]?.Descripcion || v.CodigoMOMadre;
4099
+ const descHija = v.LineasHija[0]?.Descripcion || v.CodigoMOHija;
4100
+ return `No se puede preliquidar porque la cantidad total de ${descHija} (${v.CodigoMOHija}: ${v.TotalHijaUsado.toFixed(2)}) supera la cantidad de ${descMadre} (${v.CodigoMOMadre}: ${v.TotalMadreUsado.toFixed(2)}) preliquidada en esta obra.
4101
+ Excedente: ${v.DiferenciaExcedida.toFixed(2)}.
4102
+ Debe preliquidar primero al menos ${v.DiferenciaExcedida.toFixed(2)} de ${v.CodigoMOMadre} antes de agregar m\xE1s ${v.CodigoMOHija}.`;
4103
+ }).join("\n\n");
4104
+ }
4105
+ __name(FormatearErrorValidacionMOHijas, "FormatearErrorValidacionMOHijas");
4106
+
4036
4107
  // src/Programados/Alemania/codMOTroncal_ReglaLiquidacion1.ts
4037
4108
  var codMOTroncal_ReglaLiquidacion1 = [
4038
4109
  "011304100",
@@ -16829,6 +16900,8 @@ var collections = Object.freeze({
16829
16900
  PERU_9112_BantelOrderStock: "PERU_9112_BantelOrderStock",
16830
16901
  PERU_9112_ClaroOrder: "PERU_9112_ClaroOrder",
16831
16902
  PERU_9112_ClaroOrderStock: "PERU_9112_ClaroOrderStock",
16903
+ CHILE_9512_ToaRequestNumberTTL: "CHILE_9512_ToaRequestNumberTTL",
16904
+ COLOMBIA_9612_ToaRequestNumberTTL: "COLOMBIA_9612_ToaRequestNumberTTL",
16832
16905
  user: "users",
16833
16906
  systemOption: "systemOptions",
16834
16907
  profile: "profiles",
@@ -17003,6 +17076,7 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
17003
17076
  CurrencyFormat,
17004
17077
  DocumentacionReplanteo,
17005
17078
  EstadoEspecialidad9612,
17079
+ FormatearErrorValidacionMOHijas,
17006
17080
  GemeindeChangeNomenclatura,
17007
17081
  GetCodigoFechaActual,
17008
17082
  MOCantidadNVT01,
@@ -17017,6 +17091,7 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
17017
17091
  ObtenerZonaAsignada,
17018
17092
  SEGMENT_TY,
17019
17093
  UpdateNodosDocDP,
17094
+ ValidarRelacionMOHijasAL04,
17020
17095
  ValorizacionHelper,
17021
17096
  builSystemOption,
17022
17097
  buildDataMOFromMaterialRules,
package/dist/index.mjs CHANGED
@@ -3617,7 +3617,7 @@ var switchTipo = {
3617
3617
  function obtenerTipoYCodigoMO(codigoOriginal) {
3618
3618
  let CodigoMO = codigoOriginal;
3619
3619
  let TipoMO = null;
3620
- if (CodigoMO.includes("T_") || CodigoMO.includes("F_")) {
3620
+ if (/^[FT]\d+_/.test(CodigoMO)) {
3621
3621
  const letraTipo = CodigoMO.split("_")[0].slice(0, 1);
3622
3622
  TipoMO = switchTipo[letraTipo];
3623
3623
  if (!TipoMO) {
@@ -3864,6 +3864,75 @@ function buildReservaMOJobMajorProjectsAlemaniaAL04(dataMOG, priceContractorMOPr
3864
3864
  }
3865
3865
  __name(buildReservaMOJobMajorProjectsAlemaniaAL04, "buildReservaMOJobMajorProjectsAlemaniaAL04");
3866
3866
 
3867
+ // src/Programados/Alemania/AL04/ValidarRelacionMOHijasAL04.ts
3868
+ function ValidarRelacionMOHijasAL04(moUo, manoObraDB) {
3869
+ const violaciones = [];
3870
+ if (!manoObraDB?.Valorizacion || !Array.isArray(manoObraDB.Valorizacion)) {
3871
+ return violaciones;
3872
+ }
3873
+ const mapaLineaACodigo = /* @__PURE__ */ new Map();
3874
+ for (const val of manoObraDB.Valorizacion) {
3875
+ const lcc = val.DetalleChile?.LineaCodigoCub;
3876
+ if (lcc) mapaLineaACodigo.set(lcc, {
3877
+ codigo: val.Codigo,
3878
+ descripcion: val.Descripcion || ""
3879
+ });
3880
+ }
3881
+ for (const regla of MOHijasAL04) {
3882
+ const { CodigoMOMadre, CodigoMOHija } = regla;
3883
+ let totalMadre = 0;
3884
+ const detalleMadre = [];
3885
+ let totalHija = 0;
3886
+ const detalleHija = [];
3887
+ for (const item of moUo) {
3888
+ const info = mapaLineaACodigo.get(item.LineaCodigoCub);
3889
+ if (!info) continue;
3890
+ if (info.codigo === CodigoMOMadre) {
3891
+ totalMadre += item.Cantidad;
3892
+ detalleMadre.push({
3893
+ LineaCodigoCub: item.LineaCodigoCub,
3894
+ Codigo: info.codigo,
3895
+ Descripcion: info.descripcion,
3896
+ CantidadUsado: item.Cantidad
3897
+ });
3898
+ }
3899
+ if (info.codigo === CodigoMOHija) {
3900
+ totalHija += item.Cantidad;
3901
+ detalleHija.push({
3902
+ LineaCodigoCub: item.LineaCodigoCub,
3903
+ Codigo: info.codigo,
3904
+ Descripcion: info.descripcion,
3905
+ CantidadUsado: item.Cantidad
3906
+ });
3907
+ }
3908
+ }
3909
+ if (totalHija > totalMadre) {
3910
+ violaciones.push({
3911
+ CodigoMOMadre,
3912
+ CodigoMOHija,
3913
+ TotalMadreUsado: totalMadre,
3914
+ TotalHijaUsado: totalHija,
3915
+ DiferenciaExcedida: totalHija - totalMadre,
3916
+ LineasMadre: detalleMadre,
3917
+ LineasHija: detalleHija
3918
+ });
3919
+ }
3920
+ }
3921
+ return violaciones;
3922
+ }
3923
+ __name(ValidarRelacionMOHijasAL04, "ValidarRelacionMOHijasAL04");
3924
+ function FormatearErrorValidacionMOHijas(violaciones) {
3925
+ if (!violaciones.length) return null;
3926
+ return violaciones.map((v) => {
3927
+ const descMadre = v.LineasMadre[0]?.Descripcion || v.CodigoMOMadre;
3928
+ const descHija = v.LineasHija[0]?.Descripcion || v.CodigoMOHija;
3929
+ return `No se puede preliquidar porque la cantidad total de ${descHija} (${v.CodigoMOHija}: ${v.TotalHijaUsado.toFixed(2)}) supera la cantidad de ${descMadre} (${v.CodigoMOMadre}: ${v.TotalMadreUsado.toFixed(2)}) preliquidada en esta obra.
3930
+ Excedente: ${v.DiferenciaExcedida.toFixed(2)}.
3931
+ Debe preliquidar primero al menos ${v.DiferenciaExcedida.toFixed(2)} de ${v.CodigoMOMadre} antes de agregar m\xE1s ${v.CodigoMOHija}.`;
3932
+ }).join("\n\n");
3933
+ }
3934
+ __name(FormatearErrorValidacionMOHijas, "FormatearErrorValidacionMOHijas");
3935
+
3867
3936
  // src/Programados/Alemania/codMOTroncal_ReglaLiquidacion1.ts
3868
3937
  var codMOTroncal_ReglaLiquidacion1 = [
3869
3938
  "011304100",
@@ -16660,6 +16729,8 @@ var collections = Object.freeze({
16660
16729
  PERU_9112_BantelOrderStock: "PERU_9112_BantelOrderStock",
16661
16730
  PERU_9112_ClaroOrder: "PERU_9112_ClaroOrder",
16662
16731
  PERU_9112_ClaroOrderStock: "PERU_9112_ClaroOrderStock",
16732
+ CHILE_9512_ToaRequestNumberTTL: "CHILE_9512_ToaRequestNumberTTL",
16733
+ COLOMBIA_9612_ToaRequestNumberTTL: "COLOMBIA_9612_ToaRequestNumberTTL",
16663
16734
  user: "users",
16664
16735
  systemOption: "systemOptions",
16665
16736
  profile: "profiles",
@@ -16833,6 +16904,7 @@ export {
16833
16904
  CurrencyFormat,
16834
16905
  DocumentacionReplanteo,
16835
16906
  EstadoEspecialidad9612,
16907
+ FormatearErrorValidacionMOHijas,
16836
16908
  GemeindeChangeNomenclatura,
16837
16909
  GetCodigoFechaActual,
16838
16910
  MOCantidadNVT01,
@@ -16847,6 +16919,7 @@ export {
16847
16919
  ObtenerZonaAsignada,
16848
16920
  SEGMENT_TY,
16849
16921
  UpdateNodosDocDP,
16922
+ ValidarRelacionMOHijasAL04,
16850
16923
  ValorizacionHelper,
16851
16924
  builSystemOption,
16852
16925
  buildDataMOFromMaterialRules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigo-package",
3
- "version": "1.2.155",
3
+ "version": "1.2.157",
4
4
  "description": "Funciones compartidas sigo",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",