sigo-package 1.1.21 → 1.1.22
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/Programados/{dtos → Dtos}/ItemDto.d.ts +2 -2
- package/dist/Programados/{dtos → Dtos}/MaterialesUtiRetDto.d.ts +2 -1
- package/dist/sigo-package.cjs.development.js +1 -1
- package/dist/sigo-package.cjs.development.js.map +1 -1
- package/dist/sigo-package.cjs.production.min.js +1 -1
- package/dist/sigo-package.cjs.production.min.js.map +1 -1
- package/dist/sigo-package.esm.js +1 -1
- package/dist/sigo-package.esm.js.map +1 -1
- package/package.json +19 -18
- package/readme.md +32 -32
- package/src/Programados/ActualizarDataManoObra.ts +36 -36
- package/src/Programados/ActualizarDataReserva.ts +8 -8
- package/src/Programados/ActualizarDataResumenLiquidaciones.ts +51 -51
- package/src/Programados/ActualizarDataTrabajos.ts +38 -38
- package/src/Programados/Alemania/ActualizarDataResumenLiquidacionesAlemania.ts +52 -52
- package/src/Programados/Alemania/CalcularResumenHPMOLiquidado/index.ts +45 -45
- package/src/Programados/Alemania/CalcularResumenValorizacionesAlemania.ts +147 -147
- package/src/Programados/Alemania/CodigosMaterialSoplado.ts +8 -8
- package/src/Programados/Alemania/CodsMapeoMOMaterial.ts +40 -40
- package/src/Programados/Alemania/Models/DataFlujosHomePass.ts +37 -37
- package/src/Programados/Alemania/Models/DocumentacionHPBussines.ts +379 -379
- package/src/Programados/Alemania/Models/DocumentacionHPResidential.ts +456 -456
- package/src/Programados/Alemania/Models/index.ts +8 -8
- package/src/Programados/Alemania/ObtenerMONoReservada/filtrarMONoReservada.ts +15 -15
- package/src/Programados/Alemania/ObtenerMONoReservada/generarModeloAmap.md +6 -6
- package/src/Programados/Alemania/ObtenerMONoReservada/generarModeloAmap.ts +89 -89
- package/src/Programados/Alemania/ObtenerMONoReservada/index.ts +76 -76
- package/src/Programados/Alemania/UpdateNodosDocDP/index.ts +45 -45
- package/src/Programados/Alemania/UpdateNodosDocDP/updateNodoAsfaltoRecursivo.ts +42 -42
- package/src/Programados/Alemania/UpdateNodosDocDP/updateNodoZanjaRecursivo.ts +42 -42
- package/src/Programados/Alemania/UpdateNodosDocDP/updateNodosPorEspecialidad.ts +4 -4
- package/src/Programados/Alemania/codMOTroncal_ReglaLiquidacion1.ts +73 -70
- package/src/Programados/Alemania/codigosMOHP.ts +33 -33
- package/src/Programados/Alemania/codigosMaterialDuctos.ts +17 -17
- package/src/Programados/Alemania/codigosMaterialUGG.ts +25 -25
- package/src/Programados/Alemania/index.ts +40 -40
- package/src/Programados/BuscarZonaContratista.ts +27 -27
- package/src/Programados/CalcularResumenLiquidaciones.ts +115 -115
- package/src/Programados/ObtenerZonaAsignada.ts +19 -19
- package/src/Programados/PaisMapping.ts +10 -10
- package/src/Programados/Procesos/Modelos/DocumentacionReplanteo.ts +53 -53
- package/src/Programados/Procesos/Modelos/ModelDataFlujosDocumentacionReplanteo.ts +51 -51
- package/src/Programados/Procesos/Modelos/index.ts +6 -6
- package/src/Programados/Procesos/Preliquidar/ObtenerPrecioContratistaVigente.ts +24 -24
- package/src/Programados/Procesos/Preliquidar/index.ts +4 -4
- package/src/Programados/Procesos/index.ts +10 -10
- package/src/Programados/Procesos/parteDiario/CompararFechas.ts +7 -7
- package/src/Programados/Procesos/parteDiario/GetCodigoFechaActual.ts +10 -10
- package/src/Programados/Procesos/parteDiario/index.ts +6 -6
- package/src/Programados/dtos/AmapCantidadesDto.ts +5 -5
- package/src/Programados/dtos/AmapDto.ts +30 -30
- package/src/Programados/dtos/AsignacionValorizacionDto.ts +17 -17
- package/src/Programados/dtos/CentroCostosDto.ts +9 -9
- package/src/Programados/dtos/CertificacionDto.ts +10 -10
- package/src/Programados/dtos/ContrataDto.ts +6 -6
- package/src/Programados/dtos/ContratoOTDto.ts +8 -8
- package/src/Programados/dtos/DatosCatalogoItemDto.ts +6 -6
- package/src/Programados/dtos/DatosCatalogoMODto.ts +8 -8
- package/src/Programados/dtos/DatosItemDto.ts +5 -5
- package/src/Programados/dtos/DatosManoObraGlobalDto.ts +8 -8
- package/src/Programados/dtos/DatosPrecioEspecialidadDto.ts +9 -9
- package/src/Programados/dtos/DatosPrecioMaterialDto.ts +10 -10
- package/src/Programados/dtos/DatosUnidadObraMaterialDto.ts +6 -6
- package/src/Programados/dtos/DetalleChileReservaMODto.ts +29 -29
- package/src/Programados/dtos/DetalleManoObraChileDto.ts +4 -4
- package/src/Programados/dtos/FlujoDocDto.ts +12 -12
- package/src/Programados/dtos/HomePassDto.ts +13 -13
- package/src/Programados/dtos/ItemCantidadesDto.ts +4 -4
- package/src/Programados/dtos/ItemDto.ts +30 -30
- package/src/Programados/dtos/ManoObraBaremoDto.ts +7 -7
- package/src/Programados/dtos/MaterialAmapDto.ts +15 -15
- package/src/Programados/dtos/MaterialLogisticaDto.ts +9 -9
- package/src/Programados/dtos/MaterialesUtiRetDto.ts +19 -19
- package/src/Programados/dtos/OTGlobalDto.ts +5 -5
- package/src/Programados/dtos/PeriodoDto.ts +8 -8
- package/src/Programados/dtos/PrecioActividadDto.ts +11 -11
- package/src/Programados/dtos/PreciosAgenciaDto.ts +10 -10
- package/src/Programados/dtos/PreciosContrataDto.ts +8 -8
- package/src/Programados/dtos/PreciosVigentesDto.ts +8 -8
- package/src/Programados/dtos/PreciosZonasDto.ts +9 -9
- package/src/Programados/dtos/ProduccionDto.ts +12 -12
- package/src/Programados/dtos/ValorizacionDto.ts +44 -44
- package/src/Programados/dtos/VarianteDto.ts +3 -3
- package/src/Programados/dtos/VigenciaDto.ts +3 -3
- package/src/Programados/dtos/WBEDto.ts +4 -4
- package/src/Programados/dtos/index.ts +10 -10
- package/src/Programados/entitys/DocumentacionPEXEntity.ts +20 -20
- package/src/Programados/entitys/EstadoInternoEntity.ts +22 -22
- package/src/Programados/entitys/ManoDeObraEntity.ts +20 -20
- package/src/Programados/entitys/ManoObraGlobalEntity.ts +19 -19
- package/src/Programados/entitys/ObraEntity.ts +4 -4
- package/src/Programados/entitys/ReservaEntity.ts +20 -20
- package/src/Programados/entitys/TrabajoEntity.ts +76 -76
- package/src/Programados/index.ts +74 -74
- package/src/index.ts +78 -78
- package/src/shared/Utils/CurrencyFormat.ts +79 -79
- package/src/shared/Utils/IsValidDate.ts +2 -2
- package/src/shared/Utils/index.ts +6 -6
- package/src/shared/dtos/AnexoDto.ts +9 -9
- package/src/shared/dtos/BitacoraDto.ts +7 -7
- package/src/shared/dtos/CodigoDescripcionDto.ts +3 -3
- package/src/shared/dtos/CoordenadasDto.ts +3 -3
- package/src/shared/dtos/DelegacionDto.ts +3 -3
- package/src/shared/dtos/EmpresaDto.ts +3 -3
- package/src/shared/dtos/EmpresaUsuarioDto.ts +6 -6
- package/src/shared/dtos/EstadoDto.ts +3 -3
- package/src/shared/dtos/EstadoInternoDto.ts +15 -15
- package/src/shared/dtos/FilesDocDto.ts +19 -19
- package/src/shared/dtos/GeneralCodigoNombreDto.ts +3 -3
- package/src/shared/dtos/GeneralCodigoNombreUnidadDto.ts +4 -4
- package/src/shared/dtos/NodoDocDto.ts +18 -18
- package/src/shared/dtos/PaisDto.ts +3 -3
- package/src/shared/dtos/PersonalDto.ts +7 -7
- package/src/shared/dtos/SizeDto.ts +3 -3
- package/src/shared/dtos/UnidadMedidaDto.ts +3 -3
- package/src/shared/dtos/UsuarioDto.ts +5 -5
- package/src/shared/dtos/UsuarioEdicionDto.ts +4 -4
- package/src/shared/dtos/index.ts +20 -20
- package/src/shared/index.ts +26 -26
- package/tsconfig.json +18 -18
- /package/dist/Programados/{dtos → Dtos}/AmapCantidadesDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/AmapDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/AsignacionValorizacionDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/CentroCostosDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/CertificacionDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/ContrataDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/ContratoOTDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DatosCatalogoItemDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DatosCatalogoMODto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DatosItemDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DatosManoObraGlobalDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DatosPrecioEspecialidadDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DatosPrecioMaterialDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DatosUnidadObraMaterialDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DetalleChileReservaMODto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/DetalleManoObraChileDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/FlujoDocDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/HomePassDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/ItemCantidadesDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/ManoObraBaremoDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/MaterialAmapDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/MaterialLogisticaDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/OTGlobalDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/PeriodoDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/PrecioActividadDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/PreciosAgenciaDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/PreciosContrataDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/PreciosVigentesDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/PreciosZonasDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/ProduccionDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/ValorizacionDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/VarianteDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/VigenciaDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/WBEDto.d.ts +0 -0
- /package/dist/Programados/{dtos → Dtos}/index.d.ts +0 -0
- /package/dist/{shared → Shared}/Utils/CurrencyFormat.d.ts +0 -0
- /package/dist/{shared → Shared}/Utils/IsValidDate.d.ts +0 -0
- /package/dist/{shared → Shared}/Utils/index.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/AnexoDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/BitacoraDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/CodigoDescripcionDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/CoordenadasDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/DelegacionDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/EmpresaDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/EmpresaUsuarioDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/EstadoDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/EstadoInternoDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/FilesDocDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/GeneralCodigoNombreDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/GeneralCodigoNombreUnidadDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/NodoDocDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/PaisDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/PersonalDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/SizeDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/UnidadMedidaDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/UsuarioDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/UsuarioEdicionDto.d.ts +0 -0
- /package/dist/{shared → Shared}/dtos/index.d.ts +0 -0
- /package/dist/{shared → Shared}/index.d.ts +0 -0
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
|
|
2
|
-
export const CalcularResumenLiquidaciones: Funcion = (trabajo, trabajos) => {
|
|
3
|
-
let MoUo: MoUoType[] = [];
|
|
4
|
-
let MatUtilizados: MatUtilizadosType[] = [];
|
|
5
|
-
let MatRetirados: MatRetiradosType[] = [];
|
|
6
|
-
let MatStockPersonal: MatStockPersonalType[] = [];
|
|
7
|
-
let MatStockAlmacen: MatStockPersonalType[] = [];
|
|
8
|
-
for (const trabajoDB of trabajos) {
|
|
9
|
-
|
|
10
|
-
if (trabajoDB.ID_Trabajo === trabajo.ID_Trabajo) {
|
|
11
|
-
trabajoDB.Ultima_PreLiquidacion.Valorizacion = trabajo.Ultima_PreLiquidacion.Valorizacion;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
for (const valorizacion of trabajoDB.Ultima_PreLiquidacion.Valorizacion) {
|
|
15
|
-
if (['PRODUCCION', 'CERTIFICADA', 'PRELIQUIDADA', 'LIQUIDADA'].includes(valorizacion.Ultimo_Estado_Interno.Descripcion.trim())) {
|
|
16
|
-
|
|
17
|
-
const val = MoUo.find(e => e.LineaCodigoCub === valorizacion.DetalleChile.LineaCodigoCub);
|
|
18
|
-
if (val) {
|
|
19
|
-
val.Cantidad += valorizacion.Cantidad;
|
|
20
|
-
val.CantidadUO += valorizacion.CantidadUO;
|
|
21
|
-
} else MoUo.push({
|
|
22
|
-
LineaCodigoCub: valorizacion.DetalleChile.LineaCodigoCub,
|
|
23
|
-
Cantidad: valorizacion.Cantidad,
|
|
24
|
-
CantidadUO: valorizacion.CantidadUO,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
for (const mu of valorizacion.MaterialesUtilizados) {
|
|
28
|
-
if (mu.Estado.ID_Estado === 1) {
|
|
29
|
-
|
|
30
|
-
const muAux = MatUtilizados.find((e: any) => e.Codigo === mu.Codigo);
|
|
31
|
-
if (muAux) muAux.Cantidad += mu.Cantidad;
|
|
32
|
-
else MatUtilizados.push({
|
|
33
|
-
Codigo: mu.Codigo,
|
|
34
|
-
Cantidad: mu.Cantidad,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const matStockPersonal = MatStockPersonal.find(e => e.ID_Trabajo === trabajoDB.ID_Trabajo
|
|
38
|
-
&& e.Codigo === mu.Codigo
|
|
39
|
-
&& e.Identificacion === trabajoDB.Ultima_asignacion.Personal[0].Identificacion
|
|
40
|
-
)
|
|
41
|
-
if (matStockPersonal) matStockPersonal.Cantidad += mu.Cantidad;
|
|
42
|
-
else MatStockPersonal.push({
|
|
43
|
-
ID_Trabajo: trabajoDB.ID_Trabajo,
|
|
44
|
-
Identificacion: trabajoDB.Ultima_asignacion.Personal[0].Identificacion,
|
|
45
|
-
Codigo: mu.Codigo,
|
|
46
|
-
Cantidad: mu.Cantidad,
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
for (const mr of valorizacion.MaterialesRetirados) {
|
|
52
|
-
if (mr.Estado.ID_Estado === 1) {
|
|
53
|
-
const muAux = MatRetirados.find(e => e.Codigo === mr.Codigo);
|
|
54
|
-
if (muAux) muAux.Cantidad += mr.Cantidad;
|
|
55
|
-
else MatRetirados.push({
|
|
56
|
-
Codigo: mr.Codigo,
|
|
57
|
-
Cantidad: mr.Cantidad,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return { MoUo, MatUtilizados, MatRetirados, MatStockPersonal, MatStockAlmacen };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface Funcion {
|
|
68
|
-
(trabajo: TrabajoType, trabajos: any[]): ResumenLiquidacionesType;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface ResumenLiquidacionesType {
|
|
72
|
-
MoUo: MoUoType[];
|
|
73
|
-
MatUtilizados: MatUtilizadosType[];
|
|
74
|
-
MatRetirados: MatRetiradosType[];
|
|
75
|
-
MatStockPersonal: MatStockPersonalType[];
|
|
76
|
-
MatStockAlmacen: MatStockPersonalType[];
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export interface MatStockPersonalType {
|
|
80
|
-
ID_Trabajo: number;
|
|
81
|
-
Identificacion: string;
|
|
82
|
-
Codigo: string;
|
|
83
|
-
Cantidad: number;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface MatRetiradosType {
|
|
87
|
-
Codigo: string;
|
|
88
|
-
Cantidad: number;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface MatUtilizadosType {
|
|
92
|
-
Codigo: string;
|
|
93
|
-
Cantidad: number;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface MoUoType {
|
|
97
|
-
LineaCodigoCub: string;
|
|
98
|
-
Cantidad: number;
|
|
99
|
-
CantidadUO: number;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
interface TrabajoType {
|
|
103
|
-
ID_Trabajo: number;
|
|
104
|
-
Ultima_PreLiquidacion: PreLiquidacionType;
|
|
105
|
-
// Otras propiedades y tipos correspondientes a 'Trabajo'
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
interface PreLiquidacionType {
|
|
109
|
-
Valorizacion: ValorizacionType[];
|
|
110
|
-
// Otras propiedades y tipos correspondientes a 'PreLiquidacion'
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
interface ValorizacionType {
|
|
114
|
-
// Propiedades y tipos correspondientes a 'Valorizacion'
|
|
115
|
-
}
|
|
1
|
+
|
|
2
|
+
export const CalcularResumenLiquidaciones: Funcion = (trabajo, trabajos) => {
|
|
3
|
+
let MoUo: MoUoType[] = [];
|
|
4
|
+
let MatUtilizados: MatUtilizadosType[] = [];
|
|
5
|
+
let MatRetirados: MatRetiradosType[] = [];
|
|
6
|
+
let MatStockPersonal: MatStockPersonalType[] = [];
|
|
7
|
+
let MatStockAlmacen: MatStockPersonalType[] = [];
|
|
8
|
+
for (const trabajoDB of trabajos) {
|
|
9
|
+
|
|
10
|
+
if (trabajoDB.ID_Trabajo === trabajo.ID_Trabajo) {
|
|
11
|
+
trabajoDB.Ultima_PreLiquidacion.Valorizacion = trabajo.Ultima_PreLiquidacion.Valorizacion;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
for (const valorizacion of trabajoDB.Ultima_PreLiquidacion.Valorizacion) {
|
|
15
|
+
if (['PRODUCCION', 'CERTIFICADA', 'PRELIQUIDADA', 'LIQUIDADA'].includes(valorizacion.Ultimo_Estado_Interno.Descripcion.trim())) {
|
|
16
|
+
|
|
17
|
+
const val = MoUo.find(e => e.LineaCodigoCub === valorizacion.DetalleChile.LineaCodigoCub);
|
|
18
|
+
if (val) {
|
|
19
|
+
val.Cantidad += valorizacion.Cantidad;
|
|
20
|
+
val.CantidadUO += valorizacion.CantidadUO;
|
|
21
|
+
} else MoUo.push({
|
|
22
|
+
LineaCodigoCub: valorizacion.DetalleChile.LineaCodigoCub,
|
|
23
|
+
Cantidad: valorizacion.Cantidad,
|
|
24
|
+
CantidadUO: valorizacion.CantidadUO,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
for (const mu of valorizacion.MaterialesUtilizados) {
|
|
28
|
+
if (mu.Estado.ID_Estado === 1) {
|
|
29
|
+
|
|
30
|
+
const muAux = MatUtilizados.find((e: any) => e.Codigo === mu.Codigo);
|
|
31
|
+
if (muAux) muAux.Cantidad += mu.Cantidad;
|
|
32
|
+
else MatUtilizados.push({
|
|
33
|
+
Codigo: mu.Codigo,
|
|
34
|
+
Cantidad: mu.Cantidad,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const matStockPersonal = MatStockPersonal.find(e => e.ID_Trabajo === trabajoDB.ID_Trabajo
|
|
38
|
+
&& e.Codigo === mu.Codigo
|
|
39
|
+
&& e.Identificacion === trabajoDB.Ultima_asignacion.Personal[0].Identificacion
|
|
40
|
+
)
|
|
41
|
+
if (matStockPersonal) matStockPersonal.Cantidad += mu.Cantidad;
|
|
42
|
+
else MatStockPersonal.push({
|
|
43
|
+
ID_Trabajo: trabajoDB.ID_Trabajo,
|
|
44
|
+
Identificacion: trabajoDB.Ultima_asignacion.Personal[0].Identificacion,
|
|
45
|
+
Codigo: mu.Codigo,
|
|
46
|
+
Cantidad: mu.Cantidad,
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
for (const mr of valorizacion.MaterialesRetirados) {
|
|
52
|
+
if (mr.Estado.ID_Estado === 1) {
|
|
53
|
+
const muAux = MatRetirados.find(e => e.Codigo === mr.Codigo);
|
|
54
|
+
if (muAux) muAux.Cantidad += mr.Cantidad;
|
|
55
|
+
else MatRetirados.push({
|
|
56
|
+
Codigo: mr.Codigo,
|
|
57
|
+
Cantidad: mr.Cantidad,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return { MoUo, MatUtilizados, MatRetirados, MatStockPersonal, MatStockAlmacen };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface Funcion {
|
|
68
|
+
(trabajo: TrabajoType, trabajos: any[]): ResumenLiquidacionesType;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ResumenLiquidacionesType {
|
|
72
|
+
MoUo: MoUoType[];
|
|
73
|
+
MatUtilizados: MatUtilizadosType[];
|
|
74
|
+
MatRetirados: MatRetiradosType[];
|
|
75
|
+
MatStockPersonal: MatStockPersonalType[];
|
|
76
|
+
MatStockAlmacen: MatStockPersonalType[];
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export interface MatStockPersonalType {
|
|
80
|
+
ID_Trabajo: number;
|
|
81
|
+
Identificacion: string;
|
|
82
|
+
Codigo: string;
|
|
83
|
+
Cantidad: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface MatRetiradosType {
|
|
87
|
+
Codigo: string;
|
|
88
|
+
Cantidad: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface MatUtilizadosType {
|
|
92
|
+
Codigo: string;
|
|
93
|
+
Cantidad: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface MoUoType {
|
|
97
|
+
LineaCodigoCub: string;
|
|
98
|
+
Cantidad: number;
|
|
99
|
+
CantidadUO: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface TrabajoType {
|
|
103
|
+
ID_Trabajo: number;
|
|
104
|
+
Ultima_PreLiquidacion: PreLiquidacionType;
|
|
105
|
+
// Otras propiedades y tipos correspondientes a 'Trabajo'
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
interface PreLiquidacionType {
|
|
109
|
+
Valorizacion: ValorizacionType[];
|
|
110
|
+
// Otras propiedades y tipos correspondientes a 'PreLiquidacion'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface ValorizacionType {
|
|
114
|
+
// Propiedades y tipos correspondientes a 'Valorizacion'
|
|
115
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
interface Obra {
|
|
2
|
-
ZonaAsignada: string;
|
|
3
|
-
Ubicacion: {
|
|
4
|
-
Municipio: string;
|
|
5
|
-
};
|
|
6
|
-
Pais: {
|
|
7
|
-
Codigo: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function ObtenerZonaAsignada(Obra: Obra): string {
|
|
12
|
-
const zonaMapping: Record<string, string> = {
|
|
13
|
-
'512': Obra.ZonaAsignada,
|
|
14
|
-
'004': Obra.ZonaAsignada,
|
|
15
|
-
'480': Obra.Ubicacion.Municipio
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return zonaMapping[Obra.Pais.Codigo] ? zonaMapping[Obra.Pais.Codigo] : Obra.ZonaAsignada
|
|
19
|
-
}
|
|
1
|
+
interface Obra {
|
|
2
|
+
ZonaAsignada: string;
|
|
3
|
+
Ubicacion: {
|
|
4
|
+
Municipio: string;
|
|
5
|
+
};
|
|
6
|
+
Pais: {
|
|
7
|
+
Codigo: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function ObtenerZonaAsignada(Obra: Obra): string {
|
|
12
|
+
const zonaMapping: Record<string, string> = {
|
|
13
|
+
'512': Obra.ZonaAsignada,
|
|
14
|
+
'004': Obra.ZonaAsignada,
|
|
15
|
+
'480': Obra.Ubicacion.Municipio
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return zonaMapping[Obra.Pais.Codigo] ? zonaMapping[Obra.Pais.Codigo] : Obra.ZonaAsignada
|
|
19
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
interface PaisMap {
|
|
2
|
-
[key: string]: {
|
|
3
|
-
CantidadMin: number
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const paisMap: PaisMap = {
|
|
8
|
-
'480': { CantidadMin: 2 },
|
|
9
|
-
'512': { CantidadMin: 0 },
|
|
10
|
-
'004': { CantidadMin: 0 },
|
|
1
|
+
interface PaisMap {
|
|
2
|
+
[key: string]: {
|
|
3
|
+
CantidadMin: number
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const paisMap: PaisMap = {
|
|
8
|
+
'480': { CantidadMin: 2 },
|
|
9
|
+
'512': { CantidadMin: 0 },
|
|
10
|
+
'004': { CantidadMin: 0 },
|
|
11
11
|
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
export const DocumentacionReplanteo: any[] = [
|
|
2
|
-
{
|
|
3
|
-
"id": 1,
|
|
4
|
-
"label": "REGISTRO FOTOGRAFICO",
|
|
5
|
-
"Children": [],
|
|
6
|
-
"IsDebug": false,
|
|
7
|
-
"Titulo": "REGISTRO FOTOGRAFICO",
|
|
8
|
-
"Codigo": "Cod1",
|
|
9
|
-
"Descripcion": "REGISTRO FOTO GRAFICO",
|
|
10
|
-
"Files": [],
|
|
11
|
-
"Extension": [
|
|
12
|
-
"ALL"
|
|
13
|
-
],
|
|
14
|
-
"Size": {
|
|
15
|
-
"IsDebug": false,
|
|
16
|
-
"Size": 50,
|
|
17
|
-
"UM": "mb"
|
|
18
|
-
},
|
|
19
|
-
"Requerido": false,
|
|
20
|
-
"Estado": {
|
|
21
|
-
"IsDebug": false,
|
|
22
|
-
"ID_Estado": 1,
|
|
23
|
-
"Nombre": "ACTIVO"
|
|
24
|
-
},
|
|
25
|
-
"CantidadMin": 0.0,
|
|
26
|
-
"CantidadMax": 0.0
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"id": 2,
|
|
30
|
-
"label": "PLANO AUXILIAR",
|
|
31
|
-
"Children": [],
|
|
32
|
-
"IsDebug": false,
|
|
33
|
-
"Titulo": "PLANO AUXILIAR",
|
|
34
|
-
"Codigo": "Cod2",
|
|
35
|
-
"Descripcion": "PLANO AUXILIAR",
|
|
36
|
-
"Files": [],
|
|
37
|
-
"Extension": [
|
|
38
|
-
"ALL"
|
|
39
|
-
],
|
|
40
|
-
"Size": {
|
|
41
|
-
"IsDebug": false,
|
|
42
|
-
"Size": 50,
|
|
43
|
-
"UM": "mb"
|
|
44
|
-
},
|
|
45
|
-
"Requerido": true,
|
|
46
|
-
"Estado": {
|
|
47
|
-
"IsDebug": false,
|
|
48
|
-
"ID_Estado": 1,
|
|
49
|
-
"Nombre": "ACTIVO"
|
|
50
|
-
},
|
|
51
|
-
"CantidadMin": 0.0,
|
|
52
|
-
"CantidadMax": 0.0
|
|
53
|
-
}
|
|
1
|
+
export const DocumentacionReplanteo: any[] = [
|
|
2
|
+
{
|
|
3
|
+
"id": 1,
|
|
4
|
+
"label": "REGISTRO FOTOGRAFICO",
|
|
5
|
+
"Children": [],
|
|
6
|
+
"IsDebug": false,
|
|
7
|
+
"Titulo": "REGISTRO FOTOGRAFICO",
|
|
8
|
+
"Codigo": "Cod1",
|
|
9
|
+
"Descripcion": "REGISTRO FOTO GRAFICO",
|
|
10
|
+
"Files": [],
|
|
11
|
+
"Extension": [
|
|
12
|
+
"ALL"
|
|
13
|
+
],
|
|
14
|
+
"Size": {
|
|
15
|
+
"IsDebug": false,
|
|
16
|
+
"Size": 50,
|
|
17
|
+
"UM": "mb"
|
|
18
|
+
},
|
|
19
|
+
"Requerido": false,
|
|
20
|
+
"Estado": {
|
|
21
|
+
"IsDebug": false,
|
|
22
|
+
"ID_Estado": 1,
|
|
23
|
+
"Nombre": "ACTIVO"
|
|
24
|
+
},
|
|
25
|
+
"CantidadMin": 0.0,
|
|
26
|
+
"CantidadMax": 0.0
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": 2,
|
|
30
|
+
"label": "PLANO AUXILIAR",
|
|
31
|
+
"Children": [],
|
|
32
|
+
"IsDebug": false,
|
|
33
|
+
"Titulo": "PLANO AUXILIAR",
|
|
34
|
+
"Codigo": "Cod2",
|
|
35
|
+
"Descripcion": "PLANO AUXILIAR",
|
|
36
|
+
"Files": [],
|
|
37
|
+
"Extension": [
|
|
38
|
+
"ALL"
|
|
39
|
+
],
|
|
40
|
+
"Size": {
|
|
41
|
+
"IsDebug": false,
|
|
42
|
+
"Size": 50,
|
|
43
|
+
"UM": "mb"
|
|
44
|
+
},
|
|
45
|
+
"Requerido": true,
|
|
46
|
+
"Estado": {
|
|
47
|
+
"IsDebug": false,
|
|
48
|
+
"ID_Estado": 1,
|
|
49
|
+
"Nombre": "ACTIVO"
|
|
50
|
+
},
|
|
51
|
+
"CantidadMin": 0.0,
|
|
52
|
+
"CantidadMax": 0.0
|
|
53
|
+
}
|
|
54
54
|
]
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
export const ModelDataFlujosDocumentacionReplanteo = [
|
|
2
|
-
{
|
|
3
|
-
Action: 'Registrar',
|
|
4
|
-
Fecha: new Date(),
|
|
5
|
-
Usuario: '',
|
|
6
|
-
Description: 'Registrar',
|
|
7
|
-
Posicion: '1',
|
|
8
|
-
Icono: 'fa fa-registered',
|
|
9
|
-
ColorIcono: '#1d9d74',
|
|
10
|
-
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
Action: 'Aprobar',
|
|
14
|
-
Fecha: new Date(),
|
|
15
|
-
Usuario: '',
|
|
16
|
-
Description: 'Aprobar',
|
|
17
|
-
Posicion: '2',
|
|
18
|
-
Icono: 'fa fa-check-circle',
|
|
19
|
-
ColorIcono: '#31ce36',
|
|
20
|
-
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
Action: 'Rechazar',
|
|
24
|
-
Fecha: new Date(),
|
|
25
|
-
Usuario: '',
|
|
26
|
-
Description: 'Rechazar',
|
|
27
|
-
Posicion: '3',
|
|
28
|
-
Icono: 'fa fa-minus-circle',
|
|
29
|
-
ColorIcono: '#ffad46',
|
|
30
|
-
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
Action: 'Eliminar',
|
|
34
|
-
Fecha: new Date(),
|
|
35
|
-
Usuario: '',
|
|
36
|
-
Description: 'Eliminar',
|
|
37
|
-
Posicion: '4',
|
|
38
|
-
Icono: 'fa fa-times-circle',
|
|
39
|
-
ColorIcono: '#f25961',
|
|
40
|
-
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
Action: 'Descargar',
|
|
44
|
-
Fecha: new Date(),
|
|
45
|
-
Usuario: '',
|
|
46
|
-
Description: 'Descargar',
|
|
47
|
-
Posicion: '5',
|
|
48
|
-
Icono: 'fa fa-arrow-circle-down',
|
|
49
|
-
ColorIcono: '#084594',
|
|
50
|
-
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
51
|
-
}
|
|
1
|
+
export const ModelDataFlujosDocumentacionReplanteo = [
|
|
2
|
+
{
|
|
3
|
+
Action: 'Registrar',
|
|
4
|
+
Fecha: new Date(),
|
|
5
|
+
Usuario: '',
|
|
6
|
+
Description: 'Registrar',
|
|
7
|
+
Posicion: '1',
|
|
8
|
+
Icono: 'fa fa-registered',
|
|
9
|
+
ColorIcono: '#1d9d74',
|
|
10
|
+
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
Action: 'Aprobar',
|
|
14
|
+
Fecha: new Date(),
|
|
15
|
+
Usuario: '',
|
|
16
|
+
Description: 'Aprobar',
|
|
17
|
+
Posicion: '2',
|
|
18
|
+
Icono: 'fa fa-check-circle',
|
|
19
|
+
ColorIcono: '#31ce36',
|
|
20
|
+
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
Action: 'Rechazar',
|
|
24
|
+
Fecha: new Date(),
|
|
25
|
+
Usuario: '',
|
|
26
|
+
Description: 'Rechazar',
|
|
27
|
+
Posicion: '3',
|
|
28
|
+
Icono: 'fa fa-minus-circle',
|
|
29
|
+
ColorIcono: '#ffad46',
|
|
30
|
+
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
Action: 'Eliminar',
|
|
34
|
+
Fecha: new Date(),
|
|
35
|
+
Usuario: '',
|
|
36
|
+
Description: 'Eliminar',
|
|
37
|
+
Posicion: '4',
|
|
38
|
+
Icono: 'fa fa-times-circle',
|
|
39
|
+
ColorIcono: '#f25961',
|
|
40
|
+
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
Action: 'Descargar',
|
|
44
|
+
Fecha: new Date(),
|
|
45
|
+
Usuario: '',
|
|
46
|
+
Description: 'Descargar',
|
|
47
|
+
Posicion: '5',
|
|
48
|
+
Icono: 'fa fa-arrow-circle-down',
|
|
49
|
+
ColorIcono: '#084594',
|
|
50
|
+
TagPagina: ['tagGestionMacroObrasNuevo'],
|
|
51
|
+
}
|
|
52
52
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DocumentacionReplanteo } from './DocumentacionReplanteo'
|
|
2
|
-
import { ModelDataFlujosDocumentacionReplanteo } from './ModelDataFlujosDocumentacionReplanteo'
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
DocumentacionReplanteo,
|
|
6
|
-
ModelDataFlujosDocumentacionReplanteo
|
|
1
|
+
import { DocumentacionReplanteo } from './DocumentacionReplanteo'
|
|
2
|
+
import { ModelDataFlujosDocumentacionReplanteo } from './ModelDataFlujosDocumentacionReplanteo'
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
DocumentacionReplanteo,
|
|
6
|
+
ModelDataFlujosDocumentacionReplanteo
|
|
7
7
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { IsValidDate } from '../../../shared/index'
|
|
2
|
-
import { PreciosVigentesDto, PrecioActividadDto } from './../../dtos/index'
|
|
3
|
-
|
|
4
|
-
type params = {
|
|
5
|
-
actividad: PrecioActividadDto,
|
|
6
|
-
FechaVerificar: Date
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function ObtenerPrecioContratistaVigente({ actividad, FechaVerificar }: params): PreciosVigentesDto | null {
|
|
10
|
-
const fechaVerificar = new Date(FechaVerificar)
|
|
11
|
-
if (!IsValidDate(fechaVerificar)) throw Error(`La fecha de asignación del Trabajo no es válida.`)
|
|
12
|
-
const Precios: PreciosVigentesDto[] = []
|
|
13
|
-
actividad.Precios.forEach(precio => {
|
|
14
|
-
const fechaInicio = new Date(precio.Vigencia.FechaInicio);
|
|
15
|
-
if (!IsValidDate(fechaInicio)) throw Error(`La fecha de asignación del Trabajo no es válida.`)
|
|
16
|
-
const fechaFin = new Date(precio.Vigencia.FechaFin);
|
|
17
|
-
if (!IsValidDate(fechaFin)) throw Error(`La fecha de asignación del Trabajo no es válida.`)
|
|
18
|
-
if (fechaVerificar.getTime() >= fechaInicio.getTime() && fechaVerificar.getTime() <= fechaFin.getTime()) {
|
|
19
|
-
Precios.push(precio)
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
if (Precios.length > 1) throw Error(`¡Se han identificado múltiples precios con fechas superpuestas!\n${Precios.map(e => `Id_PrecioVigente: ${e.ID_PreciosVigentes}, Precio: ${e.Precio}, FechaInicio: ${e.Vigencia.FechaInicio}, FechaFin: ${e.Vigencia.FechaFin}\n`).join('')}`)
|
|
23
|
-
if (!Precios.length) return null
|
|
24
|
-
return Precios[0]
|
|
1
|
+
import { IsValidDate } from '../../../shared/index'
|
|
2
|
+
import { PreciosVigentesDto, PrecioActividadDto } from './../../dtos/index'
|
|
3
|
+
|
|
4
|
+
type params = {
|
|
5
|
+
actividad: PrecioActividadDto,
|
|
6
|
+
FechaVerificar: Date
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function ObtenerPrecioContratistaVigente({ actividad, FechaVerificar }: params): PreciosVigentesDto | null {
|
|
10
|
+
const fechaVerificar = new Date(FechaVerificar)
|
|
11
|
+
if (!IsValidDate(fechaVerificar)) throw Error(`La fecha de asignación del Trabajo no es válida.`)
|
|
12
|
+
const Precios: PreciosVigentesDto[] = []
|
|
13
|
+
actividad.Precios.forEach(precio => {
|
|
14
|
+
const fechaInicio = new Date(precio.Vigencia.FechaInicio);
|
|
15
|
+
if (!IsValidDate(fechaInicio)) throw Error(`La fecha de asignación del Trabajo no es válida.`)
|
|
16
|
+
const fechaFin = new Date(precio.Vigencia.FechaFin);
|
|
17
|
+
if (!IsValidDate(fechaFin)) throw Error(`La fecha de asignación del Trabajo no es válida.`)
|
|
18
|
+
if (fechaVerificar.getTime() >= fechaInicio.getTime() && fechaVerificar.getTime() <= fechaFin.getTime()) {
|
|
19
|
+
Precios.push(precio)
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
if (Precios.length > 1) throw Error(`¡Se han identificado múltiples precios con fechas superpuestas!\n${Precios.map(e => `Id_PrecioVigente: ${e.ID_PreciosVigentes}, Precio: ${e.Precio}, FechaInicio: ${e.Vigencia.FechaInicio}, FechaFin: ${e.Vigencia.FechaFin}\n`).join('')}`)
|
|
23
|
+
if (!Precios.length) return null
|
|
24
|
+
return Precios[0]
|
|
25
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ObtenerPrecioContratistaVigente } from './ObtenerPrecioContratistaVigente'
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
ObtenerPrecioContratistaVigente
|
|
1
|
+
import { ObtenerPrecioContratistaVigente } from './ObtenerPrecioContratistaVigente'
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
ObtenerPrecioContratistaVigente
|
|
5
5
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DocumentacionReplanteo, ModelDataFlujosDocumentacionReplanteo } from './Modelos/index'
|
|
2
|
-
import { CompararFechas, GetCodigoFechaActual } from './parteDiario/index'
|
|
3
|
-
import { ObtenerPrecioContratistaVigente } from './Preliquidar/index'
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
DocumentacionReplanteo,
|
|
7
|
-
ModelDataFlujosDocumentacionReplanteo,
|
|
8
|
-
CompararFechas,
|
|
9
|
-
GetCodigoFechaActual,
|
|
10
|
-
ObtenerPrecioContratistaVigente,
|
|
1
|
+
import { DocumentacionReplanteo, ModelDataFlujosDocumentacionReplanteo } from './Modelos/index'
|
|
2
|
+
import { CompararFechas, GetCodigoFechaActual } from './parteDiario/index'
|
|
3
|
+
import { ObtenerPrecioContratistaVigente } from './Preliquidar/index'
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
DocumentacionReplanteo,
|
|
7
|
+
ModelDataFlujosDocumentacionReplanteo,
|
|
8
|
+
CompararFechas,
|
|
9
|
+
GetCodigoFechaActual,
|
|
10
|
+
ObtenerPrecioContratistaVigente,
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const CompararFechas = (Fecha1: Date, Fecha2?: Date): boolean => {
|
|
2
|
-
const hoy = Fecha2 ? new Date(Fecha2) : new Date();
|
|
3
|
-
hoy.setHours(0, 0, 0, 0);
|
|
4
|
-
const fecParteDiario = new Date(Fecha1);
|
|
5
|
-
fecParteDiario.setHours(0, 0, 0, 0);
|
|
6
|
-
return fecParteDiario.getTime() === hoy.getTime();
|
|
7
|
-
}
|
|
1
|
+
export const CompararFechas = (Fecha1: Date, Fecha2?: Date): boolean => {
|
|
2
|
+
const hoy = Fecha2 ? new Date(Fecha2) : new Date();
|
|
3
|
+
hoy.setHours(0, 0, 0, 0);
|
|
4
|
+
const fecParteDiario = new Date(Fecha1);
|
|
5
|
+
fecParteDiario.setHours(0, 0, 0, 0);
|
|
6
|
+
return fecParteDiario.getTime() === hoy.getTime();
|
|
7
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export const GetCodigoFechaActual = (): string => {
|
|
2
|
-
// const diaString = new Date().toLocaleString().split(",")[0]
|
|
3
|
-
// const dia = diaString.split('/')[0].padStart(2, '0')
|
|
4
|
-
// const mes = diaString.split('/')[1].padStart(2, '0')
|
|
5
|
-
// const año = diaString.split('/')[2].padStart(2, '0')
|
|
6
|
-
const diaString = new Date()
|
|
7
|
-
const dia = diaString.getDate().toString().padStart(2, '0')
|
|
8
|
-
const mes = (diaString.getMonth() + 1).toString().padStart(2, '0')
|
|
9
|
-
const año = diaString.getFullYear().toString()
|
|
10
|
-
return `${año}${mes}${dia}`
|
|
1
|
+
export const GetCodigoFechaActual = (): string => {
|
|
2
|
+
// const diaString = new Date().toLocaleString().split(",")[0]
|
|
3
|
+
// const dia = diaString.split('/')[0].padStart(2, '0')
|
|
4
|
+
// const mes = diaString.split('/')[1].padStart(2, '0')
|
|
5
|
+
// const año = diaString.split('/')[2].padStart(2, '0')
|
|
6
|
+
const diaString = new Date()
|
|
7
|
+
const dia = diaString.getDate().toString().padStart(2, '0')
|
|
8
|
+
const mes = (diaString.getMonth() + 1).toString().padStart(2, '0')
|
|
9
|
+
const año = diaString.getFullYear().toString()
|
|
10
|
+
return `${año}${mes}${dia}`
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CompararFechas } from './CompararFechas'
|
|
2
|
-
import { GetCodigoFechaActual } from './GetCodigoFechaActual'
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
CompararFechas,
|
|
6
|
-
GetCodigoFechaActual
|
|
1
|
+
import { CompararFechas } from './CompararFechas'
|
|
2
|
+
import { GetCodigoFechaActual } from './GetCodigoFechaActual'
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
CompararFechas,
|
|
6
|
+
GetCodigoFechaActual
|
|
7
7
|
}
|