sigo-package 1.2.74 → 1.2.76
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 +48 -2
- package/dist/index.d.ts +48 -2
- package/dist/index.js +71 -2
- package/dist/index.mjs +68 -2
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as sigo_entities from 'sigo-entities';
|
|
2
|
-
import { ManoObraENTITY, ReservaENTITY, ItemDetalleLogisticaDTO, HomePassDTO, FlujoDocDTO, NodoDocDTO, DocumentacionPEXENTITY, ManoObraGlobalENTITY, PrecioEspecialidadENTITY, ObraChile9512ENTITY, TrabajoAlemaniaENTITY, ValorizacionManoObraDTO, ValorizacionAlemaniaDTO, PrecioContratistaMOAL02ENTITY, ValorizacionDTO, PrecioContratistaMOAL04ENTITY, StockPersonalENTITY, StockAlmacenENTITY, ConsumoMaterialAlemaniaENTITY, ValorizacionesDTO, PrecioContratistaMaterialENTITY, TrabajoENTITY, ActividadesDTO, PreciosVigentesDTO, ContratoOTENTITY } from 'sigo-entities';
|
|
2
|
+
import { ManoObraENTITY, ReservaENTITY, ItemDetalleLogisticaDTO, HomePassDTO, FlujoDocDTO, NodoDocDTO, DocumentacionPEXENTITY, ManoObraGlobalENTITY, PrecioEspecialidadENTITY, ObraChile9512ENTITY, TrabajoAlemaniaENTITY, ValorizacionManoObraDTO, ValorizacionAlemaniaDTO, PrecioContratistaMOAL02ENTITY, ValorizacionDTO, PrecioContratistaMOAL04ENTITY, StockPersonalENTITY, StockAlmacenENTITY, ConsumoMaterialAlemaniaENTITY, ValorizacionesDTO, PrecioContratistaMaterialENTITY, TrabajoENTITY, ActividadesDTO, PreciosVigentesDTO, ContratoOTENTITY, DetalleChileValorizacionMODTO } from 'sigo-entities';
|
|
3
3
|
|
|
4
4
|
interface IenvSIGO$1 {
|
|
5
5
|
SISTEMAS_VALORIZACION_MANO_OBRA: string[];
|
|
@@ -533,6 +533,50 @@ declare const getNextID_Amap: (Valorizacion: Pick<ValorizacionManoObraDTO, "ID_A
|
|
|
533
533
|
|
|
534
534
|
declare const getNextID_AsignacionValorizacion: (Valorizaciones: Pick<ValorizacionesDTO, "ID_AsignacionValorizacion">[]) => number;
|
|
535
535
|
|
|
536
|
+
type typeMO$1 = Pick<DetalleChileValorizacionMODTO, 'ManoObra' | 'Especialidad' | 'Actividad' | 'UnidadObra' | 'Clave' | 'LineaCodigoCub' | 'Linea'>;
|
|
537
|
+
declare function buildKeyMO(mo: typeMO$1): string;
|
|
538
|
+
|
|
539
|
+
type typeMO = Pick<DetalleChileValorizacionMODTO, "ManoObra" | "Especialidad" | "Actividad" | "UnidadObra" | "Clave" | "LineaCodigoCub" | "Linea">;
|
|
540
|
+
type typeTrabajos = Pick<TrabajoENTITY, "Ultima_asignacion">;
|
|
541
|
+
type MOKeyTotals = {
|
|
542
|
+
cantidadMO: number;
|
|
543
|
+
cantidadUO: number;
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* Helper para optimizar cálculos de Mano de Obra (MO) asignada.
|
|
547
|
+
*
|
|
548
|
+
* Construye un índice (`Map`) de todas las valorizaciones de los trabajos
|
|
549
|
+
* para realizar consultas rápidas (O(1)) sin volver a recorrer todo el arreglo.
|
|
550
|
+
*
|
|
551
|
+
* ### Ejemplo de uso:
|
|
552
|
+
* ```ts
|
|
553
|
+
* // Construyes el helper una sola vez
|
|
554
|
+
* const helper = new ValorizacionHelper(trabajos);
|
|
555
|
+
*
|
|
556
|
+
* // Luego consultas varias veces sin recalcular
|
|
557
|
+
* const { cantidadMO, cantidadUO } = helper.calcularMOAsignada(mo);
|
|
558
|
+
* console.log(cantidadMO, cantidadUO);
|
|
559
|
+
* ```
|
|
560
|
+
*/
|
|
561
|
+
declare class ValorizacionHelper {
|
|
562
|
+
private valorizacionMap;
|
|
563
|
+
/**
|
|
564
|
+
* Inicializa el helper y construye el índice de valorizaciones.
|
|
565
|
+
* @param trabajos Lista de trabajos con valorizaciones
|
|
566
|
+
*/
|
|
567
|
+
constructor(trabajos: typeTrabajos[]);
|
|
568
|
+
/**
|
|
569
|
+
* Construye el índice de valorizaciones (clave → totales MO/UO)
|
|
570
|
+
*/
|
|
571
|
+
private buildValorizacionMap;
|
|
572
|
+
/**
|
|
573
|
+
* Calcula la cantidad de MO y UO asignadas a una MO específica.
|
|
574
|
+
* @param mo Objeto de Mano de Obra
|
|
575
|
+
* @returns Totales de MO y UO
|
|
576
|
+
*/
|
|
577
|
+
calcularMOAsignada(mo: typeMO): MOKeyTotals;
|
|
578
|
+
}
|
|
579
|
+
|
|
536
580
|
declare enum Position {
|
|
537
581
|
left = "left",
|
|
538
582
|
right = "right"
|
|
@@ -613,4 +657,6 @@ declare function formatCurrencyV1(num: number, maximumFractionDigits?: number, s
|
|
|
613
657
|
|
|
614
658
|
declare function formatPercentageV1(num: number, maximumFractionDigits?: number): string;
|
|
615
659
|
|
|
616
|
-
|
|
660
|
+
declare function formatNumberV1(num: number, maximumFractionDigits?: number): string;
|
|
661
|
+
|
|
662
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, 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, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildTenantCollectionName, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL04, codClientes, 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, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, consumirStockPersonal, convertDates, dataFlujosHomePass, empresas, esCadenaFechaISOValida, esObjetoFecha, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getChannelName, getContainerName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getQueueName, getQueueNameSaveOneNotification, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, newCodMOTroncalReglaLiquidacion1, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, searchCurrentContractorSpecialtyPrice, setContext, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, validateNoLookup };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as sigo_entities from 'sigo-entities';
|
|
2
|
-
import { ManoObraENTITY, ReservaENTITY, ItemDetalleLogisticaDTO, HomePassDTO, FlujoDocDTO, NodoDocDTO, DocumentacionPEXENTITY, ManoObraGlobalENTITY, PrecioEspecialidadENTITY, ObraChile9512ENTITY, TrabajoAlemaniaENTITY, ValorizacionManoObraDTO, ValorizacionAlemaniaDTO, PrecioContratistaMOAL02ENTITY, ValorizacionDTO, PrecioContratistaMOAL04ENTITY, StockPersonalENTITY, StockAlmacenENTITY, ConsumoMaterialAlemaniaENTITY, ValorizacionesDTO, PrecioContratistaMaterialENTITY, TrabajoENTITY, ActividadesDTO, PreciosVigentesDTO, ContratoOTENTITY } from 'sigo-entities';
|
|
2
|
+
import { ManoObraENTITY, ReservaENTITY, ItemDetalleLogisticaDTO, HomePassDTO, FlujoDocDTO, NodoDocDTO, DocumentacionPEXENTITY, ManoObraGlobalENTITY, PrecioEspecialidadENTITY, ObraChile9512ENTITY, TrabajoAlemaniaENTITY, ValorizacionManoObraDTO, ValorizacionAlemaniaDTO, PrecioContratistaMOAL02ENTITY, ValorizacionDTO, PrecioContratistaMOAL04ENTITY, StockPersonalENTITY, StockAlmacenENTITY, ConsumoMaterialAlemaniaENTITY, ValorizacionesDTO, PrecioContratistaMaterialENTITY, TrabajoENTITY, ActividadesDTO, PreciosVigentesDTO, ContratoOTENTITY, DetalleChileValorizacionMODTO } from 'sigo-entities';
|
|
3
3
|
|
|
4
4
|
interface IenvSIGO$1 {
|
|
5
5
|
SISTEMAS_VALORIZACION_MANO_OBRA: string[];
|
|
@@ -533,6 +533,50 @@ declare const getNextID_Amap: (Valorizacion: Pick<ValorizacionManoObraDTO, "ID_A
|
|
|
533
533
|
|
|
534
534
|
declare const getNextID_AsignacionValorizacion: (Valorizaciones: Pick<ValorizacionesDTO, "ID_AsignacionValorizacion">[]) => number;
|
|
535
535
|
|
|
536
|
+
type typeMO$1 = Pick<DetalleChileValorizacionMODTO, 'ManoObra' | 'Especialidad' | 'Actividad' | 'UnidadObra' | 'Clave' | 'LineaCodigoCub' | 'Linea'>;
|
|
537
|
+
declare function buildKeyMO(mo: typeMO$1): string;
|
|
538
|
+
|
|
539
|
+
type typeMO = Pick<DetalleChileValorizacionMODTO, "ManoObra" | "Especialidad" | "Actividad" | "UnidadObra" | "Clave" | "LineaCodigoCub" | "Linea">;
|
|
540
|
+
type typeTrabajos = Pick<TrabajoENTITY, "Ultima_asignacion">;
|
|
541
|
+
type MOKeyTotals = {
|
|
542
|
+
cantidadMO: number;
|
|
543
|
+
cantidadUO: number;
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* Helper para optimizar cálculos de Mano de Obra (MO) asignada.
|
|
547
|
+
*
|
|
548
|
+
* Construye un índice (`Map`) de todas las valorizaciones de los trabajos
|
|
549
|
+
* para realizar consultas rápidas (O(1)) sin volver a recorrer todo el arreglo.
|
|
550
|
+
*
|
|
551
|
+
* ### Ejemplo de uso:
|
|
552
|
+
* ```ts
|
|
553
|
+
* // Construyes el helper una sola vez
|
|
554
|
+
* const helper = new ValorizacionHelper(trabajos);
|
|
555
|
+
*
|
|
556
|
+
* // Luego consultas varias veces sin recalcular
|
|
557
|
+
* const { cantidadMO, cantidadUO } = helper.calcularMOAsignada(mo);
|
|
558
|
+
* console.log(cantidadMO, cantidadUO);
|
|
559
|
+
* ```
|
|
560
|
+
*/
|
|
561
|
+
declare class ValorizacionHelper {
|
|
562
|
+
private valorizacionMap;
|
|
563
|
+
/**
|
|
564
|
+
* Inicializa el helper y construye el índice de valorizaciones.
|
|
565
|
+
* @param trabajos Lista de trabajos con valorizaciones
|
|
566
|
+
*/
|
|
567
|
+
constructor(trabajos: typeTrabajos[]);
|
|
568
|
+
/**
|
|
569
|
+
* Construye el índice de valorizaciones (clave → totales MO/UO)
|
|
570
|
+
*/
|
|
571
|
+
private buildValorizacionMap;
|
|
572
|
+
/**
|
|
573
|
+
* Calcula la cantidad de MO y UO asignadas a una MO específica.
|
|
574
|
+
* @param mo Objeto de Mano de Obra
|
|
575
|
+
* @returns Totales de MO y UO
|
|
576
|
+
*/
|
|
577
|
+
calcularMOAsignada(mo: typeMO): MOKeyTotals;
|
|
578
|
+
}
|
|
579
|
+
|
|
536
580
|
declare enum Position {
|
|
537
581
|
left = "left",
|
|
538
582
|
right = "right"
|
|
@@ -613,4 +657,6 @@ declare function formatCurrencyV1(num: number, maximumFractionDigits?: number, s
|
|
|
613
657
|
|
|
614
658
|
declare function formatPercentageV1(num: number, maximumFractionDigits?: number): string;
|
|
615
659
|
|
|
616
|
-
|
|
660
|
+
declare function formatNumberV1(num: number, maximumFractionDigits?: number): string;
|
|
661
|
+
|
|
662
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, 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, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildTenantCollectionName, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL04, codClientes, 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, codMOTroncal_ReglaLiquidacion1, codNoCliente, codSopladoRD, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, consumirStockPersonal, convertDates, dataFlujosHomePass, empresas, esCadenaFechaISOValida, esObjetoFecha, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getChannelName, getContainerName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getQueueName, getQueueNameSaveOneNotification, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, newCodMOTroncalReglaLiquidacion1, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, searchCurrentContractorSpecialtyPrice, setContext, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, validateNoLookup };
|
package/dist/index.js
CHANGED
|
@@ -60,8 +60,10 @@ __export(index_exports, {
|
|
|
60
60
|
ObtenerZonaAsignada: () => ObtenerZonaAsignada,
|
|
61
61
|
SEGMENT_TY: () => SEGMENT_TY,
|
|
62
62
|
UpdateNodosDocDP: () => UpdateNodosDocDP,
|
|
63
|
+
ValorizacionHelper: () => ValorizacionHelper,
|
|
63
64
|
buildDataMOFromMaterialRules: () => buildDataMOFromMaterialRules,
|
|
64
65
|
buildDataMaterialsRule: () => buildDataMaterialsRule,
|
|
66
|
+
buildKeyMO: () => buildKeyMO,
|
|
65
67
|
buildTenantCollectionName: () => buildTenantCollectionName,
|
|
66
68
|
checkAndBuildMaterialsFromStock: () => checkAndBuildMaterialsFromStock,
|
|
67
69
|
checkMaterialAvailability: () => checkMaterialAvailability,
|
|
@@ -106,6 +108,7 @@ __export(index_exports, {
|
|
|
106
108
|
esObjetoFecha: () => esObjetoFecha,
|
|
107
109
|
formatCurrencyV1: () => formatCurrencyV1,
|
|
108
110
|
formatNumberSmart: () => formatNumberSmart,
|
|
111
|
+
formatNumberV1: () => formatNumberV1,
|
|
109
112
|
formatPercentageV1: () => formatPercentageV1,
|
|
110
113
|
generateUniqueNumber: () => generateUniqueNumber,
|
|
111
114
|
generateUniqueNumberArray: () => generateUniqueNumberArray,
|
|
@@ -15416,7 +15419,7 @@ function formatCurrencyV1(num, maximumFractionDigits = 2, symbol = "$") {
|
|
|
15416
15419
|
minimumFractionDigits: 0,
|
|
15417
15420
|
maximumFractionDigits
|
|
15418
15421
|
};
|
|
15419
|
-
return symbol + " " + new Intl.NumberFormat("es-
|
|
15422
|
+
return symbol + " " + new Intl.NumberFormat("es-PE", options).format(num);
|
|
15420
15423
|
}
|
|
15421
15424
|
__name(formatCurrencyV1, "formatCurrencyV1");
|
|
15422
15425
|
|
|
@@ -15426,10 +15429,20 @@ function formatPercentageV1(num, maximumFractionDigits = 2) {
|
|
|
15426
15429
|
minimumFractionDigits: 0,
|
|
15427
15430
|
maximumFractionDigits
|
|
15428
15431
|
};
|
|
15429
|
-
return new Intl.NumberFormat("es-
|
|
15432
|
+
return new Intl.NumberFormat("es-PE", options).format(num) + " %";
|
|
15430
15433
|
}
|
|
15431
15434
|
__name(formatPercentageV1, "formatPercentageV1");
|
|
15432
15435
|
|
|
15436
|
+
// src/shared/Utils/formatNumberV1.ts
|
|
15437
|
+
function formatNumberV1(num, maximumFractionDigits = 2) {
|
|
15438
|
+
const options = {
|
|
15439
|
+
minimumFractionDigits: 0,
|
|
15440
|
+
maximumFractionDigits
|
|
15441
|
+
};
|
|
15442
|
+
return new Intl.NumberFormat("es-pe", options).format(num);
|
|
15443
|
+
}
|
|
15444
|
+
__name(formatNumberV1, "formatNumberV1");
|
|
15445
|
+
|
|
15433
15446
|
// src/Programados/Procesos/Preliquidar/ObtenerPrecioContratistaVigente.ts
|
|
15434
15447
|
function ObtenerPrecioContratistaVigente({ actividad, FechaVerificar }) {
|
|
15435
15448
|
const fechaVerificar = new Date(FechaVerificar);
|
|
@@ -15495,6 +15508,59 @@ var getNextID_Amap = /* @__PURE__ */ __name((Valorizacion) => {
|
|
|
15495
15508
|
var getNextID_AsignacionValorizacion = /* @__PURE__ */ __name((Valorizaciones) => {
|
|
15496
15509
|
return Math.max(0, ...Valorizaciones.map((v) => v.ID_AsignacionValorizacion)) + 1;
|
|
15497
15510
|
}, "getNextID_AsignacionValorizacion");
|
|
15511
|
+
|
|
15512
|
+
// src/Programados/buildKeyMO.ts
|
|
15513
|
+
function buildKeyMO(mo) {
|
|
15514
|
+
const { Especialidad, Actividad, ManoObra, UnidadObra, Clave, LineaCodigoCub, Linea } = mo;
|
|
15515
|
+
const key = `${Especialidad.Codigo}${Actividad.Codigo}${ManoObra.Codigo}${UnidadObra.Codigo}${Clave.Codigo}${LineaCodigoCub}${Linea}`;
|
|
15516
|
+
return key;
|
|
15517
|
+
}
|
|
15518
|
+
__name(buildKeyMO, "buildKeyMO");
|
|
15519
|
+
|
|
15520
|
+
// src/Programados/calcularMOAsignada.ts
|
|
15521
|
+
var _ValorizacionHelper = class _ValorizacionHelper {
|
|
15522
|
+
/**
|
|
15523
|
+
* Inicializa el helper y construye el índice de valorizaciones.
|
|
15524
|
+
* @param trabajos Lista de trabajos con valorizaciones
|
|
15525
|
+
*/
|
|
15526
|
+
constructor(trabajos) {
|
|
15527
|
+
__publicField(this, "valorizacionMap");
|
|
15528
|
+
this.valorizacionMap = this.buildValorizacionMap(trabajos);
|
|
15529
|
+
}
|
|
15530
|
+
/**
|
|
15531
|
+
* Construye el índice de valorizaciones (clave → totales MO/UO)
|
|
15532
|
+
*/
|
|
15533
|
+
buildValorizacionMap(trabajos) {
|
|
15534
|
+
const map = /* @__PURE__ */ new Map();
|
|
15535
|
+
for (const trabajo of trabajos) {
|
|
15536
|
+
for (const val of trabajo.Ultima_asignacion.Valorizaciones) {
|
|
15537
|
+
if (val.Estado.ID_Estado !== 1) continue;
|
|
15538
|
+
const key = buildKeyMO(val);
|
|
15539
|
+
const entry = map.get(key) ?? {
|
|
15540
|
+
cantidadMO: 0,
|
|
15541
|
+
cantidadUO: 0
|
|
15542
|
+
};
|
|
15543
|
+
entry.cantidadMO += val.CantidadMO;
|
|
15544
|
+
entry.cantidadUO += val.CantidadUO;
|
|
15545
|
+
map.set(key, entry);
|
|
15546
|
+
}
|
|
15547
|
+
}
|
|
15548
|
+
return map;
|
|
15549
|
+
}
|
|
15550
|
+
/**
|
|
15551
|
+
* Calcula la cantidad de MO y UO asignadas a una MO específica.
|
|
15552
|
+
* @param mo Objeto de Mano de Obra
|
|
15553
|
+
* @returns Totales de MO y UO
|
|
15554
|
+
*/
|
|
15555
|
+
calcularMOAsignada(mo) {
|
|
15556
|
+
return this.valorizacionMap.get(buildKeyMO(mo)) ?? {
|
|
15557
|
+
cantidadMO: 0,
|
|
15558
|
+
cantidadUO: 0
|
|
15559
|
+
};
|
|
15560
|
+
}
|
|
15561
|
+
};
|
|
15562
|
+
__name(_ValorizacionHelper, "ValorizacionHelper");
|
|
15563
|
+
var ValorizacionHelper = _ValorizacionHelper;
|
|
15498
15564
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15499
15565
|
0 && (module.exports = {
|
|
15500
15566
|
ActualizarDataManoObra,
|
|
@@ -15534,8 +15600,10 @@ var getNextID_AsignacionValorizacion = /* @__PURE__ */ __name((Valorizaciones) =
|
|
|
15534
15600
|
ObtenerZonaAsignada,
|
|
15535
15601
|
SEGMENT_TY,
|
|
15536
15602
|
UpdateNodosDocDP,
|
|
15603
|
+
ValorizacionHelper,
|
|
15537
15604
|
buildDataMOFromMaterialRules,
|
|
15538
15605
|
buildDataMaterialsRule,
|
|
15606
|
+
buildKeyMO,
|
|
15539
15607
|
buildTenantCollectionName,
|
|
15540
15608
|
checkAndBuildMaterialsFromStock,
|
|
15541
15609
|
checkMaterialAvailability,
|
|
@@ -15580,6 +15648,7 @@ var getNextID_AsignacionValorizacion = /* @__PURE__ */ __name((Valorizaciones) =
|
|
|
15580
15648
|
esObjetoFecha,
|
|
15581
15649
|
formatCurrencyV1,
|
|
15582
15650
|
formatNumberSmart,
|
|
15651
|
+
formatNumberV1,
|
|
15583
15652
|
formatPercentageV1,
|
|
15584
15653
|
generateUniqueNumber,
|
|
15585
15654
|
generateUniqueNumberArray,
|
package/dist/index.mjs
CHANGED
|
@@ -15272,7 +15272,7 @@ function formatCurrencyV1(num, maximumFractionDigits = 2, symbol = "$") {
|
|
|
15272
15272
|
minimumFractionDigits: 0,
|
|
15273
15273
|
maximumFractionDigits
|
|
15274
15274
|
};
|
|
15275
|
-
return symbol + " " + new Intl.NumberFormat("es-
|
|
15275
|
+
return symbol + " " + new Intl.NumberFormat("es-PE", options).format(num);
|
|
15276
15276
|
}
|
|
15277
15277
|
__name(formatCurrencyV1, "formatCurrencyV1");
|
|
15278
15278
|
|
|
@@ -15282,10 +15282,20 @@ function formatPercentageV1(num, maximumFractionDigits = 2) {
|
|
|
15282
15282
|
minimumFractionDigits: 0,
|
|
15283
15283
|
maximumFractionDigits
|
|
15284
15284
|
};
|
|
15285
|
-
return new Intl.NumberFormat("es-
|
|
15285
|
+
return new Intl.NumberFormat("es-PE", options).format(num) + " %";
|
|
15286
15286
|
}
|
|
15287
15287
|
__name(formatPercentageV1, "formatPercentageV1");
|
|
15288
15288
|
|
|
15289
|
+
// src/shared/Utils/formatNumberV1.ts
|
|
15290
|
+
function formatNumberV1(num, maximumFractionDigits = 2) {
|
|
15291
|
+
const options = {
|
|
15292
|
+
minimumFractionDigits: 0,
|
|
15293
|
+
maximumFractionDigits
|
|
15294
|
+
};
|
|
15295
|
+
return new Intl.NumberFormat("es-pe", options).format(num);
|
|
15296
|
+
}
|
|
15297
|
+
__name(formatNumberV1, "formatNumberV1");
|
|
15298
|
+
|
|
15289
15299
|
// src/Programados/Procesos/Preliquidar/ObtenerPrecioContratistaVigente.ts
|
|
15290
15300
|
function ObtenerPrecioContratistaVigente({ actividad, FechaVerificar }) {
|
|
15291
15301
|
const fechaVerificar = new Date(FechaVerificar);
|
|
@@ -15351,6 +15361,59 @@ var getNextID_Amap = /* @__PURE__ */ __name((Valorizacion) => {
|
|
|
15351
15361
|
var getNextID_AsignacionValorizacion = /* @__PURE__ */ __name((Valorizaciones) => {
|
|
15352
15362
|
return Math.max(0, ...Valorizaciones.map((v) => v.ID_AsignacionValorizacion)) + 1;
|
|
15353
15363
|
}, "getNextID_AsignacionValorizacion");
|
|
15364
|
+
|
|
15365
|
+
// src/Programados/buildKeyMO.ts
|
|
15366
|
+
function buildKeyMO(mo) {
|
|
15367
|
+
const { Especialidad, Actividad, ManoObra, UnidadObra, Clave, LineaCodigoCub, Linea } = mo;
|
|
15368
|
+
const key = `${Especialidad.Codigo}${Actividad.Codigo}${ManoObra.Codigo}${UnidadObra.Codigo}${Clave.Codigo}${LineaCodigoCub}${Linea}`;
|
|
15369
|
+
return key;
|
|
15370
|
+
}
|
|
15371
|
+
__name(buildKeyMO, "buildKeyMO");
|
|
15372
|
+
|
|
15373
|
+
// src/Programados/calcularMOAsignada.ts
|
|
15374
|
+
var _ValorizacionHelper = class _ValorizacionHelper {
|
|
15375
|
+
/**
|
|
15376
|
+
* Inicializa el helper y construye el índice de valorizaciones.
|
|
15377
|
+
* @param trabajos Lista de trabajos con valorizaciones
|
|
15378
|
+
*/
|
|
15379
|
+
constructor(trabajos) {
|
|
15380
|
+
__publicField(this, "valorizacionMap");
|
|
15381
|
+
this.valorizacionMap = this.buildValorizacionMap(trabajos);
|
|
15382
|
+
}
|
|
15383
|
+
/**
|
|
15384
|
+
* Construye el índice de valorizaciones (clave → totales MO/UO)
|
|
15385
|
+
*/
|
|
15386
|
+
buildValorizacionMap(trabajos) {
|
|
15387
|
+
const map = /* @__PURE__ */ new Map();
|
|
15388
|
+
for (const trabajo of trabajos) {
|
|
15389
|
+
for (const val of trabajo.Ultima_asignacion.Valorizaciones) {
|
|
15390
|
+
if (val.Estado.ID_Estado !== 1) continue;
|
|
15391
|
+
const key = buildKeyMO(val);
|
|
15392
|
+
const entry = map.get(key) ?? {
|
|
15393
|
+
cantidadMO: 0,
|
|
15394
|
+
cantidadUO: 0
|
|
15395
|
+
};
|
|
15396
|
+
entry.cantidadMO += val.CantidadMO;
|
|
15397
|
+
entry.cantidadUO += val.CantidadUO;
|
|
15398
|
+
map.set(key, entry);
|
|
15399
|
+
}
|
|
15400
|
+
}
|
|
15401
|
+
return map;
|
|
15402
|
+
}
|
|
15403
|
+
/**
|
|
15404
|
+
* Calcula la cantidad de MO y UO asignadas a una MO específica.
|
|
15405
|
+
* @param mo Objeto de Mano de Obra
|
|
15406
|
+
* @returns Totales de MO y UO
|
|
15407
|
+
*/
|
|
15408
|
+
calcularMOAsignada(mo) {
|
|
15409
|
+
return this.valorizacionMap.get(buildKeyMO(mo)) ?? {
|
|
15410
|
+
cantidadMO: 0,
|
|
15411
|
+
cantidadUO: 0
|
|
15412
|
+
};
|
|
15413
|
+
}
|
|
15414
|
+
};
|
|
15415
|
+
__name(_ValorizacionHelper, "ValorizacionHelper");
|
|
15416
|
+
var ValorizacionHelper = _ValorizacionHelper;
|
|
15354
15417
|
export {
|
|
15355
15418
|
ActualizarDataManoObra,
|
|
15356
15419
|
ActualizarDataReserva,
|
|
@@ -15389,8 +15452,10 @@ export {
|
|
|
15389
15452
|
ObtenerZonaAsignada,
|
|
15390
15453
|
SEGMENT_TY,
|
|
15391
15454
|
UpdateNodosDocDP,
|
|
15455
|
+
ValorizacionHelper,
|
|
15392
15456
|
buildDataMOFromMaterialRules,
|
|
15393
15457
|
buildDataMaterialsRule,
|
|
15458
|
+
buildKeyMO,
|
|
15394
15459
|
buildTenantCollectionName,
|
|
15395
15460
|
checkAndBuildMaterialsFromStock,
|
|
15396
15461
|
checkMaterialAvailability,
|
|
@@ -15435,6 +15500,7 @@ export {
|
|
|
15435
15500
|
esObjetoFecha,
|
|
15436
15501
|
formatCurrencyV1,
|
|
15437
15502
|
formatNumberSmart,
|
|
15503
|
+
formatNumberV1,
|
|
15438
15504
|
formatPercentageV1,
|
|
15439
15505
|
generateUniqueNumber,
|
|
15440
15506
|
generateUniqueNumberArray,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sigo-package",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.76",
|
|
4
4
|
"description": "Funciones compartidas sigo",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"typescript": "^5.7.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"sigo-entities": "^1.1.
|
|
24
|
+
"sigo-entities": "^1.1.66"
|
|
25
25
|
}
|
|
26
26
|
}
|