sigo-package 1.2.4 → 1.2.5
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 +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +69 -17
- package/dist/index.mjs +63 -14
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -263,11 +263,17 @@ type ReglaSoplado = {
|
|
|
263
263
|
declare const mapaReglaSopladoTroncal: Map<string, ReglaSoplado[]>;
|
|
264
264
|
declare const mapaReglaSopladoClientes: Map<string, ReglaSoplado[]>;
|
|
265
265
|
|
|
266
|
-
declare function
|
|
266
|
+
declare function updatePriceContractorMOAL02(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'PrecioContrata' | 'TotalContrata' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
267
267
|
|
|
268
|
-
declare function
|
|
268
|
+
declare function updatePriceMOAL02(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'Precio' | 'Total' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
269
269
|
|
|
270
|
-
declare function
|
|
270
|
+
declare function obtenerPrecioManoObraAL02(CodigoMO: string, TipoMO: string | null, priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): number;
|
|
271
|
+
|
|
272
|
+
declare function updatePriceContractorMOAL04(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'PrecioContrata' | 'TotalContrata' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
273
|
+
|
|
274
|
+
declare function updatePriceMOAL04(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'Precio' | 'Total' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
275
|
+
|
|
276
|
+
declare function obtenerPrecioManoObraAL04(CodigoMO: string, TipoMO: string | null, priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): number;
|
|
271
277
|
|
|
272
278
|
declare function obtenerTipoYCodigoMO(codigoOriginal: string): {
|
|
273
279
|
TipoMO: string | null;
|
|
@@ -446,4 +452,4 @@ declare function getDateInTimeZone(timeZone: TimeZone): Date;
|
|
|
446
452
|
|
|
447
453
|
declare function generateUniqueNumber(): number;
|
|
448
454
|
|
|
449
|
-
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenValorizacionesAlemania, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, GetCodigoFechaActual, type IDocumentacion, type IMO, type IMaterial, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$1 as MatStockPersonalType, type MatUtilizadosType$1 as MatUtilizadosType, type MoUoType$1 as MoUoType, ModelDataFlujosDocumentacionReplanteo, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, SEGMENT_TY, type TARGET, UpdateNodosDocDP, codBalizaAL04, codClientes, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, convertDates, dataFlujosHomePass, esCadenaFechaISOValida, esObjetoFecha, generateUniqueNumber, getChannelName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getQueueName, getQueueNameSaveOneNotification, isValidDate, isValidPartialEntity, logTiempoProceso, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes,
|
|
455
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenValorizacionesAlemania, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, GetCodigoFechaActual, type IDocumentacion, type IMO, type IMaterial, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$1 as MatStockPersonalType, type MatUtilizadosType$1 as MatUtilizadosType, type MoUoType$1 as MoUoType, ModelDataFlujosDocumentacionReplanteo, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, SEGMENT_TY, type TARGET, UpdateNodosDocDP, codBalizaAL04, codClientes, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, convertDates, dataFlujosHomePass, esCadenaFechaISOValida, esObjetoFecha, generateUniqueNumber, getChannelName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getQueueName, getQueueNameSaveOneNotification, isValidDate, isValidPartialEntity, logTiempoProceso, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, searchCurrentContractorSpecialtyPrice, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, validateNoLookup };
|
package/dist/index.d.ts
CHANGED
|
@@ -263,11 +263,17 @@ type ReglaSoplado = {
|
|
|
263
263
|
declare const mapaReglaSopladoTroncal: Map<string, ReglaSoplado[]>;
|
|
264
264
|
declare const mapaReglaSopladoClientes: Map<string, ReglaSoplado[]>;
|
|
265
265
|
|
|
266
|
-
declare function
|
|
266
|
+
declare function updatePriceContractorMOAL02(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'PrecioContrata' | 'TotalContrata' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
267
267
|
|
|
268
|
-
declare function
|
|
268
|
+
declare function updatePriceMOAL02(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'Precio' | 'Total' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
269
269
|
|
|
270
|
-
declare function
|
|
270
|
+
declare function obtenerPrecioManoObraAL02(CodigoMO: string, TipoMO: string | null, priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): number;
|
|
271
|
+
|
|
272
|
+
declare function updatePriceContractorMOAL04(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'PrecioContrata' | 'TotalContrata' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
273
|
+
|
|
274
|
+
declare function updatePriceMOAL04(valorizaciones: Pick<ValorizacionDTO, 'Ultimo_Estado_Interno' | 'DetalleChile' | 'Precio' | 'Total' | 'Cantidad'>[], priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): void;
|
|
275
|
+
|
|
276
|
+
declare function obtenerPrecioManoObraAL04(CodigoMO: string, TipoMO: string | null, priceContractorMO: Pick<PrecioContratistaMOAL02ENTITY, 'ManoObraGlobal' | 'Empresa'>): number;
|
|
271
277
|
|
|
272
278
|
declare function obtenerTipoYCodigoMO(codigoOriginal: string): {
|
|
273
279
|
TipoMO: string | null;
|
|
@@ -446,4 +452,4 @@ declare function getDateInTimeZone(timeZone: TimeZone): Date;
|
|
|
446
452
|
|
|
447
453
|
declare function generateUniqueNumber(): number;
|
|
448
454
|
|
|
449
|
-
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenValorizacionesAlemania, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, GetCodigoFechaActual, type IDocumentacion, type IMO, type IMaterial, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$1 as MatStockPersonalType, type MatUtilizadosType$1 as MatUtilizadosType, type MoUoType$1 as MoUoType, ModelDataFlujosDocumentacionReplanteo, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, SEGMENT_TY, type TARGET, UpdateNodosDocDP, codBalizaAL04, codClientes, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, convertDates, dataFlujosHomePass, esCadenaFechaISOValida, esObjetoFecha, generateUniqueNumber, getChannelName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getQueueName, getQueueNameSaveOneNotification, isValidDate, isValidPartialEntity, logTiempoProceso, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes,
|
|
455
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenValorizacionesAlemania, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, GetCodigoFechaActual, type IDocumentacion, type IMO, type IMaterial, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$1 as MatStockPersonalType, type MatUtilizadosType$1 as MatUtilizadosType, type MoUoType$1 as MoUoType, ModelDataFlujosDocumentacionReplanteo, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, SEGMENT_TY, type TARGET, UpdateNodosDocDP, codBalizaAL04, codClientes, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOFTTFAL04, codMONoClientes_ReglaLiquidacion1, codMOOcultosAL04, codMOPublico, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, convertDates, dataFlujosHomePass, esCadenaFechaISOValida, esObjetoFecha, generateUniqueNumber, getChannelName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getQueueName, getQueueNameSaveOneNotification, isValidDate, isValidPartialEntity, logTiempoProceso, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, searchCurrentContractorSpecialtyPrice, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, validateNoLookup };
|
package/dist/index.js
CHANGED
|
@@ -93,12 +93,15 @@ __export(index_exports, {
|
|
|
93
93
|
mapaReglaSopladoTroncal: () => mapaReglaSopladoTroncal,
|
|
94
94
|
obtenerDocumentacionClientes: () => obtenerDocumentacionClientes,
|
|
95
95
|
obtenerDocumentacionNoClientes: () => obtenerDocumentacionNoClientes,
|
|
96
|
-
|
|
96
|
+
obtenerPrecioManoObraAL02: () => obtenerPrecioManoObraAL02,
|
|
97
|
+
obtenerPrecioManoObraAL04: () => obtenerPrecioManoObraAL04,
|
|
97
98
|
obtenerTipoYCodigoMO: () => obtenerTipoYCodigoMO,
|
|
98
99
|
paisMap: () => paisMap,
|
|
99
100
|
searchCurrentContractorSpecialtyPrice: () => searchCurrentContractorSpecialtyPrice,
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
updatePriceContractorMOAL02: () => updatePriceContractorMOAL02,
|
|
102
|
+
updatePriceContractorMOAL04: () => updatePriceContractorMOAL04,
|
|
103
|
+
updatePriceMOAL02: () => updatePriceMOAL02,
|
|
104
|
+
updatePriceMOAL04: () => updatePriceMOAL04,
|
|
102
105
|
validateNoLookup: () => validateNoLookup
|
|
103
106
|
});
|
|
104
107
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -5303,8 +5306,8 @@ function obtenerTipoYCodigoMO(codigoOriginal) {
|
|
|
5303
5306
|
}
|
|
5304
5307
|
__name(obtenerTipoYCodigoMO, "obtenerTipoYCodigoMO");
|
|
5305
5308
|
|
|
5306
|
-
// src/Programados/Alemania/
|
|
5307
|
-
function
|
|
5309
|
+
// src/Programados/Alemania/obtenerPrecioManoObraAL02.ts
|
|
5310
|
+
function obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO) {
|
|
5308
5311
|
const resultados = priceContractorMO.ManoObraGlobal.filter((e) => e.Codigo === CodigoMO && e.Estado.ID_Estado === 1);
|
|
5309
5312
|
if (resultados.length !== 1) {
|
|
5310
5313
|
throw new Error(`Hay ${resultados.length} resultados para precioContratista cod empresa: '${priceContractorMO.Empresa.Codigo}', cod mo: '${CodigoMO}'`);
|
|
@@ -5323,31 +5326,77 @@ function obtenerPrecioManoObra(CodigoMO, TipoMO, priceContractorMO) {
|
|
|
5323
5326
|
return registro.Precio;
|
|
5324
5327
|
}
|
|
5325
5328
|
}
|
|
5326
|
-
__name(
|
|
5329
|
+
__name(obtenerPrecioManoObraAL02, "obtenerPrecioManoObraAL02");
|
|
5327
5330
|
|
|
5328
|
-
// src/Programados/Alemania/
|
|
5329
|
-
function
|
|
5331
|
+
// src/Programados/Alemania/updatePriceContractorMOAL02.ts
|
|
5332
|
+
function updatePriceContractorMOAL02(valorizaciones, priceContractorMO) {
|
|
5330
5333
|
for (const valorizacion of valorizaciones) {
|
|
5331
5334
|
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5332
5335
|
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5333
|
-
const precio =
|
|
5336
|
+
const precio = obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO);
|
|
5334
5337
|
valorizacion.PrecioContrata = precio;
|
|
5335
5338
|
valorizacion.TotalContrata = valorizacion.PrecioContrata * valorizacion.Cantidad;
|
|
5336
5339
|
}
|
|
5337
5340
|
}
|
|
5338
|
-
__name(
|
|
5341
|
+
__name(updatePriceContractorMOAL02, "updatePriceContractorMOAL02");
|
|
5339
5342
|
|
|
5340
|
-
// src/Programados/Alemania/
|
|
5341
|
-
function
|
|
5343
|
+
// src/Programados/Alemania/updatePriceMOAL02.ts
|
|
5344
|
+
function updatePriceMOAL02(valorizaciones, priceContractorMO) {
|
|
5342
5345
|
for (const valorizacion of valorizaciones) {
|
|
5343
5346
|
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5344
5347
|
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5345
|
-
const precio =
|
|
5348
|
+
const precio = obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO);
|
|
5346
5349
|
valorizacion.Precio = precio;
|
|
5347
5350
|
valorizacion.Total = valorizacion.Precio * valorizacion.Cantidad;
|
|
5348
5351
|
}
|
|
5349
5352
|
}
|
|
5350
|
-
__name(
|
|
5353
|
+
__name(updatePriceMOAL02, "updatePriceMOAL02");
|
|
5354
|
+
|
|
5355
|
+
// src/Programados/Alemania/obtenerPrecioManoObraAL04.ts
|
|
5356
|
+
function obtenerPrecioManoObraAL04(CodigoMO, TipoMO, priceContractorMO) {
|
|
5357
|
+
const resultados = priceContractorMO.ManoObraGlobal.filter((e) => e.Codigo === CodigoMO);
|
|
5358
|
+
if (resultados.length !== 1) {
|
|
5359
|
+
throw new Error(`Hay ${resultados.length} resultados para precioContratista cod empresa: '${priceContractorMO.Empresa.Codigo}', cod mo: '${CodigoMO}'`);
|
|
5360
|
+
}
|
|
5361
|
+
const registro = resultados[0];
|
|
5362
|
+
if (TipoMO !== null) {
|
|
5363
|
+
const precioObj = registro.TipoMO?.find((e) => e.Tipo === TipoMO);
|
|
5364
|
+
if (!precioObj) {
|
|
5365
|
+
throw new Error(`No hay precioContratista cod empresa: '${priceContractorMO.Empresa.Codigo}', cod mo: '${CodigoMO}', TipoMO: '${TipoMO}'`);
|
|
5366
|
+
}
|
|
5367
|
+
return precioObj.Precio;
|
|
5368
|
+
} else {
|
|
5369
|
+
if (registro.Precio === void 0) {
|
|
5370
|
+
throw new Error(`No se encontr\xF3 precio base para cod mo: '${CodigoMO}' sin TipoMO en empresa '${priceContractorMO.Empresa.Codigo}'`);
|
|
5371
|
+
}
|
|
5372
|
+
return registro.Precio;
|
|
5373
|
+
}
|
|
5374
|
+
}
|
|
5375
|
+
__name(obtenerPrecioManoObraAL04, "obtenerPrecioManoObraAL04");
|
|
5376
|
+
|
|
5377
|
+
// src/Programados/Alemania/updatePriceContractorMOAL04.ts
|
|
5378
|
+
function updatePriceContractorMOAL04(valorizaciones, priceContractorMO) {
|
|
5379
|
+
for (const valorizacion of valorizaciones) {
|
|
5380
|
+
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5381
|
+
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5382
|
+
const precio = obtenerPrecioManoObraAL04(CodigoMO, TipoMO, priceContractorMO);
|
|
5383
|
+
valorizacion.PrecioContrata = precio;
|
|
5384
|
+
valorizacion.TotalContrata = valorizacion.PrecioContrata * valorizacion.Cantidad;
|
|
5385
|
+
}
|
|
5386
|
+
}
|
|
5387
|
+
__name(updatePriceContractorMOAL04, "updatePriceContractorMOAL04");
|
|
5388
|
+
|
|
5389
|
+
// src/Programados/Alemania/updatePriceMOAL04.ts
|
|
5390
|
+
function updatePriceMOAL04(valorizaciones, priceContractorMO) {
|
|
5391
|
+
for (const valorizacion of valorizaciones) {
|
|
5392
|
+
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5393
|
+
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5394
|
+
const precio = obtenerPrecioManoObraAL04(CodigoMO, TipoMO, priceContractorMO);
|
|
5395
|
+
valorizacion.Precio = precio;
|
|
5396
|
+
valorizacion.Total = valorizacion.Precio * valorizacion.Cantidad;
|
|
5397
|
+
}
|
|
5398
|
+
}
|
|
5399
|
+
__name(updatePriceMOAL04, "updatePriceMOAL04");
|
|
5351
5400
|
|
|
5352
5401
|
// src/Programados/BuscarZonaContratista.ts
|
|
5353
5402
|
function BuscarZonaContratista(EmpresaContratistaEnPrecioEspecialidad, Obra, ZonaAsignada) {
|
|
@@ -5924,11 +5973,14 @@ __name(searchCurrentContractorSpecialtyPrice, "searchCurrentContractorSpecialtyP
|
|
|
5924
5973
|
mapaReglaSopladoTroncal,
|
|
5925
5974
|
obtenerDocumentacionClientes,
|
|
5926
5975
|
obtenerDocumentacionNoClientes,
|
|
5927
|
-
|
|
5976
|
+
obtenerPrecioManoObraAL02,
|
|
5977
|
+
obtenerPrecioManoObraAL04,
|
|
5928
5978
|
obtenerTipoYCodigoMO,
|
|
5929
5979
|
paisMap,
|
|
5930
5980
|
searchCurrentContractorSpecialtyPrice,
|
|
5931
|
-
|
|
5932
|
-
|
|
5981
|
+
updatePriceContractorMOAL02,
|
|
5982
|
+
updatePriceContractorMOAL04,
|
|
5983
|
+
updatePriceMOAL02,
|
|
5984
|
+
updatePriceMOAL04,
|
|
5933
5985
|
validateNoLookup
|
|
5934
5986
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -5203,8 +5203,8 @@ function obtenerTipoYCodigoMO(codigoOriginal) {
|
|
|
5203
5203
|
}
|
|
5204
5204
|
__name(obtenerTipoYCodigoMO, "obtenerTipoYCodigoMO");
|
|
5205
5205
|
|
|
5206
|
-
// src/Programados/Alemania/
|
|
5207
|
-
function
|
|
5206
|
+
// src/Programados/Alemania/obtenerPrecioManoObraAL02.ts
|
|
5207
|
+
function obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO) {
|
|
5208
5208
|
const resultados = priceContractorMO.ManoObraGlobal.filter((e) => e.Codigo === CodigoMO && e.Estado.ID_Estado === 1);
|
|
5209
5209
|
if (resultados.length !== 1) {
|
|
5210
5210
|
throw new Error(`Hay ${resultados.length} resultados para precioContratista cod empresa: '${priceContractorMO.Empresa.Codigo}', cod mo: '${CodigoMO}'`);
|
|
@@ -5223,31 +5223,77 @@ function obtenerPrecioManoObra(CodigoMO, TipoMO, priceContractorMO) {
|
|
|
5223
5223
|
return registro.Precio;
|
|
5224
5224
|
}
|
|
5225
5225
|
}
|
|
5226
|
-
__name(
|
|
5226
|
+
__name(obtenerPrecioManoObraAL02, "obtenerPrecioManoObraAL02");
|
|
5227
5227
|
|
|
5228
|
-
// src/Programados/Alemania/
|
|
5229
|
-
function
|
|
5228
|
+
// src/Programados/Alemania/updatePriceContractorMOAL02.ts
|
|
5229
|
+
function updatePriceContractorMOAL02(valorizaciones, priceContractorMO) {
|
|
5230
5230
|
for (const valorizacion of valorizaciones) {
|
|
5231
5231
|
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5232
5232
|
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5233
|
-
const precio =
|
|
5233
|
+
const precio = obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO);
|
|
5234
5234
|
valorizacion.PrecioContrata = precio;
|
|
5235
5235
|
valorizacion.TotalContrata = valorizacion.PrecioContrata * valorizacion.Cantidad;
|
|
5236
5236
|
}
|
|
5237
5237
|
}
|
|
5238
|
-
__name(
|
|
5238
|
+
__name(updatePriceContractorMOAL02, "updatePriceContractorMOAL02");
|
|
5239
5239
|
|
|
5240
|
-
// src/Programados/Alemania/
|
|
5241
|
-
function
|
|
5240
|
+
// src/Programados/Alemania/updatePriceMOAL02.ts
|
|
5241
|
+
function updatePriceMOAL02(valorizaciones, priceContractorMO) {
|
|
5242
5242
|
for (const valorizacion of valorizaciones) {
|
|
5243
5243
|
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5244
5244
|
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5245
|
-
const precio =
|
|
5245
|
+
const precio = obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO);
|
|
5246
5246
|
valorizacion.Precio = precio;
|
|
5247
5247
|
valorizacion.Total = valorizacion.Precio * valorizacion.Cantidad;
|
|
5248
5248
|
}
|
|
5249
5249
|
}
|
|
5250
|
-
__name(
|
|
5250
|
+
__name(updatePriceMOAL02, "updatePriceMOAL02");
|
|
5251
|
+
|
|
5252
|
+
// src/Programados/Alemania/obtenerPrecioManoObraAL04.ts
|
|
5253
|
+
function obtenerPrecioManoObraAL04(CodigoMO, TipoMO, priceContractorMO) {
|
|
5254
|
+
const resultados = priceContractorMO.ManoObraGlobal.filter((e) => e.Codigo === CodigoMO);
|
|
5255
|
+
if (resultados.length !== 1) {
|
|
5256
|
+
throw new Error(`Hay ${resultados.length} resultados para precioContratista cod empresa: '${priceContractorMO.Empresa.Codigo}', cod mo: '${CodigoMO}'`);
|
|
5257
|
+
}
|
|
5258
|
+
const registro = resultados[0];
|
|
5259
|
+
if (TipoMO !== null) {
|
|
5260
|
+
const precioObj = registro.TipoMO?.find((e) => e.Tipo === TipoMO);
|
|
5261
|
+
if (!precioObj) {
|
|
5262
|
+
throw new Error(`No hay precioContratista cod empresa: '${priceContractorMO.Empresa.Codigo}', cod mo: '${CodigoMO}', TipoMO: '${TipoMO}'`);
|
|
5263
|
+
}
|
|
5264
|
+
return precioObj.Precio;
|
|
5265
|
+
} else {
|
|
5266
|
+
if (registro.Precio === void 0) {
|
|
5267
|
+
throw new Error(`No se encontr\xF3 precio base para cod mo: '${CodigoMO}' sin TipoMO en empresa '${priceContractorMO.Empresa.Codigo}'`);
|
|
5268
|
+
}
|
|
5269
|
+
return registro.Precio;
|
|
5270
|
+
}
|
|
5271
|
+
}
|
|
5272
|
+
__name(obtenerPrecioManoObraAL04, "obtenerPrecioManoObraAL04");
|
|
5273
|
+
|
|
5274
|
+
// src/Programados/Alemania/updatePriceContractorMOAL04.ts
|
|
5275
|
+
function updatePriceContractorMOAL04(valorizaciones, priceContractorMO) {
|
|
5276
|
+
for (const valorizacion of valorizaciones) {
|
|
5277
|
+
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5278
|
+
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5279
|
+
const precio = obtenerPrecioManoObraAL04(CodigoMO, TipoMO, priceContractorMO);
|
|
5280
|
+
valorizacion.PrecioContrata = precio;
|
|
5281
|
+
valorizacion.TotalContrata = valorizacion.PrecioContrata * valorizacion.Cantidad;
|
|
5282
|
+
}
|
|
5283
|
+
}
|
|
5284
|
+
__name(updatePriceContractorMOAL04, "updatePriceContractorMOAL04");
|
|
5285
|
+
|
|
5286
|
+
// src/Programados/Alemania/updatePriceMOAL04.ts
|
|
5287
|
+
function updatePriceMOAL04(valorizaciones, priceContractorMO) {
|
|
5288
|
+
for (const valorizacion of valorizaciones) {
|
|
5289
|
+
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5290
|
+
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5291
|
+
const precio = obtenerPrecioManoObraAL04(CodigoMO, TipoMO, priceContractorMO);
|
|
5292
|
+
valorizacion.Precio = precio;
|
|
5293
|
+
valorizacion.Total = valorizacion.Precio * valorizacion.Cantidad;
|
|
5294
|
+
}
|
|
5295
|
+
}
|
|
5296
|
+
__name(updatePriceMOAL04, "updatePriceMOAL04");
|
|
5251
5297
|
|
|
5252
5298
|
// src/Programados/BuscarZonaContratista.ts
|
|
5253
5299
|
function BuscarZonaContratista(EmpresaContratistaEnPrecioEspecialidad, Obra, ZonaAsignada) {
|
|
@@ -5823,11 +5869,14 @@ export {
|
|
|
5823
5869
|
mapaReglaSopladoTroncal,
|
|
5824
5870
|
obtenerDocumentacionClientes,
|
|
5825
5871
|
obtenerDocumentacionNoClientes,
|
|
5826
|
-
|
|
5872
|
+
obtenerPrecioManoObraAL02,
|
|
5873
|
+
obtenerPrecioManoObraAL04,
|
|
5827
5874
|
obtenerTipoYCodigoMO,
|
|
5828
5875
|
paisMap,
|
|
5829
5876
|
searchCurrentContractorSpecialtyPrice,
|
|
5830
|
-
|
|
5831
|
-
|
|
5877
|
+
updatePriceContractorMOAL02,
|
|
5878
|
+
updatePriceContractorMOAL04,
|
|
5879
|
+
updatePriceMOAL02,
|
|
5880
|
+
updatePriceMOAL04,
|
|
5832
5881
|
validateNoLookup
|
|
5833
5882
|
};
|