sigo-package 1.2.181 → 1.2.182
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 +55 -1
- package/dist/index.d.ts +55 -1
- package/dist/index.js +112 -0
- package/dist/index.mjs +106 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -940,6 +940,60 @@ declare function verifyPhotosNotFinalizedSomacyl(entregables: SomacylEntregables
|
|
|
940
940
|
*/
|
|
941
941
|
declare function getCaptureDateSomacyl(file: Pick<FilesDocDTO, 'Observacion' | 'Fecha_Archivo'>, BadRequestException?: ClassConstructor<Error>): Date;
|
|
942
942
|
|
|
943
|
+
type SaldoStockPersonal = Pick<StockPersonalENTITY, 'Despacho' | 'Devolucion' | 'Liquidacion' | 'DespachoTR' | 'DevolucionTR'>;
|
|
944
|
+
/** Saldo de un StockPersonal: Despacho - Devolucion - Liquidacion + DespachoTR - DevolucionTR (redondeado a 2 decimales) */
|
|
945
|
+
declare function calcularSaldoStockPersonal(stock: SaldoStockPersonal): number;
|
|
946
|
+
|
|
947
|
+
/** Estados de la devolución TR (Logística) */
|
|
948
|
+
declare const DEVOLUCION_TR_ESTADOS: {
|
|
949
|
+
readonly SOLICITADO: {
|
|
950
|
+
readonly ID_Estado: 1;
|
|
951
|
+
readonly Nombre: "SOLICITADO";
|
|
952
|
+
};
|
|
953
|
+
readonly APROBADO: {
|
|
954
|
+
readonly ID_Estado: 3;
|
|
955
|
+
readonly Nombre: "APROBADO";
|
|
956
|
+
};
|
|
957
|
+
readonly ANULADO: {
|
|
958
|
+
readonly ID_Estado: 10;
|
|
959
|
+
readonly Nombre: "ANULADO";
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
/** Motivo de la devolución TR por cambio de turno entre cuadrillas pareja */
|
|
963
|
+
declare const DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO = "CAMBIO_TURNO";
|
|
964
|
+
declare function throwDevolucionTRError(msg: string, Exception?: ClassConstructor<Error>): never;
|
|
965
|
+
|
|
966
|
+
/** Stock del técnico que entrega, tal como se valida cada línea */
|
|
967
|
+
interface StockEntregableDevolucionTR {
|
|
968
|
+
CodigoBusqueda: string;
|
|
969
|
+
CodigoLlave: string;
|
|
970
|
+
Nombre: string;
|
|
971
|
+
SaldoSistema: number;
|
|
972
|
+
/** Series disponibles del técnico que entrega (vacío si el material no tiene series) */
|
|
973
|
+
Series: string[];
|
|
974
|
+
}
|
|
975
|
+
/** Línea enviada por la app (misma forma que ShiftTransferLineDto de sigo-entities) */
|
|
976
|
+
interface LineaDevolucionTR {
|
|
977
|
+
keyCode: string;
|
|
978
|
+
searchCode: string;
|
|
979
|
+
quantity: number;
|
|
980
|
+
series?: string[];
|
|
981
|
+
}
|
|
982
|
+
interface ErrorLineaDevolucionTR {
|
|
983
|
+
index: number;
|
|
984
|
+
message: string;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Valida las líneas de una devolución TR contra el stock del que entrega.
|
|
988
|
+
* - Cada línea debe existir en el stock (CodigoBusqueda + CodigoLlave) y no repetirse.
|
|
989
|
+
* - Cantidad ≤ SaldoSistema.
|
|
990
|
+
* - Materiales con series: las series deben ser del que entrega, sin repetir, y su número = cantidad.
|
|
991
|
+
* - Materiales sin series: no se envían series.
|
|
992
|
+
*/
|
|
993
|
+
declare function validarLineasDevolucionTR(lines: LineaDevolucionTR[], stock: StockEntregableDevolucionTR[]): ErrorLineaDevolucionTR[];
|
|
994
|
+
/** Igual que validarLineasDevolucionTR pero lanza el error (backend) */
|
|
995
|
+
declare function verifyLineasDevolucionTR(lines: LineaDevolucionTR[], stock: StockEntregableDevolucionTR[], BadRequestException?: ClassConstructor<Error>): void;
|
|
996
|
+
|
|
943
997
|
declare enum Position {
|
|
944
998
|
left = "left",
|
|
945
999
|
right = "right"
|
|
@@ -1124,4 +1178,4 @@ declare function getCookieToken(req: Request<any>, webOrigins: string[]): string
|
|
|
1124
1178
|
|
|
1125
1179
|
declare function validateUUIDv4Param(BadRequestException: ClassConstructor<Error>, req: Request<any>, _res: Response, next: NextFunction): Promise<void>;
|
|
1126
1180
|
|
|
1127
|
-
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CantidadMaterialAL04, type CierresPreliquidarAL02, type CierresPreliquidarAL04, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MaterialRequeridoAL04, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, type ModoMaterialesAL04, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SomacylPhotoKey, type TARGET, type TipoPreliquidacionAL02, type TipoPreliquidacionAL04, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, cantidadFijaMOAL04, cantidadMaterialAL04, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codBalizaPreliquidarAL04, codBaremoUnicoDPAL04, codClientes, codIssueByPeriodoAL02, codMOAsfaltoHijasAL04, codMOAsfaltoMadreAL04, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMONoPreliquidablesAL04, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPreliquidarTroncalAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codMaterialesOcultosAL04, codNoCliente, codSopladoRD, codigoParteDiarioHoyCHILE9512, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVTMultifamiliar, documentRequirementAltasNVTUnifamiliar, empresas, esAsignacionPreliquidableAL02, esAsignacionPreliquidableAL04, esCadenaFechaISOValida, esMaterialDuctoAL04, esObjetoFecha, esParteDiarioAprobadoCHILE9512, esParteDiarioEditableCHILE9512, estadoRechazadaPorMetraje, estadoRechazadaPorMetrajeAL04, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, materialesAutomaticosAL04, materialesSeleccionablesAL04, modoMaterialesAL04, motivoConsumoAlmacenAL04, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerCodMOHomePassAL04, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerEspecialidadesCerradasAL04, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, prorratearMaterialesAL04, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, subMaterialesAL04, throwSomacylError, timeZoneCHILE9512, tituloFotoParteDiarioCHILE9512, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validarAsfaltoAL04, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
|
1181
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CantidadMaterialAL04, type CierresPreliquidarAL02, type CierresPreliquidarAL04, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DEVOLUCION_TR_ESTADOS, DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO, DocumentacionReplanteo, type ErrorLineaDevolucionTR, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, type LineaDevolucionTR, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MaterialRequeridoAL04, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, type ModoMaterialesAL04, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SaldoStockPersonal, type SomacylPhotoKey, type StockEntregableDevolucionTR, type TARGET, type TipoPreliquidacionAL02, type TipoPreliquidacionAL04, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularSaldoStockPersonal, calcularTotalMaterialValorizacionPeru9112, cantidadFijaMOAL04, cantidadMaterialAL04, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codBalizaPreliquidarAL04, codBaremoUnicoDPAL04, codClientes, codIssueByPeriodoAL02, codMOAsfaltoHijasAL04, codMOAsfaltoMadreAL04, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMONoPreliquidablesAL04, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPreliquidarTroncalAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codMaterialesOcultosAL04, codNoCliente, codSopladoRD, codigoParteDiarioHoyCHILE9512, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVTMultifamiliar, documentRequirementAltasNVTUnifamiliar, empresas, esAsignacionPreliquidableAL02, esAsignacionPreliquidableAL04, esCadenaFechaISOValida, esMaterialDuctoAL04, esObjetoFecha, esParteDiarioAprobadoCHILE9512, esParteDiarioEditableCHILE9512, estadoRechazadaPorMetraje, estadoRechazadaPorMetrajeAL04, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, materialesAutomaticosAL04, materialesSeleccionablesAL04, modoMaterialesAL04, motivoConsumoAlmacenAL04, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerCodMOHomePassAL04, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerEspecialidadesCerradasAL04, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, prorratearMaterialesAL04, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, subMaterialesAL04, throwDevolucionTRError, throwSomacylError, timeZoneCHILE9512, tituloFotoParteDiarioCHILE9512, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validarAsfaltoAL04, validarLineasDevolucionTR, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyLineasDevolucionTR, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
package/dist/index.d.ts
CHANGED
|
@@ -940,6 +940,60 @@ declare function verifyPhotosNotFinalizedSomacyl(entregables: SomacylEntregables
|
|
|
940
940
|
*/
|
|
941
941
|
declare function getCaptureDateSomacyl(file: Pick<FilesDocDTO, 'Observacion' | 'Fecha_Archivo'>, BadRequestException?: ClassConstructor<Error>): Date;
|
|
942
942
|
|
|
943
|
+
type SaldoStockPersonal = Pick<StockPersonalENTITY, 'Despacho' | 'Devolucion' | 'Liquidacion' | 'DespachoTR' | 'DevolucionTR'>;
|
|
944
|
+
/** Saldo de un StockPersonal: Despacho - Devolucion - Liquidacion + DespachoTR - DevolucionTR (redondeado a 2 decimales) */
|
|
945
|
+
declare function calcularSaldoStockPersonal(stock: SaldoStockPersonal): number;
|
|
946
|
+
|
|
947
|
+
/** Estados de la devolución TR (Logística) */
|
|
948
|
+
declare const DEVOLUCION_TR_ESTADOS: {
|
|
949
|
+
readonly SOLICITADO: {
|
|
950
|
+
readonly ID_Estado: 1;
|
|
951
|
+
readonly Nombre: "SOLICITADO";
|
|
952
|
+
};
|
|
953
|
+
readonly APROBADO: {
|
|
954
|
+
readonly ID_Estado: 3;
|
|
955
|
+
readonly Nombre: "APROBADO";
|
|
956
|
+
};
|
|
957
|
+
readonly ANULADO: {
|
|
958
|
+
readonly ID_Estado: 10;
|
|
959
|
+
readonly Nombre: "ANULADO";
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
/** Motivo de la devolución TR por cambio de turno entre cuadrillas pareja */
|
|
963
|
+
declare const DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO = "CAMBIO_TURNO";
|
|
964
|
+
declare function throwDevolucionTRError(msg: string, Exception?: ClassConstructor<Error>): never;
|
|
965
|
+
|
|
966
|
+
/** Stock del técnico que entrega, tal como se valida cada línea */
|
|
967
|
+
interface StockEntregableDevolucionTR {
|
|
968
|
+
CodigoBusqueda: string;
|
|
969
|
+
CodigoLlave: string;
|
|
970
|
+
Nombre: string;
|
|
971
|
+
SaldoSistema: number;
|
|
972
|
+
/** Series disponibles del técnico que entrega (vacío si el material no tiene series) */
|
|
973
|
+
Series: string[];
|
|
974
|
+
}
|
|
975
|
+
/** Línea enviada por la app (misma forma que ShiftTransferLineDto de sigo-entities) */
|
|
976
|
+
interface LineaDevolucionTR {
|
|
977
|
+
keyCode: string;
|
|
978
|
+
searchCode: string;
|
|
979
|
+
quantity: number;
|
|
980
|
+
series?: string[];
|
|
981
|
+
}
|
|
982
|
+
interface ErrorLineaDevolucionTR {
|
|
983
|
+
index: number;
|
|
984
|
+
message: string;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Valida las líneas de una devolución TR contra el stock del que entrega.
|
|
988
|
+
* - Cada línea debe existir en el stock (CodigoBusqueda + CodigoLlave) y no repetirse.
|
|
989
|
+
* - Cantidad ≤ SaldoSistema.
|
|
990
|
+
* - Materiales con series: las series deben ser del que entrega, sin repetir, y su número = cantidad.
|
|
991
|
+
* - Materiales sin series: no se envían series.
|
|
992
|
+
*/
|
|
993
|
+
declare function validarLineasDevolucionTR(lines: LineaDevolucionTR[], stock: StockEntregableDevolucionTR[]): ErrorLineaDevolucionTR[];
|
|
994
|
+
/** Igual que validarLineasDevolucionTR pero lanza el error (backend) */
|
|
995
|
+
declare function verifyLineasDevolucionTR(lines: LineaDevolucionTR[], stock: StockEntregableDevolucionTR[], BadRequestException?: ClassConstructor<Error>): void;
|
|
996
|
+
|
|
943
997
|
declare enum Position {
|
|
944
998
|
left = "left",
|
|
945
999
|
right = "right"
|
|
@@ -1124,4 +1178,4 @@ declare function getCookieToken(req: Request<any>, webOrigins: string[]): string
|
|
|
1124
1178
|
|
|
1125
1179
|
declare function validateUUIDv4Param(BadRequestException: ClassConstructor<Error>, req: Request<any>, _res: Response, next: NextFunction): Promise<void>;
|
|
1126
1180
|
|
|
1127
|
-
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CantidadMaterialAL04, type CierresPreliquidarAL02, type CierresPreliquidarAL04, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DocumentacionReplanteo, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MaterialRequeridoAL04, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, type ModoMaterialesAL04, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SomacylPhotoKey, type TARGET, type TipoPreliquidacionAL02, type TipoPreliquidacionAL04, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularTotalMaterialValorizacionPeru9112, cantidadFijaMOAL04, cantidadMaterialAL04, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codBalizaPreliquidarAL04, codBaremoUnicoDPAL04, codClientes, codIssueByPeriodoAL02, codMOAsfaltoHijasAL04, codMOAsfaltoMadreAL04, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMONoPreliquidablesAL04, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPreliquidarTroncalAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codMaterialesOcultosAL04, codNoCliente, codSopladoRD, codigoParteDiarioHoyCHILE9512, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVTMultifamiliar, documentRequirementAltasNVTUnifamiliar, empresas, esAsignacionPreliquidableAL02, esAsignacionPreliquidableAL04, esCadenaFechaISOValida, esMaterialDuctoAL04, esObjetoFecha, esParteDiarioAprobadoCHILE9512, esParteDiarioEditableCHILE9512, estadoRechazadaPorMetraje, estadoRechazadaPorMetrajeAL04, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, materialesAutomaticosAL04, materialesSeleccionablesAL04, modoMaterialesAL04, motivoConsumoAlmacenAL04, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerCodMOHomePassAL04, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerEspecialidadesCerradasAL04, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, prorratearMaterialesAL04, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, subMaterialesAL04, throwSomacylError, timeZoneCHILE9512, tituloFotoParteDiarioCHILE9512, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validarAsfaltoAL04, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
|
1181
|
+
export { ActualizarDataManoObra, ActualizarDataReserva, ActualizarDataResumenLiquidaciones, ActualizarDataResumenLiquidacionesColombia, ActualizarDataResumenValorizacionesAlemania, ActualizarDataTrabajos, AsignacionHelper, BuscarZonaContratista, CalcularResumenHPMOLiquidado, CalcularResumenLiquidaciones, CalcularResumenLiquidacionesColombia, CalcularResumenValorizacionesAlemania, type CantidadMaterialAL04, type CierresPreliquidarAL02, type CierresPreliquidarAL04, CodigosMaterialDuctosAL02, CodigosMaterialDuctosAL04, CodigosMaterialSoplado, CodsMapeoMOMaterial, CodsMapeoMOMaterialNVT01, CodsMapeoMOMaterialSopladoClientes, CodsMapeoMOMaterialSopladoTroncal, CodsMapeoMO_Material_Arquertas, CompararFechas, CurrencyFormat, DEVOLUCION_TR_ESTADOS, DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO, DocumentacionReplanteo, type ErrorLineaDevolucionTR, EstadoEspecialidad9612, FormatearErrorValidacionMOHijas, GemeindeChangeNomenclatura, GetCodigoFechaActual, type IDPContrato, type IDocumentacion, type ILineaValidacion, type IMOAndMaterialsRules, type IMORules, type IMateriales, type IResultadoValidacionMOHijas, type LineaDevolucionTR, MOCantidadNVT01, MOHijasAL04, MOHijasDEPTH, MapeoEspecialidades9612, MapeoMOBOMAL04, MapeoMatBOMAL04, type MatRetiradosType, type MatStockAlmacenType, type MatStockPersonalType$2 as MatStockPersonalType, type MatUtilizadosType$2 as MatUtilizadosType, type MaterialRequeridoAL04, type MoUoType$2 as MoUoType, ModelDataFlujosDocumentacionReplanteo, type ModoMaterialesAL04, ObtenerMONoReservada, ObtenerPrecioContratistaVigente, ObtenerZonaAsignada, type ResumenLiquidacionesType, type ResumenLiquidacionesTypeChile, type ResumenLiquidacionesTypeColombia, SEGMENT_TY, SOMACYL_CODIGO_CONTADOR_RETIRADO, SOMACYL_PHOTO_POSITIONS, type SaldoStockPersonal, type SomacylPhotoKey, type StockEntregableDevolucionTR, type TARGET, type TipoPreliquidacionAL02, type TipoPreliquidacionAL04, UpdateNodosDocDP, ValidarRelacionMOHijasAL04, ValorizacionHelper, builSystemOption, buildDataMOFromMaterialRules, buildDataMaterialsRule, buildKeyMO, buildMenu, buildReservaMOJobMajorProjectsAlemaniaAL02, buildReservaMOJobMajorProjectsAlemaniaAL04, buildTenantCollectionName, calcularSaldoStockPersonal, calcularTotalMaterialValorizacionPeru9112, cantidadFijaMOAL04, cantidadMaterialAL04, checkAndBuildMaterialsFromStock, checkMaterialAvailability, codBalizaAL02, codBalizaAL04, codBalizaPreliquidarAL04, codBaremoUnicoDPAL04, codClientes, codIssueByPeriodoAL02, codMOAsfaltoHijasAL04, codMOAsfaltoMadreAL04, codMOClientesAL02, codMOClientesAL02Asfaltado, codMOClientesAL02OC, codMOClientesAL02Soplado, codMOClientes_ReglaLiquidacion1, codMODROPAL04, codMODROPAL04OC, codMODROPAL04Soplado, codMOExcluidos, codMOFTTFAL04, codMONoClientesAL02, codMONoClientesAL02Asfaltado, codMONoClientesAL02OC, codMONoClientesAL02Soplado, codMONoClientes_ReglaLiquidacion1, codMONoPreliquidablesAL04, codMOOcultosAL04, codMOPreliquidarTroncalAL02, codMOPreliquidarTroncalAL04, codMOPublico, codMOTroncalAL02, codMOTroncalAL02Asfaltado, codMOTroncalAL02OC, codMOTroncalAL02Soplado, codMOTroncalAL04, codMOTroncalAL04Asfaltado, codMOTroncalAL04Issue, codMOTroncalAL04OC, codMOTroncalAL04Soplado, codMOTroncalHistoricoAL02, codMOTroncal_ReglaLiquidacion1, codMaterialesOcultosAL04, codNoCliente, codSopladoRD, codigoParteDiarioHoyCHILE9512, codigosBaremosSubcontrataAL02, codigosMOT1_F2, codigosMaterialDuctos, codigosMaterialUGG, codigosSopladoHP, collections, consumirStockPersonal, convertDates, dataFlujosHomePass, db_default, db_root, documentRequirementAltasNVTMultifamiliar, documentRequirementAltasNVTUnifamiliar, empresas, esAsignacionPreliquidableAL02, esAsignacionPreliquidableAL04, esCadenaFechaISOValida, esMaterialDuctoAL04, esObjetoFecha, esParteDiarioAprobadoCHILE9512, esParteDiarioEditableCHILE9512, estadoRechazadaPorMetraje, estadoRechazadaPorMetrajeAL04, formatCurrencyV1, formatNumberSmart, formatNumberV1, formatPercentageV1, generateUniqueNumber, generateUniqueNumberArray, getCaptureDateSomacyl, getChannelName, getContainerName, getCookieToken, getDBName, getDateInTimeZone, getKeyRedisSortedSet, getModelDataAdicional, getNextID_Amap, getNextID_AsignacionValorizacion, getNextID_Valorizacion, getPrecioContratista, getPriceMaterial, getQueueName, getQueueNameSaveOneNotification, getRequestOrigin, hashCode, isValidDate, isValidPartialEntity, logTiempoProceso, mapaDPContratoPrecioFullAL02, mapaEstadoObraFaseAL02, mapaMOMaterialAL02, mapaMOMaterialAL04, mapaReglaSopladoClientes, mapaReglaSopladoTroncal, mapeoZonasSimilares, materialesAutomaticosAL04, materialesSeleccionablesAL04, modoMaterialesAL04, motivoConsumoAlmacenAL04, motivoConsumoMaterialAutomaticoDuctos, newCodMOTroncalReglaLiquidacion1, obtenerCodMOHomePass, obtenerCodMOHomePassAL04, obtenerDocumentacionClientes, obtenerDocumentacionNoClientes, obtenerEspecialidadesCerradas, obtenerEspecialidadesCerradasAL04, obtenerPrecioContratistaMaterial, obtenerPrecioManoObraAL02, obtenerPrecioManoObraAL04, obtenerTipoYCodigoMO, paisMap, parseDuplicateKeyError, prorratearMaterialesAL04, roundNumber, searchCurrentContractorSpecialtyPrice, setColModels, setContext, subMaterialesAL04, throwDevolucionTRError, throwSomacylError, timeZoneCHILE9512, tituloFotoParteDiarioCHILE9512, updatePriceContractorMOAL02, updatePriceContractorMOAL04, updatePriceMOAL02, updatePriceMOAL04, updatePricePBBudgetAlemaniaAL02, updatePricePBBudgetAlemaniaAL04, uuidRegex, validarAsfaltoAL04, validarLineasDevolucionTR, validateNoLookup, validateUUIDv4Param, verifyDetailsFinalizeSomacyl, verifyFiles, verifyInventoryFinalize, verifyInventoryFinalizeSomacyl, verifyInventoryLimitsSomacyl, verifyLineasDevolucionTR, verifyPhotosFinalizeSomacyl, verifyPhotosNotFinalizedSomacyl };
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,8 @@ __export(index_exports, {
|
|
|
43
43
|
CodsMapeoMO_Material_Arquertas: () => CodsMapeoMO_Material_Arquertas,
|
|
44
44
|
CompararFechas: () => CompararFechas,
|
|
45
45
|
CurrencyFormat: () => CurrencyFormat,
|
|
46
|
+
DEVOLUCION_TR_ESTADOS: () => DEVOLUCION_TR_ESTADOS,
|
|
47
|
+
DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO: () => DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO,
|
|
46
48
|
DocumentacionReplanteo: () => DocumentacionReplanteo,
|
|
47
49
|
EstadoEspecialidad9612: () => EstadoEspecialidad9612,
|
|
48
50
|
FormatearErrorValidacionMOHijas: () => FormatearErrorValidacionMOHijas,
|
|
@@ -72,6 +74,7 @@ __export(index_exports, {
|
|
|
72
74
|
buildReservaMOJobMajorProjectsAlemaniaAL02: () => buildReservaMOJobMajorProjectsAlemaniaAL02,
|
|
73
75
|
buildReservaMOJobMajorProjectsAlemaniaAL04: () => buildReservaMOJobMajorProjectsAlemaniaAL04,
|
|
74
76
|
buildTenantCollectionName: () => buildTenantCollectionName,
|
|
77
|
+
calcularSaldoStockPersonal: () => calcularSaldoStockPersonal,
|
|
75
78
|
calcularTotalMaterialValorizacionPeru9112: () => calcularTotalMaterialValorizacionPeru9112,
|
|
76
79
|
cantidadFijaMOAL04: () => cantidadFijaMOAL04,
|
|
77
80
|
cantidadMaterialAL04: () => cantidadMaterialAL04,
|
|
@@ -200,6 +203,7 @@ __export(index_exports, {
|
|
|
200
203
|
setColModels: () => setColModels,
|
|
201
204
|
setContext: () => setContext,
|
|
202
205
|
subMaterialesAL04: () => subMaterialesAL04,
|
|
206
|
+
throwDevolucionTRError: () => throwDevolucionTRError,
|
|
203
207
|
throwSomacylError: () => throwSomacylError,
|
|
204
208
|
timeZoneCHILE9512: () => timeZoneCHILE9512,
|
|
205
209
|
tituloFotoParteDiarioCHILE9512: () => tituloFotoParteDiarioCHILE9512,
|
|
@@ -211,6 +215,7 @@ __export(index_exports, {
|
|
|
211
215
|
updatePricePBBudgetAlemaniaAL04: () => updatePricePBBudgetAlemaniaAL04,
|
|
212
216
|
uuidRegex: () => uuidRegex,
|
|
213
217
|
validarAsfaltoAL04: () => validarAsfaltoAL04,
|
|
218
|
+
validarLineasDevolucionTR: () => validarLineasDevolucionTR,
|
|
214
219
|
validateNoLookup: () => validateNoLookup,
|
|
215
220
|
validateUUIDv4Param: () => validateUUIDv4Param,
|
|
216
221
|
verifyDetailsFinalizeSomacyl: () => verifyDetailsFinalizeSomacyl,
|
|
@@ -218,6 +223,7 @@ __export(index_exports, {
|
|
|
218
223
|
verifyInventoryFinalize: () => verifyInventoryFinalize,
|
|
219
224
|
verifyInventoryFinalizeSomacyl: () => verifyInventoryFinalizeSomacyl,
|
|
220
225
|
verifyInventoryLimitsSomacyl: () => verifyInventoryLimitsSomacyl,
|
|
226
|
+
verifyLineasDevolucionTR: () => verifyLineasDevolucionTR,
|
|
221
227
|
verifyPhotosFinalizeSomacyl: () => verifyPhotosFinalizeSomacyl,
|
|
222
228
|
verifyPhotosNotFinalizedSomacyl: () => verifyPhotosNotFinalizedSomacyl
|
|
223
229
|
});
|
|
@@ -17494,6 +17500,106 @@ function getCaptureDateSomacyl(file, BadRequestException) {
|
|
|
17494
17500
|
}
|
|
17495
17501
|
__name(getCaptureDateSomacyl, "getCaptureDateSomacyl");
|
|
17496
17502
|
|
|
17503
|
+
// src/Logistica/StockPersonal/calcularSaldoStockPersonal.ts
|
|
17504
|
+
function calcularSaldoStockPersonal(stock) {
|
|
17505
|
+
const saldo = (stock.Despacho || 0) - (stock.Devolucion || 0) - (stock.Liquidacion || 0) + (stock.DespachoTR || 0) - (stock.DevolucionTR || 0);
|
|
17506
|
+
return Math.round(saldo * 100) / 100;
|
|
17507
|
+
}
|
|
17508
|
+
__name(calcularSaldoStockPersonal, "calcularSaldoStockPersonal");
|
|
17509
|
+
|
|
17510
|
+
// src/Logistica/DevolucionTR/constants.ts
|
|
17511
|
+
var DEVOLUCION_TR_ESTADOS = {
|
|
17512
|
+
SOLICITADO: {
|
|
17513
|
+
ID_Estado: 1,
|
|
17514
|
+
Nombre: "SOLICITADO"
|
|
17515
|
+
},
|
|
17516
|
+
APROBADO: {
|
|
17517
|
+
ID_Estado: 3,
|
|
17518
|
+
Nombre: "APROBADO"
|
|
17519
|
+
},
|
|
17520
|
+
ANULADO: {
|
|
17521
|
+
ID_Estado: 10,
|
|
17522
|
+
Nombre: "ANULADO"
|
|
17523
|
+
}
|
|
17524
|
+
};
|
|
17525
|
+
var DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO = "CAMBIO_TURNO";
|
|
17526
|
+
function throwDevolucionTRError(msg, Exception) {
|
|
17527
|
+
if (Exception) {
|
|
17528
|
+
throw new Exception(msg, true);
|
|
17529
|
+
}
|
|
17530
|
+
throw new Error(msg, {
|
|
17531
|
+
cause: "USER_MESSAGE"
|
|
17532
|
+
});
|
|
17533
|
+
}
|
|
17534
|
+
__name(throwDevolucionTRError, "throwDevolucionTRError");
|
|
17535
|
+
|
|
17536
|
+
// src/Logistica/DevolucionTR/validarLineasDevolucionTR.ts
|
|
17537
|
+
function validarLineasDevolucionTR(lines, stock) {
|
|
17538
|
+
const errores = [];
|
|
17539
|
+
const vistos = /* @__PURE__ */ new Set();
|
|
17540
|
+
lines.forEach((line, index) => {
|
|
17541
|
+
const key = `${line.searchCode}|${line.keyCode}`;
|
|
17542
|
+
const item = stock.find((s) => s.CodigoBusqueda === line.searchCode && s.CodigoLlave === line.keyCode);
|
|
17543
|
+
const series = line.series ?? [];
|
|
17544
|
+
if (!item) {
|
|
17545
|
+
errores.push({
|
|
17546
|
+
index,
|
|
17547
|
+
message: `El material ${line.keyCode} no est\xE1 en tu stock`
|
|
17548
|
+
});
|
|
17549
|
+
return;
|
|
17550
|
+
}
|
|
17551
|
+
if (vistos.has(key)) {
|
|
17552
|
+
errores.push({
|
|
17553
|
+
index,
|
|
17554
|
+
message: `El material ${item.Nombre} est\xE1 repetido`
|
|
17555
|
+
});
|
|
17556
|
+
return;
|
|
17557
|
+
}
|
|
17558
|
+
vistos.add(key);
|
|
17559
|
+
if (line.quantity > item.SaldoSistema) {
|
|
17560
|
+
errores.push({
|
|
17561
|
+
index,
|
|
17562
|
+
message: `${item.Nombre}: la cantidad (${line.quantity}) supera el saldo (${item.SaldoSistema})`
|
|
17563
|
+
});
|
|
17564
|
+
}
|
|
17565
|
+
if (item.Series.length) {
|
|
17566
|
+
const invalidas = series.filter((s) => !item.Series.includes(s));
|
|
17567
|
+
if (invalidas.length) {
|
|
17568
|
+
errores.push({
|
|
17569
|
+
index,
|
|
17570
|
+
message: `${item.Nombre}: las series ${invalidas.join(", ")} no est\xE1n en tu stock`
|
|
17571
|
+
});
|
|
17572
|
+
}
|
|
17573
|
+
if (new Set(series).size !== series.length) {
|
|
17574
|
+
errores.push({
|
|
17575
|
+
index,
|
|
17576
|
+
message: `${item.Nombre}: hay series repetidas`
|
|
17577
|
+
});
|
|
17578
|
+
}
|
|
17579
|
+
if (series.length !== line.quantity) {
|
|
17580
|
+
errores.push({
|
|
17581
|
+
index,
|
|
17582
|
+
message: `${item.Nombre}: la cantidad (${line.quantity}) debe ser igual al n\xFAmero de series (${series.length})`
|
|
17583
|
+
});
|
|
17584
|
+
}
|
|
17585
|
+
} else if (series.length) {
|
|
17586
|
+
errores.push({
|
|
17587
|
+
index,
|
|
17588
|
+
message: `${item.Nombre}: el material no tiene series`
|
|
17589
|
+
});
|
|
17590
|
+
}
|
|
17591
|
+
});
|
|
17592
|
+
return errores;
|
|
17593
|
+
}
|
|
17594
|
+
__name(validarLineasDevolucionTR, "validarLineasDevolucionTR");
|
|
17595
|
+
function verifyLineasDevolucionTR(lines, stock, BadRequestException) {
|
|
17596
|
+
const errores = validarLineasDevolucionTR(lines, stock);
|
|
17597
|
+
if (errores.length) {
|
|
17598
|
+
throwDevolucionTRError(errores.map((e) => e.message).join(". "), BadRequestException);
|
|
17599
|
+
}
|
|
17600
|
+
}
|
|
17601
|
+
__name(verifyLineasDevolucionTR, "verifyLineasDevolucionTR");
|
|
17602
|
+
|
|
17497
17603
|
// src/constants/collections.ts
|
|
17498
17604
|
var collections = Object.freeze({
|
|
17499
17605
|
PERU_9112_ToaOrder: "PERU_9112_ToaOrder",
|
|
@@ -17767,6 +17873,8 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17767
17873
|
CodsMapeoMO_Material_Arquertas,
|
|
17768
17874
|
CompararFechas,
|
|
17769
17875
|
CurrencyFormat,
|
|
17876
|
+
DEVOLUCION_TR_ESTADOS,
|
|
17877
|
+
DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO,
|
|
17770
17878
|
DocumentacionReplanteo,
|
|
17771
17879
|
EstadoEspecialidad9612,
|
|
17772
17880
|
FormatearErrorValidacionMOHijas,
|
|
@@ -17796,6 +17904,7 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17796
17904
|
buildReservaMOJobMajorProjectsAlemaniaAL02,
|
|
17797
17905
|
buildReservaMOJobMajorProjectsAlemaniaAL04,
|
|
17798
17906
|
buildTenantCollectionName,
|
|
17907
|
+
calcularSaldoStockPersonal,
|
|
17799
17908
|
calcularTotalMaterialValorizacionPeru9112,
|
|
17800
17909
|
cantidadFijaMOAL04,
|
|
17801
17910
|
cantidadMaterialAL04,
|
|
@@ -17924,6 +18033,7 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17924
18033
|
setColModels,
|
|
17925
18034
|
setContext,
|
|
17926
18035
|
subMaterialesAL04,
|
|
18036
|
+
throwDevolucionTRError,
|
|
17927
18037
|
throwSomacylError,
|
|
17928
18038
|
timeZoneCHILE9512,
|
|
17929
18039
|
tituloFotoParteDiarioCHILE9512,
|
|
@@ -17935,6 +18045,7 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17935
18045
|
updatePricePBBudgetAlemaniaAL04,
|
|
17936
18046
|
uuidRegex,
|
|
17937
18047
|
validarAsfaltoAL04,
|
|
18048
|
+
validarLineasDevolucionTR,
|
|
17938
18049
|
validateNoLookup,
|
|
17939
18050
|
validateUUIDv4Param,
|
|
17940
18051
|
verifyDetailsFinalizeSomacyl,
|
|
@@ -17942,6 +18053,7 @@ __name(validateUUIDv4Param, "validateUUIDv4Param");
|
|
|
17942
18053
|
verifyInventoryFinalize,
|
|
17943
18054
|
verifyInventoryFinalizeSomacyl,
|
|
17944
18055
|
verifyInventoryLimitsSomacyl,
|
|
18056
|
+
verifyLineasDevolucionTR,
|
|
17945
18057
|
verifyPhotosFinalizeSomacyl,
|
|
17946
18058
|
verifyPhotosNotFinalizedSomacyl
|
|
17947
18059
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -17272,6 +17272,106 @@ function getCaptureDateSomacyl(file, BadRequestException) {
|
|
|
17272
17272
|
}
|
|
17273
17273
|
__name(getCaptureDateSomacyl, "getCaptureDateSomacyl");
|
|
17274
17274
|
|
|
17275
|
+
// src/Logistica/StockPersonal/calcularSaldoStockPersonal.ts
|
|
17276
|
+
function calcularSaldoStockPersonal(stock) {
|
|
17277
|
+
const saldo = (stock.Despacho || 0) - (stock.Devolucion || 0) - (stock.Liquidacion || 0) + (stock.DespachoTR || 0) - (stock.DevolucionTR || 0);
|
|
17278
|
+
return Math.round(saldo * 100) / 100;
|
|
17279
|
+
}
|
|
17280
|
+
__name(calcularSaldoStockPersonal, "calcularSaldoStockPersonal");
|
|
17281
|
+
|
|
17282
|
+
// src/Logistica/DevolucionTR/constants.ts
|
|
17283
|
+
var DEVOLUCION_TR_ESTADOS = {
|
|
17284
|
+
SOLICITADO: {
|
|
17285
|
+
ID_Estado: 1,
|
|
17286
|
+
Nombre: "SOLICITADO"
|
|
17287
|
+
},
|
|
17288
|
+
APROBADO: {
|
|
17289
|
+
ID_Estado: 3,
|
|
17290
|
+
Nombre: "APROBADO"
|
|
17291
|
+
},
|
|
17292
|
+
ANULADO: {
|
|
17293
|
+
ID_Estado: 10,
|
|
17294
|
+
Nombre: "ANULADO"
|
|
17295
|
+
}
|
|
17296
|
+
};
|
|
17297
|
+
var DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO = "CAMBIO_TURNO";
|
|
17298
|
+
function throwDevolucionTRError(msg, Exception) {
|
|
17299
|
+
if (Exception) {
|
|
17300
|
+
throw new Exception(msg, true);
|
|
17301
|
+
}
|
|
17302
|
+
throw new Error(msg, {
|
|
17303
|
+
cause: "USER_MESSAGE"
|
|
17304
|
+
});
|
|
17305
|
+
}
|
|
17306
|
+
__name(throwDevolucionTRError, "throwDevolucionTRError");
|
|
17307
|
+
|
|
17308
|
+
// src/Logistica/DevolucionTR/validarLineasDevolucionTR.ts
|
|
17309
|
+
function validarLineasDevolucionTR(lines, stock) {
|
|
17310
|
+
const errores = [];
|
|
17311
|
+
const vistos = /* @__PURE__ */ new Set();
|
|
17312
|
+
lines.forEach((line, index) => {
|
|
17313
|
+
const key = `${line.searchCode}|${line.keyCode}`;
|
|
17314
|
+
const item = stock.find((s) => s.CodigoBusqueda === line.searchCode && s.CodigoLlave === line.keyCode);
|
|
17315
|
+
const series = line.series ?? [];
|
|
17316
|
+
if (!item) {
|
|
17317
|
+
errores.push({
|
|
17318
|
+
index,
|
|
17319
|
+
message: `El material ${line.keyCode} no est\xE1 en tu stock`
|
|
17320
|
+
});
|
|
17321
|
+
return;
|
|
17322
|
+
}
|
|
17323
|
+
if (vistos.has(key)) {
|
|
17324
|
+
errores.push({
|
|
17325
|
+
index,
|
|
17326
|
+
message: `El material ${item.Nombre} est\xE1 repetido`
|
|
17327
|
+
});
|
|
17328
|
+
return;
|
|
17329
|
+
}
|
|
17330
|
+
vistos.add(key);
|
|
17331
|
+
if (line.quantity > item.SaldoSistema) {
|
|
17332
|
+
errores.push({
|
|
17333
|
+
index,
|
|
17334
|
+
message: `${item.Nombre}: la cantidad (${line.quantity}) supera el saldo (${item.SaldoSistema})`
|
|
17335
|
+
});
|
|
17336
|
+
}
|
|
17337
|
+
if (item.Series.length) {
|
|
17338
|
+
const invalidas = series.filter((s) => !item.Series.includes(s));
|
|
17339
|
+
if (invalidas.length) {
|
|
17340
|
+
errores.push({
|
|
17341
|
+
index,
|
|
17342
|
+
message: `${item.Nombre}: las series ${invalidas.join(", ")} no est\xE1n en tu stock`
|
|
17343
|
+
});
|
|
17344
|
+
}
|
|
17345
|
+
if (new Set(series).size !== series.length) {
|
|
17346
|
+
errores.push({
|
|
17347
|
+
index,
|
|
17348
|
+
message: `${item.Nombre}: hay series repetidas`
|
|
17349
|
+
});
|
|
17350
|
+
}
|
|
17351
|
+
if (series.length !== line.quantity) {
|
|
17352
|
+
errores.push({
|
|
17353
|
+
index,
|
|
17354
|
+
message: `${item.Nombre}: la cantidad (${line.quantity}) debe ser igual al n\xFAmero de series (${series.length})`
|
|
17355
|
+
});
|
|
17356
|
+
}
|
|
17357
|
+
} else if (series.length) {
|
|
17358
|
+
errores.push({
|
|
17359
|
+
index,
|
|
17360
|
+
message: `${item.Nombre}: el material no tiene series`
|
|
17361
|
+
});
|
|
17362
|
+
}
|
|
17363
|
+
});
|
|
17364
|
+
return errores;
|
|
17365
|
+
}
|
|
17366
|
+
__name(validarLineasDevolucionTR, "validarLineasDevolucionTR");
|
|
17367
|
+
function verifyLineasDevolucionTR(lines, stock, BadRequestException) {
|
|
17368
|
+
const errores = validarLineasDevolucionTR(lines, stock);
|
|
17369
|
+
if (errores.length) {
|
|
17370
|
+
throwDevolucionTRError(errores.map((e) => e.message).join(". "), BadRequestException);
|
|
17371
|
+
}
|
|
17372
|
+
}
|
|
17373
|
+
__name(verifyLineasDevolucionTR, "verifyLineasDevolucionTR");
|
|
17374
|
+
|
|
17275
17375
|
// src/constants/collections.ts
|
|
17276
17376
|
var collections = Object.freeze({
|
|
17277
17377
|
PERU_9112_ToaOrder: "PERU_9112_ToaOrder",
|
|
@@ -17544,6 +17644,8 @@ export {
|
|
|
17544
17644
|
CodsMapeoMO_Material_Arquertas,
|
|
17545
17645
|
CompararFechas,
|
|
17546
17646
|
CurrencyFormat,
|
|
17647
|
+
DEVOLUCION_TR_ESTADOS,
|
|
17648
|
+
DEVOLUCION_TR_MOTIVO_CAMBIO_TURNO,
|
|
17547
17649
|
DocumentacionReplanteo,
|
|
17548
17650
|
EstadoEspecialidad9612,
|
|
17549
17651
|
FormatearErrorValidacionMOHijas,
|
|
@@ -17573,6 +17675,7 @@ export {
|
|
|
17573
17675
|
buildReservaMOJobMajorProjectsAlemaniaAL02,
|
|
17574
17676
|
buildReservaMOJobMajorProjectsAlemaniaAL04,
|
|
17575
17677
|
buildTenantCollectionName,
|
|
17678
|
+
calcularSaldoStockPersonal,
|
|
17576
17679
|
calcularTotalMaterialValorizacionPeru9112,
|
|
17577
17680
|
cantidadFijaMOAL04,
|
|
17578
17681
|
cantidadMaterialAL04,
|
|
@@ -17701,6 +17804,7 @@ export {
|
|
|
17701
17804
|
setColModels,
|
|
17702
17805
|
setContext,
|
|
17703
17806
|
subMaterialesAL04,
|
|
17807
|
+
throwDevolucionTRError,
|
|
17704
17808
|
throwSomacylError,
|
|
17705
17809
|
timeZoneCHILE9512,
|
|
17706
17810
|
tituloFotoParteDiarioCHILE9512,
|
|
@@ -17712,6 +17816,7 @@ export {
|
|
|
17712
17816
|
updatePricePBBudgetAlemaniaAL04,
|
|
17713
17817
|
uuidRegex,
|
|
17714
17818
|
validarAsfaltoAL04,
|
|
17819
|
+
validarLineasDevolucionTR,
|
|
17715
17820
|
validateNoLookup,
|
|
17716
17821
|
validateUUIDv4Param,
|
|
17717
17822
|
verifyDetailsFinalizeSomacyl,
|
|
@@ -17719,6 +17824,7 @@ export {
|
|
|
17719
17824
|
verifyInventoryFinalize,
|
|
17720
17825
|
verifyInventoryFinalizeSomacyl,
|
|
17721
17826
|
verifyInventoryLimitsSomacyl,
|
|
17827
|
+
verifyLineasDevolucionTR,
|
|
17722
17828
|
verifyPhotosFinalizeSomacyl,
|
|
17723
17829
|
verifyPhotosNotFinalizedSomacyl
|
|
17724
17830
|
};
|
package/package.json
CHANGED