sigo-package 1.2.3 → 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 +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +77 -11
- package/dist/index.mjs +71 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -263,9 +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
|
+
|
|
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;
|
|
269
277
|
|
|
270
278
|
declare function obtenerTipoYCodigoMO(codigoOriginal: string): {
|
|
271
279
|
TipoMO: string | null;
|
|
@@ -444,4 +452,4 @@ declare function getDateInTimeZone(timeZone: TimeZone): Date;
|
|
|
444
452
|
|
|
445
453
|
declare function generateUniqueNumber(): number;
|
|
446
454
|
|
|
447
|
-
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,9 +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
|
+
|
|
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;
|
|
269
277
|
|
|
270
278
|
declare function obtenerTipoYCodigoMO(codigoOriginal: string): {
|
|
271
279
|
TipoMO: string | null;
|
|
@@ -444,4 +452,4 @@ declare function getDateInTimeZone(timeZone: TimeZone): Date;
|
|
|
444
452
|
|
|
445
453
|
declare function generateUniqueNumber(): number;
|
|
446
454
|
|
|
447
|
-
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,11 +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
|
+
updatePriceContractorMOAL02: () => updatePriceContractorMOAL02,
|
|
102
|
+
updatePriceContractorMOAL04: () => updatePriceContractorMOAL04,
|
|
103
|
+
updatePriceMOAL02: () => updatePriceMOAL02,
|
|
104
|
+
updatePriceMOAL04: () => updatePriceMOAL04,
|
|
101
105
|
validateNoLookup: () => validateNoLookup
|
|
102
106
|
});
|
|
103
107
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -5302,8 +5306,8 @@ function obtenerTipoYCodigoMO(codigoOriginal) {
|
|
|
5302
5306
|
}
|
|
5303
5307
|
__name(obtenerTipoYCodigoMO, "obtenerTipoYCodigoMO");
|
|
5304
5308
|
|
|
5305
|
-
// src/Programados/Alemania/
|
|
5306
|
-
function
|
|
5309
|
+
// src/Programados/Alemania/obtenerPrecioManoObraAL02.ts
|
|
5310
|
+
function obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO) {
|
|
5307
5311
|
const resultados = priceContractorMO.ManoObraGlobal.filter((e) => e.Codigo === CodigoMO && e.Estado.ID_Estado === 1);
|
|
5308
5312
|
if (resultados.length !== 1) {
|
|
5309
5313
|
throw new Error(`Hay ${resultados.length} resultados para precioContratista cod empresa: '${priceContractorMO.Empresa.Codigo}', cod mo: '${CodigoMO}'`);
|
|
@@ -5322,19 +5326,77 @@ function obtenerPrecioManoObra(CodigoMO, TipoMO, priceContractorMO) {
|
|
|
5322
5326
|
return registro.Precio;
|
|
5323
5327
|
}
|
|
5324
5328
|
}
|
|
5325
|
-
__name(
|
|
5329
|
+
__name(obtenerPrecioManoObraAL02, "obtenerPrecioManoObraAL02");
|
|
5326
5330
|
|
|
5327
|
-
// src/Programados/Alemania/
|
|
5328
|
-
function
|
|
5331
|
+
// src/Programados/Alemania/updatePriceContractorMOAL02.ts
|
|
5332
|
+
function updatePriceContractorMOAL02(valorizaciones, priceContractorMO) {
|
|
5329
5333
|
for (const valorizacion of valorizaciones) {
|
|
5330
5334
|
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5331
5335
|
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5332
|
-
const precio =
|
|
5336
|
+
const precio = obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO);
|
|
5333
5337
|
valorizacion.PrecioContrata = precio;
|
|
5334
5338
|
valorizacion.TotalContrata = valorizacion.PrecioContrata * valorizacion.Cantidad;
|
|
5335
5339
|
}
|
|
5336
5340
|
}
|
|
5337
|
-
__name(
|
|
5341
|
+
__name(updatePriceContractorMOAL02, "updatePriceContractorMOAL02");
|
|
5342
|
+
|
|
5343
|
+
// src/Programados/Alemania/updatePriceMOAL02.ts
|
|
5344
|
+
function updatePriceMOAL02(valorizaciones, priceContractorMO) {
|
|
5345
|
+
for (const valorizacion of valorizaciones) {
|
|
5346
|
+
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5347
|
+
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5348
|
+
const precio = obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO);
|
|
5349
|
+
valorizacion.Precio = precio;
|
|
5350
|
+
valorizacion.Total = valorizacion.Precio * valorizacion.Cantidad;
|
|
5351
|
+
}
|
|
5352
|
+
}
|
|
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");
|
|
5338
5400
|
|
|
5339
5401
|
// src/Programados/BuscarZonaContratista.ts
|
|
5340
5402
|
function BuscarZonaContratista(EmpresaContratistaEnPrecioEspecialidad, Obra, ZonaAsignada) {
|
|
@@ -5911,10 +5973,14 @@ __name(searchCurrentContractorSpecialtyPrice, "searchCurrentContractorSpecialtyP
|
|
|
5911
5973
|
mapaReglaSopladoTroncal,
|
|
5912
5974
|
obtenerDocumentacionClientes,
|
|
5913
5975
|
obtenerDocumentacionNoClientes,
|
|
5914
|
-
|
|
5976
|
+
obtenerPrecioManoObraAL02,
|
|
5977
|
+
obtenerPrecioManoObraAL04,
|
|
5915
5978
|
obtenerTipoYCodigoMO,
|
|
5916
5979
|
paisMap,
|
|
5917
5980
|
searchCurrentContractorSpecialtyPrice,
|
|
5918
|
-
|
|
5981
|
+
updatePriceContractorMOAL02,
|
|
5982
|
+
updatePriceContractorMOAL04,
|
|
5983
|
+
updatePriceMOAL02,
|
|
5984
|
+
updatePriceMOAL04,
|
|
5919
5985
|
validateNoLookup
|
|
5920
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,19 +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
|
+
|
|
5240
|
+
// src/Programados/Alemania/updatePriceMOAL02.ts
|
|
5241
|
+
function updatePriceMOAL02(valorizaciones, priceContractorMO) {
|
|
5242
|
+
for (const valorizacion of valorizaciones) {
|
|
5243
|
+
if (valorizacion.Ultimo_Estado_Interno.Descripcion === "PRODUCCION") continue;
|
|
5244
|
+
const { TipoMO, CodigoMO } = obtenerTipoYCodigoMO(valorizacion.DetalleChile.ManoObra.Codigo);
|
|
5245
|
+
const precio = obtenerPrecioManoObraAL02(CodigoMO, TipoMO, priceContractorMO);
|
|
5246
|
+
valorizacion.Precio = precio;
|
|
5247
|
+
valorizacion.Total = valorizacion.Precio * valorizacion.Cantidad;
|
|
5248
|
+
}
|
|
5249
|
+
}
|
|
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");
|
|
5239
5297
|
|
|
5240
5298
|
// src/Programados/BuscarZonaContratista.ts
|
|
5241
5299
|
function BuscarZonaContratista(EmpresaContratistaEnPrecioEspecialidad, Obra, ZonaAsignada) {
|
|
@@ -5811,10 +5869,14 @@ export {
|
|
|
5811
5869
|
mapaReglaSopladoTroncal,
|
|
5812
5870
|
obtenerDocumentacionClientes,
|
|
5813
5871
|
obtenerDocumentacionNoClientes,
|
|
5814
|
-
|
|
5872
|
+
obtenerPrecioManoObraAL02,
|
|
5873
|
+
obtenerPrecioManoObraAL04,
|
|
5815
5874
|
obtenerTipoYCodigoMO,
|
|
5816
5875
|
paisMap,
|
|
5817
5876
|
searchCurrentContractorSpecialtyPrice,
|
|
5818
|
-
|
|
5877
|
+
updatePriceContractorMOAL02,
|
|
5878
|
+
updatePriceContractorMOAL04,
|
|
5879
|
+
updatePriceMOAL02,
|
|
5880
|
+
updatePriceMOAL04,
|
|
5819
5881
|
validateNoLookup
|
|
5820
5882
|
};
|