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.
Files changed (179) hide show
  1. package/dist/Programados/{dtos → Dtos}/ItemDto.d.ts +2 -2
  2. package/dist/Programados/{dtos → Dtos}/MaterialesUtiRetDto.d.ts +2 -1
  3. package/dist/sigo-package.cjs.development.js +1 -1
  4. package/dist/sigo-package.cjs.development.js.map +1 -1
  5. package/dist/sigo-package.cjs.production.min.js +1 -1
  6. package/dist/sigo-package.cjs.production.min.js.map +1 -1
  7. package/dist/sigo-package.esm.js +1 -1
  8. package/dist/sigo-package.esm.js.map +1 -1
  9. package/package.json +19 -18
  10. package/readme.md +32 -32
  11. package/src/Programados/ActualizarDataManoObra.ts +36 -36
  12. package/src/Programados/ActualizarDataReserva.ts +8 -8
  13. package/src/Programados/ActualizarDataResumenLiquidaciones.ts +51 -51
  14. package/src/Programados/ActualizarDataTrabajos.ts +38 -38
  15. package/src/Programados/Alemania/ActualizarDataResumenLiquidacionesAlemania.ts +52 -52
  16. package/src/Programados/Alemania/CalcularResumenHPMOLiquidado/index.ts +45 -45
  17. package/src/Programados/Alemania/CalcularResumenValorizacionesAlemania.ts +147 -147
  18. package/src/Programados/Alemania/CodigosMaterialSoplado.ts +8 -8
  19. package/src/Programados/Alemania/CodsMapeoMOMaterial.ts +40 -40
  20. package/src/Programados/Alemania/Models/DataFlujosHomePass.ts +37 -37
  21. package/src/Programados/Alemania/Models/DocumentacionHPBussines.ts +379 -379
  22. package/src/Programados/Alemania/Models/DocumentacionHPResidential.ts +456 -456
  23. package/src/Programados/Alemania/Models/index.ts +8 -8
  24. package/src/Programados/Alemania/ObtenerMONoReservada/filtrarMONoReservada.ts +15 -15
  25. package/src/Programados/Alemania/ObtenerMONoReservada/generarModeloAmap.md +6 -6
  26. package/src/Programados/Alemania/ObtenerMONoReservada/generarModeloAmap.ts +89 -89
  27. package/src/Programados/Alemania/ObtenerMONoReservada/index.ts +76 -76
  28. package/src/Programados/Alemania/UpdateNodosDocDP/index.ts +45 -45
  29. package/src/Programados/Alemania/UpdateNodosDocDP/updateNodoAsfaltoRecursivo.ts +42 -42
  30. package/src/Programados/Alemania/UpdateNodosDocDP/updateNodoZanjaRecursivo.ts +42 -42
  31. package/src/Programados/Alemania/UpdateNodosDocDP/updateNodosPorEspecialidad.ts +4 -4
  32. package/src/Programados/Alemania/codMOTroncal_ReglaLiquidacion1.ts +73 -70
  33. package/src/Programados/Alemania/codigosMOHP.ts +33 -33
  34. package/src/Programados/Alemania/codigosMaterialDuctos.ts +17 -17
  35. package/src/Programados/Alemania/codigosMaterialUGG.ts +25 -25
  36. package/src/Programados/Alemania/index.ts +40 -40
  37. package/src/Programados/BuscarZonaContratista.ts +27 -27
  38. package/src/Programados/CalcularResumenLiquidaciones.ts +115 -115
  39. package/src/Programados/ObtenerZonaAsignada.ts +19 -19
  40. package/src/Programados/PaisMapping.ts +10 -10
  41. package/src/Programados/Procesos/Modelos/DocumentacionReplanteo.ts +53 -53
  42. package/src/Programados/Procesos/Modelos/ModelDataFlujosDocumentacionReplanteo.ts +51 -51
  43. package/src/Programados/Procesos/Modelos/index.ts +6 -6
  44. package/src/Programados/Procesos/Preliquidar/ObtenerPrecioContratistaVigente.ts +24 -24
  45. package/src/Programados/Procesos/Preliquidar/index.ts +4 -4
  46. package/src/Programados/Procesos/index.ts +10 -10
  47. package/src/Programados/Procesos/parteDiario/CompararFechas.ts +7 -7
  48. package/src/Programados/Procesos/parteDiario/GetCodigoFechaActual.ts +10 -10
  49. package/src/Programados/Procesos/parteDiario/index.ts +6 -6
  50. package/src/Programados/dtos/AmapCantidadesDto.ts +5 -5
  51. package/src/Programados/dtos/AmapDto.ts +30 -30
  52. package/src/Programados/dtos/AsignacionValorizacionDto.ts +17 -17
  53. package/src/Programados/dtos/CentroCostosDto.ts +9 -9
  54. package/src/Programados/dtos/CertificacionDto.ts +10 -10
  55. package/src/Programados/dtos/ContrataDto.ts +6 -6
  56. package/src/Programados/dtos/ContratoOTDto.ts +8 -8
  57. package/src/Programados/dtos/DatosCatalogoItemDto.ts +6 -6
  58. package/src/Programados/dtos/DatosCatalogoMODto.ts +8 -8
  59. package/src/Programados/dtos/DatosItemDto.ts +5 -5
  60. package/src/Programados/dtos/DatosManoObraGlobalDto.ts +8 -8
  61. package/src/Programados/dtos/DatosPrecioEspecialidadDto.ts +9 -9
  62. package/src/Programados/dtos/DatosPrecioMaterialDto.ts +10 -10
  63. package/src/Programados/dtos/DatosUnidadObraMaterialDto.ts +6 -6
  64. package/src/Programados/dtos/DetalleChileReservaMODto.ts +29 -29
  65. package/src/Programados/dtos/DetalleManoObraChileDto.ts +4 -4
  66. package/src/Programados/dtos/FlujoDocDto.ts +12 -12
  67. package/src/Programados/dtos/HomePassDto.ts +13 -13
  68. package/src/Programados/dtos/ItemCantidadesDto.ts +4 -4
  69. package/src/Programados/dtos/ItemDto.ts +30 -30
  70. package/src/Programados/dtos/ManoObraBaremoDto.ts +7 -7
  71. package/src/Programados/dtos/MaterialAmapDto.ts +15 -15
  72. package/src/Programados/dtos/MaterialLogisticaDto.ts +9 -9
  73. package/src/Programados/dtos/MaterialesUtiRetDto.ts +19 -19
  74. package/src/Programados/dtos/OTGlobalDto.ts +5 -5
  75. package/src/Programados/dtos/PeriodoDto.ts +8 -8
  76. package/src/Programados/dtos/PrecioActividadDto.ts +11 -11
  77. package/src/Programados/dtos/PreciosAgenciaDto.ts +10 -10
  78. package/src/Programados/dtos/PreciosContrataDto.ts +8 -8
  79. package/src/Programados/dtos/PreciosVigentesDto.ts +8 -8
  80. package/src/Programados/dtos/PreciosZonasDto.ts +9 -9
  81. package/src/Programados/dtos/ProduccionDto.ts +12 -12
  82. package/src/Programados/dtos/ValorizacionDto.ts +44 -44
  83. package/src/Programados/dtos/VarianteDto.ts +3 -3
  84. package/src/Programados/dtos/VigenciaDto.ts +3 -3
  85. package/src/Programados/dtos/WBEDto.ts +4 -4
  86. package/src/Programados/dtos/index.ts +10 -10
  87. package/src/Programados/entitys/DocumentacionPEXEntity.ts +20 -20
  88. package/src/Programados/entitys/EstadoInternoEntity.ts +22 -22
  89. package/src/Programados/entitys/ManoDeObraEntity.ts +20 -20
  90. package/src/Programados/entitys/ManoObraGlobalEntity.ts +19 -19
  91. package/src/Programados/entitys/ObraEntity.ts +4 -4
  92. package/src/Programados/entitys/ReservaEntity.ts +20 -20
  93. package/src/Programados/entitys/TrabajoEntity.ts +76 -76
  94. package/src/Programados/index.ts +74 -74
  95. package/src/index.ts +78 -78
  96. package/src/shared/Utils/CurrencyFormat.ts +79 -79
  97. package/src/shared/Utils/IsValidDate.ts +2 -2
  98. package/src/shared/Utils/index.ts +6 -6
  99. package/src/shared/dtos/AnexoDto.ts +9 -9
  100. package/src/shared/dtos/BitacoraDto.ts +7 -7
  101. package/src/shared/dtos/CodigoDescripcionDto.ts +3 -3
  102. package/src/shared/dtos/CoordenadasDto.ts +3 -3
  103. package/src/shared/dtos/DelegacionDto.ts +3 -3
  104. package/src/shared/dtos/EmpresaDto.ts +3 -3
  105. package/src/shared/dtos/EmpresaUsuarioDto.ts +6 -6
  106. package/src/shared/dtos/EstadoDto.ts +3 -3
  107. package/src/shared/dtos/EstadoInternoDto.ts +15 -15
  108. package/src/shared/dtos/FilesDocDto.ts +19 -19
  109. package/src/shared/dtos/GeneralCodigoNombreDto.ts +3 -3
  110. package/src/shared/dtos/GeneralCodigoNombreUnidadDto.ts +4 -4
  111. package/src/shared/dtos/NodoDocDto.ts +18 -18
  112. package/src/shared/dtos/PaisDto.ts +3 -3
  113. package/src/shared/dtos/PersonalDto.ts +7 -7
  114. package/src/shared/dtos/SizeDto.ts +3 -3
  115. package/src/shared/dtos/UnidadMedidaDto.ts +3 -3
  116. package/src/shared/dtos/UsuarioDto.ts +5 -5
  117. package/src/shared/dtos/UsuarioEdicionDto.ts +4 -4
  118. package/src/shared/dtos/index.ts +20 -20
  119. package/src/shared/index.ts +26 -26
  120. package/tsconfig.json +18 -18
  121. /package/dist/Programados/{dtos → Dtos}/AmapCantidadesDto.d.ts +0 -0
  122. /package/dist/Programados/{dtos → Dtos}/AmapDto.d.ts +0 -0
  123. /package/dist/Programados/{dtos → Dtos}/AsignacionValorizacionDto.d.ts +0 -0
  124. /package/dist/Programados/{dtos → Dtos}/CentroCostosDto.d.ts +0 -0
  125. /package/dist/Programados/{dtos → Dtos}/CertificacionDto.d.ts +0 -0
  126. /package/dist/Programados/{dtos → Dtos}/ContrataDto.d.ts +0 -0
  127. /package/dist/Programados/{dtos → Dtos}/ContratoOTDto.d.ts +0 -0
  128. /package/dist/Programados/{dtos → Dtos}/DatosCatalogoItemDto.d.ts +0 -0
  129. /package/dist/Programados/{dtos → Dtos}/DatosCatalogoMODto.d.ts +0 -0
  130. /package/dist/Programados/{dtos → Dtos}/DatosItemDto.d.ts +0 -0
  131. /package/dist/Programados/{dtos → Dtos}/DatosManoObraGlobalDto.d.ts +0 -0
  132. /package/dist/Programados/{dtos → Dtos}/DatosPrecioEspecialidadDto.d.ts +0 -0
  133. /package/dist/Programados/{dtos → Dtos}/DatosPrecioMaterialDto.d.ts +0 -0
  134. /package/dist/Programados/{dtos → Dtos}/DatosUnidadObraMaterialDto.d.ts +0 -0
  135. /package/dist/Programados/{dtos → Dtos}/DetalleChileReservaMODto.d.ts +0 -0
  136. /package/dist/Programados/{dtos → Dtos}/DetalleManoObraChileDto.d.ts +0 -0
  137. /package/dist/Programados/{dtos → Dtos}/FlujoDocDto.d.ts +0 -0
  138. /package/dist/Programados/{dtos → Dtos}/HomePassDto.d.ts +0 -0
  139. /package/dist/Programados/{dtos → Dtos}/ItemCantidadesDto.d.ts +0 -0
  140. /package/dist/Programados/{dtos → Dtos}/ManoObraBaremoDto.d.ts +0 -0
  141. /package/dist/Programados/{dtos → Dtos}/MaterialAmapDto.d.ts +0 -0
  142. /package/dist/Programados/{dtos → Dtos}/MaterialLogisticaDto.d.ts +0 -0
  143. /package/dist/Programados/{dtos → Dtos}/OTGlobalDto.d.ts +0 -0
  144. /package/dist/Programados/{dtos → Dtos}/PeriodoDto.d.ts +0 -0
  145. /package/dist/Programados/{dtos → Dtos}/PrecioActividadDto.d.ts +0 -0
  146. /package/dist/Programados/{dtos → Dtos}/PreciosAgenciaDto.d.ts +0 -0
  147. /package/dist/Programados/{dtos → Dtos}/PreciosContrataDto.d.ts +0 -0
  148. /package/dist/Programados/{dtos → Dtos}/PreciosVigentesDto.d.ts +0 -0
  149. /package/dist/Programados/{dtos → Dtos}/PreciosZonasDto.d.ts +0 -0
  150. /package/dist/Programados/{dtos → Dtos}/ProduccionDto.d.ts +0 -0
  151. /package/dist/Programados/{dtos → Dtos}/ValorizacionDto.d.ts +0 -0
  152. /package/dist/Programados/{dtos → Dtos}/VarianteDto.d.ts +0 -0
  153. /package/dist/Programados/{dtos → Dtos}/VigenciaDto.d.ts +0 -0
  154. /package/dist/Programados/{dtos → Dtos}/WBEDto.d.ts +0 -0
  155. /package/dist/Programados/{dtos → Dtos}/index.d.ts +0 -0
  156. /package/dist/{shared → Shared}/Utils/CurrencyFormat.d.ts +0 -0
  157. /package/dist/{shared → Shared}/Utils/IsValidDate.d.ts +0 -0
  158. /package/dist/{shared → Shared}/Utils/index.d.ts +0 -0
  159. /package/dist/{shared → Shared}/dtos/AnexoDto.d.ts +0 -0
  160. /package/dist/{shared → Shared}/dtos/BitacoraDto.d.ts +0 -0
  161. /package/dist/{shared → Shared}/dtos/CodigoDescripcionDto.d.ts +0 -0
  162. /package/dist/{shared → Shared}/dtos/CoordenadasDto.d.ts +0 -0
  163. /package/dist/{shared → Shared}/dtos/DelegacionDto.d.ts +0 -0
  164. /package/dist/{shared → Shared}/dtos/EmpresaDto.d.ts +0 -0
  165. /package/dist/{shared → Shared}/dtos/EmpresaUsuarioDto.d.ts +0 -0
  166. /package/dist/{shared → Shared}/dtos/EstadoDto.d.ts +0 -0
  167. /package/dist/{shared → Shared}/dtos/EstadoInternoDto.d.ts +0 -0
  168. /package/dist/{shared → Shared}/dtos/FilesDocDto.d.ts +0 -0
  169. /package/dist/{shared → Shared}/dtos/GeneralCodigoNombreDto.d.ts +0 -0
  170. /package/dist/{shared → Shared}/dtos/GeneralCodigoNombreUnidadDto.d.ts +0 -0
  171. /package/dist/{shared → Shared}/dtos/NodoDocDto.d.ts +0 -0
  172. /package/dist/{shared → Shared}/dtos/PaisDto.d.ts +0 -0
  173. /package/dist/{shared → Shared}/dtos/PersonalDto.d.ts +0 -0
  174. /package/dist/{shared → Shared}/dtos/SizeDto.d.ts +0 -0
  175. /package/dist/{shared → Shared}/dtos/UnidadMedidaDto.d.ts +0 -0
  176. /package/dist/{shared → Shared}/dtos/UsuarioDto.d.ts +0 -0
  177. /package/dist/{shared → Shared}/dtos/UsuarioEdicionDto.d.ts +0 -0
  178. /package/dist/{shared → Shared}/dtos/index.d.ts +0 -0
  179. /package/dist/{shared → Shared}/index.d.ts +0 -0
@@ -1,9 +1,9 @@
1
- import { obtenerDocumentacionNoClientes } from './DocumentacionHPBussines'
2
- import { obtenerDocumentacionClientes } from './DocumentacionHPResidential'
3
- import { dataFlujosHomePass } from './DataFlujosHomePass'
4
-
5
- export {
6
- dataFlujosHomePass,
7
- obtenerDocumentacionClientes,
8
- obtenerDocumentacionNoClientes,
1
+ import { obtenerDocumentacionNoClientes } from './DocumentacionHPBussines'
2
+ import { obtenerDocumentacionClientes } from './DocumentacionHPResidential'
3
+ import { dataFlujosHomePass } from './DataFlujosHomePass'
4
+
5
+ export {
6
+ dataFlujosHomePass,
7
+ obtenerDocumentacionClientes,
8
+ obtenerDocumentacionNoClientes,
9
9
  }
@@ -1,16 +1,16 @@
1
- import { AmapDto } from '../../dtos/AmapDto'
2
- import { ManoObra } from './index'
3
-
4
- interface params {
5
- ModelosAmap: AmapDto[]
6
- ManoObra: ManoObra
7
- }
8
-
9
- export function filtrarMONoReservada(params: params) {
10
- return params.ModelosAmap.reduce((acc: AmapDto[], amap) => {
11
- // const exist = params.ManoObra.Valorizacion.find(e => e.DetalleChile.LineaCodigoCub === amap.DetalleChile.LineaCodigoCub)
12
- const exist = params.ManoObra.Valorizacion.find(e => e.DetalleChile.ManoObra.Codigo === amap.DetalleChile.ManoObra.Codigo)
13
- if (exist) return acc
14
- return [...acc, amap]
15
- }, [])
1
+ import { AmapDto } from '../../dtos/AmapDto'
2
+ import { ManoObra } from './index'
3
+
4
+ interface params {
5
+ ModelosAmap: AmapDto[]
6
+ ManoObra: ManoObra
7
+ }
8
+
9
+ export function filtrarMONoReservada(params: params) {
10
+ return params.ModelosAmap.reduce((acc: AmapDto[], amap) => {
11
+ // const exist = params.ManoObra.Valorizacion.find(e => e.DetalleChile.LineaCodigoCub === amap.DetalleChile.LineaCodigoCub)
12
+ const exist = params.ManoObra.Valorizacion.find(e => e.DetalleChile.ManoObra.Codigo === amap.DetalleChile.ManoObra.Codigo)
13
+ if (exist) return acc
14
+ return [...acc, amap]
15
+ }, [])
16
16
  }
@@ -1,7 +1,7 @@
1
- DOCUMENTACION:
2
-
3
- # REGLAS:
4
-
5
- 1. Color Orange para Lineas No Reservadas desde Mano Obro Global.
6
- Se utilizó el compo `CantidadUOAprobada` como huella para identidicar las lineas que no estan en reserva ManoObra y que fueron agregadas posteriormente a traves del proceso de Agregar Lineas No Reservadas.
1
+ DOCUMENTACION:
2
+
3
+ # REGLAS:
4
+
5
+ 1. Color Orange para Lineas No Reservadas desde Mano Obro Global.
6
+ Se utilizó el compo `CantidadUOAprobada` como huella para identidicar las lineas que no estan en reserva ManoObra y que fueron agregadas posteriormente a traves del proceso de Agregar Lineas No Reservadas.
7
7
  Se utiliza el Formato numérico `CantidadUOAprobada = 0.000001` dado que en la entidad es numérico. entonses todos las lineas de la reserva que tenga el valor 0.000001 seran coloreadas de color Orange.
@@ -1,90 +1,90 @@
1
- import { DetalleChileReservaMODto } from '../../dtos/DetalleChileReservaMODto'
2
- import { AmapDto } from '../../dtos/AmapDto'
3
- import { ManoObraGlobal, Obra, PrecioEspecialidad } from './index'
4
- import { ManoObraBaremoDto } from '../../dtos/ManoObraBaremoDto'
5
-
6
- interface params {
7
- ManoObraGlobal: ManoObraGlobal
8
- PrecioEspecialidad: PrecioEspecialidad
9
- Precio: number
10
- Obra: Obra
11
- MOB: ManoObraBaremoDto
12
- }
13
-
14
- export function generarModeloAmap(params: params) {
15
-
16
- const { ManoObraGlobal, Precio, PrecioEspecialidad } = params
17
-
18
- const DetalleChile = generarModeloDetalleChile(params)
19
-
20
- const newAmap = new AmapDto()
21
- newAmap.DetalleChile = DetalleChile
22
- newAmap.Amap = ManoObraGlobal.Amap
23
- newAmap.Codigo = ManoObraGlobal.Codigo
24
- newAmap.Descripcion = ManoObraGlobal.Actividad
25
- newAmap.Precio = Precio
26
- newAmap.Total = newAmap.Precio * newAmap.Cantidad * newAmap.DetalleChile.PuntoBaremo
27
- newAmap.Unidad = ManoObraGlobal.Unidad.Nombre
28
- newAmap.Moneda = PrecioEspecialidad.Moneda
29
- newAmap.Simbolo = PrecioEspecialidad.Simbolo
30
- newAmap.Decimales = PrecioEspecialidad.Decimales
31
- newAmap.WBE.CodigoWBE = 'SIGPE'
32
- newAmap.CantidadUOAprobada = 0.000001; // LEER archivo Regla `generarModeloAmap.readme`
33
- newAmap.DatosCatalogoMO = {
34
- DatosManoObraGlobal: {
35
- Actividad: ManoObraGlobal.Actividad,
36
- Alcance: ManoObraGlobal.Alcance,
37
- Material: ManoObraGlobal.Material,
38
- DetalleChile: ManoObraGlobal.DetalleChile
39
- },
40
- DatosPrecioEspecialidad: {
41
- Moneda: PrecioEspecialidad.Moneda,
42
- Simbolo: PrecioEspecialidad.Simbolo,
43
- Decimales: PrecioEspecialidad.Decimales,
44
- Agencias: PrecioEspecialidad.Agencias,
45
- Contratistas: PrecioEspecialidad.Contratistas
46
- },
47
- DatosUnidadObraMaterial: {
48
- Codigo: '0',
49
- Descripcion: 'SIN UO',
50
- Materiales: []
51
- }
52
- }
53
- return newAmap
54
- }
55
-
56
- function generarModeloDetalleChile(params: params) {
57
- const { Obra, ManoObraGlobal, MOB } = params
58
- let codigoVal = '00000';
59
- if(!!Obra?.DetalleChile?.codigo) {
60
- codigoVal = Obra?.DetalleChile?.codigo;
61
- }
62
- const newDto = new DetalleChileReservaMODto()
63
- newDto.Codigo = codigoVal;
64
- newDto.CodigoCub = ""
65
- newDto.Linea = hashCode(ManoObraGlobal.Codigo),
66
- newDto.Especialidad = MOB.Especialidad
67
- newDto.Actividad.Codigo = 'CH0001'
68
- newDto.Actividad.Nombre = 'ACTIVIDAD GENERAL'
69
- newDto.Clave.Codigo = 'CH0001'
70
- newDto.Clave.Nombre = 'CLAVE GENERAL'
71
- newDto.Tarea = '0000'
72
- newDto.ManoObra.Codigo = ManoObraGlobal.Codigo
73
- newDto.ManoObra.Nombre = ManoObraGlobal.Actividad
74
- newDto.ManoObra.UnidadMedida = ManoObraGlobal.Unidad.Nombre
75
- newDto.UnidadObra.Codigo = '0'
76
- newDto.UnidadObra.Nombre = 'SIN UO'
77
- newDto.UnidadObra.UnidadMedida = 'UN'
78
- newDto.LineaCodigoCub = hashCode(ManoObraGlobal.Codigo) + "" + codigoVal;
79
- newDto.PuntoBaremo = MOB.PuntoBaremo
80
- return newDto
81
- }
82
-
83
- function hashCode(str: String = "") {
84
- let hash = 0;
85
- for (let i = 0; i < str.length; i++) {
86
- const char = str.charCodeAt(i);
87
- hash = (hash << 5) - hash + char;
88
- }
89
- return Math.abs(hash).toString();
1
+ import { DetalleChileReservaMODto } from '../../dtos/DetalleChileReservaMODto'
2
+ import { AmapDto } from '../../dtos/AmapDto'
3
+ import { ManoObraGlobal, Obra, PrecioEspecialidad } from './index'
4
+ import { ManoObraBaremoDto } from '../../dtos/ManoObraBaremoDto'
5
+
6
+ interface params {
7
+ ManoObraGlobal: ManoObraGlobal
8
+ PrecioEspecialidad: PrecioEspecialidad
9
+ Precio: number
10
+ Obra: Obra
11
+ MOB: ManoObraBaremoDto
12
+ }
13
+
14
+ export function generarModeloAmap(params: params) {
15
+
16
+ const { ManoObraGlobal, Precio, PrecioEspecialidad } = params
17
+
18
+ const DetalleChile = generarModeloDetalleChile(params)
19
+
20
+ const newAmap = new AmapDto()
21
+ newAmap.DetalleChile = DetalleChile
22
+ newAmap.Amap = ManoObraGlobal.Amap
23
+ newAmap.Codigo = ManoObraGlobal.Codigo
24
+ newAmap.Descripcion = ManoObraGlobal.Actividad
25
+ newAmap.Precio = Precio
26
+ newAmap.Total = newAmap.Precio * newAmap.Cantidad * newAmap.DetalleChile.PuntoBaremo
27
+ newAmap.Unidad = ManoObraGlobal.Unidad.Nombre
28
+ newAmap.Moneda = PrecioEspecialidad.Moneda
29
+ newAmap.Simbolo = PrecioEspecialidad.Simbolo
30
+ newAmap.Decimales = PrecioEspecialidad.Decimales
31
+ newAmap.WBE.CodigoWBE = 'SIGPE'
32
+ newAmap.CantidadUOAprobada = 0.000001; // LEER archivo Regla `generarModeloAmap.readme`
33
+ newAmap.DatosCatalogoMO = {
34
+ DatosManoObraGlobal: {
35
+ Actividad: ManoObraGlobal.Actividad,
36
+ Alcance: ManoObraGlobal.Alcance,
37
+ Material: ManoObraGlobal.Material,
38
+ DetalleChile: ManoObraGlobal.DetalleChile
39
+ },
40
+ DatosPrecioEspecialidad: {
41
+ Moneda: PrecioEspecialidad.Moneda,
42
+ Simbolo: PrecioEspecialidad.Simbolo,
43
+ Decimales: PrecioEspecialidad.Decimales,
44
+ Agencias: PrecioEspecialidad.Agencias,
45
+ Contratistas: PrecioEspecialidad.Contratistas
46
+ },
47
+ DatosUnidadObraMaterial: {
48
+ Codigo: '0',
49
+ Descripcion: 'SIN UO',
50
+ Materiales: []
51
+ }
52
+ }
53
+ return newAmap
54
+ }
55
+
56
+ function generarModeloDetalleChile(params: params) {
57
+ const { Obra, ManoObraGlobal, MOB } = params
58
+ let codigoVal = '00000';
59
+ if(!!Obra?.DetalleChile?.codigo) {
60
+ codigoVal = Obra?.DetalleChile?.codigo;
61
+ }
62
+ const newDto = new DetalleChileReservaMODto()
63
+ newDto.Codigo = codigoVal;
64
+ newDto.CodigoCub = ""
65
+ newDto.Linea = hashCode(ManoObraGlobal.Codigo),
66
+ newDto.Especialidad = MOB.Especialidad
67
+ newDto.Actividad.Codigo = 'CH0001'
68
+ newDto.Actividad.Nombre = 'ACTIVIDAD GENERAL'
69
+ newDto.Clave.Codigo = 'CH0001'
70
+ newDto.Clave.Nombre = 'CLAVE GENERAL'
71
+ newDto.Tarea = '0000'
72
+ newDto.ManoObra.Codigo = ManoObraGlobal.Codigo
73
+ newDto.ManoObra.Nombre = ManoObraGlobal.Actividad
74
+ newDto.ManoObra.UnidadMedida = ManoObraGlobal.Unidad.Nombre
75
+ newDto.UnidadObra.Codigo = '0'
76
+ newDto.UnidadObra.Nombre = 'SIN UO'
77
+ newDto.UnidadObra.UnidadMedida = 'UN'
78
+ newDto.LineaCodigoCub = hashCode(ManoObraGlobal.Codigo) + "" + codigoVal;
79
+ newDto.PuntoBaremo = MOB.PuntoBaremo
80
+ return newDto
81
+ }
82
+
83
+ function hashCode(str: String = "") {
84
+ let hash = 0;
85
+ for (let i = 0; i < str.length; i++) {
86
+ const char = str.charCodeAt(i);
87
+ hash = (hash << 5) - hash + char;
88
+ }
89
+ return Math.abs(hash).toString();
90
90
  }
@@ -1,76 +1,76 @@
1
- import { MaterialAmapDto } from '../../dtos/MaterialAmapDto'
2
- import { DetalleManoObraChileDto } from '../../dtos/DetalleManoObraChileDto'
3
- import { PreciosAgenciaDto } from '../../dtos/PreciosAgenciaDto'
4
- import { PreciosContrataDto } from '../../dtos/PreciosContrataDto'
5
- import { generarModeloAmap } from './generarModeloAmap'
6
- import { AmapDto } from '../../dtos/AmapDto'
7
- import { filtrarMONoReservada } from './filtrarMONoReservada'
8
-
9
- export interface PrecioEspecialidad {
10
- Simbolo: string
11
- Moneda: string
12
- Decimales: number
13
- Especialidad: { Codigo: string }
14
- ContratoOT: { Codigo: string }
15
- Agencias: PreciosAgenciaDto[]
16
- Contratistas: PreciosContrataDto[]
17
- }
18
-
19
- export interface ManoObraGlobal {
20
- Amap: number
21
- Codigo: string
22
- Actividad: string
23
- Alcance: string
24
- Unidad: { Nombre: string }
25
- DetalleChile: DetalleManoObraChileDto
26
- ContratoOT: { Codigo: string }
27
- Material: MaterialAmapDto[]
28
- }
29
-
30
- export interface Obra {
31
- DetalleChile: { numoe: string, codigo: string, agencia: string }
32
- Pais: { Codigo: string }
33
- Delegacion: { Codigo: string }
34
- }
35
-
36
- export interface ManoObra {
37
- Valorizacion: AmapDto[]
38
- }
39
-
40
- interface params {
41
- dataManoObraGlobal: ManoObraGlobal[]
42
- dataPrecioEspecialidad: PrecioEspecialidad[]
43
- Obra: Obra
44
- ManoObra: ManoObra
45
- }
46
-
47
- export function ObtenerMONoReservada(params: params) {
48
-
49
- const { dataManoObraGlobal, dataPrecioEspecialidad, Obra, ManoObra } = params
50
- const ModelosAmap: AmapDto[] = []
51
-
52
- for (const ManoObraGlobal of dataManoObraGlobal) {
53
- for (const MOB of ManoObraGlobal.DetalleChile.ManoObraBaremo) {
54
-
55
- const matchPrecioEspecialidad = dataPrecioEspecialidad.filter(p =>
56
- p.Especialidad.Codigo === MOB.Especialidad.Codigo &&
57
- p.ContratoOT.Codigo === ManoObraGlobal.ContratoOT.Codigo
58
- )
59
-
60
- if (matchPrecioEspecialidad.length !== 1) {
61
- console.warn(`No se pudo obtener Precio Especialidad para ManoObraGlobal: ${ManoObraGlobal.Codigo}, Codigo Especialidad: ${MOB.Especialidad.Codigo}`)
62
- continue
63
- }
64
-
65
- const agencia = matchPrecioEspecialidad[0].Agencias.filter(e => e.Codigo === Obra.DetalleChile.agencia)
66
- if (agencia.length !== 1) {
67
- console.warn(`No se pudo Obtener Agencia`)
68
- continue
69
- }
70
-
71
- const newModelo = generarModeloAmap({ ManoObraGlobal, MOB, Obra, PrecioEspecialidad: matchPrecioEspecialidad[0], Precio: agencia[0].Ultimo_Precio.Precio })
72
- ModelosAmap.push(newModelo)
73
- }
74
- }
75
- return filtrarMONoReservada({ ModelosAmap, ManoObra })
76
- }
1
+ import { MaterialAmapDto } from '../../dtos/MaterialAmapDto'
2
+ import { DetalleManoObraChileDto } from '../../dtos/DetalleManoObraChileDto'
3
+ import { PreciosAgenciaDto } from '../../dtos/PreciosAgenciaDto'
4
+ import { PreciosContrataDto } from '../../dtos/PreciosContrataDto'
5
+ import { generarModeloAmap } from './generarModeloAmap'
6
+ import { AmapDto } from '../../dtos/AmapDto'
7
+ import { filtrarMONoReservada } from './filtrarMONoReservada'
8
+
9
+ export interface PrecioEspecialidad {
10
+ Simbolo: string
11
+ Moneda: string
12
+ Decimales: number
13
+ Especialidad: { Codigo: string }
14
+ ContratoOT: { Codigo: string }
15
+ Agencias: PreciosAgenciaDto[]
16
+ Contratistas: PreciosContrataDto[]
17
+ }
18
+
19
+ export interface ManoObraGlobal {
20
+ Amap: number
21
+ Codigo: string
22
+ Actividad: string
23
+ Alcance: string
24
+ Unidad: { Nombre: string }
25
+ DetalleChile: DetalleManoObraChileDto
26
+ ContratoOT: { Codigo: string }
27
+ Material: MaterialAmapDto[]
28
+ }
29
+
30
+ export interface Obra {
31
+ DetalleChile: { numoe: string, codigo: string, agencia: string }
32
+ Pais: { Codigo: string }
33
+ Delegacion: { Codigo: string }
34
+ }
35
+
36
+ export interface ManoObra {
37
+ Valorizacion: AmapDto[]
38
+ }
39
+
40
+ interface params {
41
+ dataManoObraGlobal: ManoObraGlobal[]
42
+ dataPrecioEspecialidad: PrecioEspecialidad[]
43
+ Obra: Obra
44
+ ManoObra: ManoObra
45
+ }
46
+
47
+ export function ObtenerMONoReservada(params: params) {
48
+
49
+ const { dataManoObraGlobal, dataPrecioEspecialidad, Obra, ManoObra } = params
50
+ const ModelosAmap: AmapDto[] = []
51
+
52
+ for (const ManoObraGlobal of dataManoObraGlobal) {
53
+ for (const MOB of ManoObraGlobal.DetalleChile.ManoObraBaremo) {
54
+
55
+ const matchPrecioEspecialidad = dataPrecioEspecialidad.filter(p =>
56
+ p.Especialidad.Codigo === MOB.Especialidad.Codigo &&
57
+ p.ContratoOT.Codigo === ManoObraGlobal.ContratoOT.Codigo
58
+ )
59
+
60
+ if (matchPrecioEspecialidad.length !== 1) {
61
+ console.warn(`No se pudo obtener Precio Especialidad para ManoObraGlobal: ${ManoObraGlobal.Codigo}, Codigo Especialidad: ${MOB.Especialidad.Codigo}`)
62
+ continue
63
+ }
64
+
65
+ const agencia = matchPrecioEspecialidad[0].Agencias.filter(e => e.Codigo === Obra.DetalleChile.agencia)
66
+ if (agencia.length !== 1) {
67
+ console.warn(`No se pudo Obtener Agencia`)
68
+ continue
69
+ }
70
+
71
+ const newModelo = generarModeloAmap({ ManoObraGlobal, MOB, Obra, PrecioEspecialidad: matchPrecioEspecialidad[0], Precio: agencia[0].Ultimo_Precio.Precio })
72
+ ModelosAmap.push(newModelo)
73
+ }
74
+ }
75
+ return filtrarMONoReservada({ ModelosAmap, ManoObra })
76
+ }
@@ -1,46 +1,46 @@
1
- import { NodoDocDto } from '../../../shared/dtos/NodoDocDto'
2
- import { updateNodoAsfaltoRecursivo } from './updateNodoAsfaltoRecursivo'
3
- import { updateNodosPorEspecialidad } from './updateNodosPorEspecialidad'
4
- import { updateNodoZanjaRecursivo } from './updateNodoZanjaRecursivo'
5
-
6
- interface params<T> {
7
- documentacion: T
8
- obra: {
9
- TotalesGeneralObra: {
10
- PresupuestadoTotalObra: {
11
- TotMetros: number
12
- }
13
- }
14
- }
15
- trabajo?: {
16
- Ultima_asignacion: { Valorizaciones: { Especialidad: { Codigo: string } }[] },
17
- Ultima_PreLiquidacion: {
18
- Valorizacion: {
19
- DetalleChile: { CodigoBarra: string },
20
- Ultimo_Estado_Interno: { Descripcion: string }
21
- }[]
22
- }
23
- }
24
- }
25
-
26
- export interface IDocumentacion {
27
- Nodos: NodoDocDto[]
28
- }
29
-
30
- export const UpdateNodosDocDP = <T extends IDocumentacion>({ documentacion, obra, trabajo }: params<T>) => {
31
- const metros = obra.TotalesGeneralObra.PresupuestadoTotalObra.TotMetros
32
- updateNodoZanjaRecursivo(documentacion.Nodos, metros)
33
- updateNodoAsfaltoRecursivo(documentacion.Nodos, metros)
34
- if (trabajo) {
35
- const codEspecialidadesAux = trabajo.Ultima_asignacion.Valorizaciones.map(e => e.Especialidad.Codigo)
36
- // si informan asphalt poner nodo asfalto en tab calidad cada 50 m (Carlos armará el modelo)
37
- const estados = ['PRODUCCION', 'CERTIFICADA', 'PRELIQUIDADA', 'LIQUIDADA', 'RECHAZADA POR DOCUMENTACION']
38
- const asphalt = trabajo.Ultima_PreLiquidacion.Valorizacion.some(val =>
39
- val.DetalleChile.CodigoBarra === 'Asphalt' &&
40
- estados.includes(val.Ultimo_Estado_Interno.Descripcion)
41
- )
42
- if (asphalt) codEspecialidadesAux.push('05-ASFALTADO')
43
- updateNodosPorEspecialidad(documentacion, codEspecialidadesAux)
44
- }
45
- return documentacion
1
+ import { NodoDocDto } from '../../../shared/dtos/NodoDocDto'
2
+ import { updateNodoAsfaltoRecursivo } from './updateNodoAsfaltoRecursivo'
3
+ import { updateNodosPorEspecialidad } from './updateNodosPorEspecialidad'
4
+ import { updateNodoZanjaRecursivo } from './updateNodoZanjaRecursivo'
5
+
6
+ interface params<T> {
7
+ documentacion: T
8
+ obra: {
9
+ TotalesGeneralObra: {
10
+ PresupuestadoTotalObra: {
11
+ TotMetros: number
12
+ }
13
+ }
14
+ }
15
+ trabajo?: {
16
+ Ultima_asignacion: { Valorizaciones: { Especialidad: { Codigo: string } }[] },
17
+ Ultima_PreLiquidacion: {
18
+ Valorizacion: {
19
+ DetalleChile: { CodigoBarra: string },
20
+ Ultimo_Estado_Interno: { Descripcion: string }
21
+ }[]
22
+ }
23
+ }
24
+ }
25
+
26
+ export interface IDocumentacion {
27
+ Nodos: NodoDocDto[]
28
+ }
29
+
30
+ export const UpdateNodosDocDP = <T extends IDocumentacion>({ documentacion, obra, trabajo }: params<T>) => {
31
+ const metros = obra.TotalesGeneralObra.PresupuestadoTotalObra.TotMetros
32
+ updateNodoZanjaRecursivo(documentacion.Nodos, metros)
33
+ updateNodoAsfaltoRecursivo(documentacion.Nodos, metros)
34
+ if (trabajo) {
35
+ const codEspecialidadesAux = trabajo.Ultima_asignacion.Valorizaciones.map(e => e.Especialidad.Codigo)
36
+ // si informan asphalt poner nodo asfalto en tab calidad cada 50 m (Carlos armará el modelo)
37
+ const estados = ['PRODUCCION', 'CERTIFICADA', 'PRELIQUIDADA', 'LIQUIDADA', 'RECHAZADA POR DOCUMENTACION']
38
+ const asphalt = trabajo.Ultima_PreLiquidacion.Valorizacion.some(val =>
39
+ val.DetalleChile.CodigoBarra === 'Asphalt' &&
40
+ estados.includes(val.Ultimo_Estado_Interno.Descripcion)
41
+ )
42
+ if (asphalt) codEspecialidadesAux.push('05-ASFALTADO')
43
+ updateNodosPorEspecialidad(documentacion, codEspecialidadesAux)
44
+ }
45
+ return documentacion
46
46
  }
@@ -1,43 +1,43 @@
1
- import { NodoDocDto } from '../../../shared/dtos/NodoDocDto'
2
-
3
- export const updateNodoAsfaltoRecursivo = (nodos: NodoDocDto[], metros: number) => {
4
- for (const nodo of nodos) {
5
-
6
- if (nodo.Codigo.trim() !== 'Cod100') updateNodoAsfaltoRecursivo(nodo.Children, metros)
7
-
8
- const nodoCod100 = nodo.Children.find(e => e.Codigo.trim() === 'Cod119')
9
-
10
- if (!nodoCod100) continue
11
-
12
- const childrenAux = nodo.Children.filter(e => !['Cod119'].includes(e.Codigo))
13
- const mtsCod119 = 50 //CAMBIAR SEGUN LO PEDIDO
14
- const numCod110 = Math.ceil(metros / mtsCod119)
15
- const newNodosCod110 = []
16
-
17
- for (let index = 0; index < numCod110; index++) {
18
- const inicial = index * mtsCod119
19
- const final = inicial + mtsCod119
20
- const textAdd = `${inicial}m - ${final}m`
21
- const numAdd = `${inicial}${final}`
22
- const newNodo = structuredClone(nodoCod100)
23
- newNodo.Codigo = `${newNodo.Codigo}${numAdd}`
24
- newNodo.Descripcion = textAdd
25
- newNodo.Titulo = textAdd
26
- newNodo.id = Number(`${newNodo.id}${numAdd}`)
27
- newNodo.label = textAdd
28
- updateChildren(newNodo.Children, numAdd)
29
- newNodosCod110.push(newNodo)
30
- }
31
-
32
- nodo.Children = [...childrenAux, ...newNodosCod110]
33
-
34
- }
35
- }
36
-
37
- function updateChildren(Children: NodoDocDto[], numAdd: string) {
38
- for (const nodo of Children) {
39
- nodo.Codigo = `${nodo.Codigo}${numAdd}`
40
- nodo.id = Number(`${nodo.id}${numAdd}`)
41
- updateChildren(nodo.Children, numAdd)
42
- }
1
+ import { NodoDocDto } from '../../../shared/dtos/NodoDocDto'
2
+
3
+ export const updateNodoAsfaltoRecursivo = (nodos: NodoDocDto[], metros: number) => {
4
+ for (const nodo of nodos) {
5
+
6
+ if (nodo.Codigo.trim() !== 'Cod100') updateNodoAsfaltoRecursivo(nodo.Children, metros)
7
+
8
+ const nodoCod100 = nodo.Children.find(e => e.Codigo.trim() === 'Cod119')
9
+
10
+ if (!nodoCod100) continue
11
+
12
+ const childrenAux = nodo.Children.filter(e => !['Cod119'].includes(e.Codigo))
13
+ const mtsCod119 = 50 //CAMBIAR SEGUN LO PEDIDO
14
+ const numCod110 = Math.ceil(metros / mtsCod119)
15
+ const newNodosCod110 = []
16
+
17
+ for (let index = 0; index < numCod110; index++) {
18
+ const inicial = index * mtsCod119
19
+ const final = inicial + mtsCod119
20
+ const textAdd = `${inicial}m - ${final}m`
21
+ const numAdd = `${inicial}${final}`
22
+ const newNodo = structuredClone(nodoCod100)
23
+ newNodo.Codigo = `${newNodo.Codigo}${numAdd}`
24
+ newNodo.Descripcion = textAdd
25
+ newNodo.Titulo = textAdd
26
+ newNodo.id = Number(`${newNodo.id}${numAdd}`)
27
+ newNodo.label = textAdd
28
+ updateChildren(newNodo.Children, numAdd)
29
+ newNodosCod110.push(newNodo)
30
+ }
31
+
32
+ nodo.Children = [...childrenAux, ...newNodosCod110]
33
+
34
+ }
35
+ }
36
+
37
+ function updateChildren(Children: NodoDocDto[], numAdd: string) {
38
+ for (const nodo of Children) {
39
+ nodo.Codigo = `${nodo.Codigo}${numAdd}`
40
+ nodo.id = Number(`${nodo.id}${numAdd}`)
41
+ updateChildren(nodo.Children, numAdd)
42
+ }
43
43
  }
@@ -1,43 +1,43 @@
1
- import { NodoDocDto } from '../../../shared/dtos/NodoDocDto'
2
-
3
- export const updateNodoZanjaRecursivo = (nodos: NodoDocDto[], metros: number) => {
4
- for (const nodo of nodos) {
5
-
6
- if (nodo.Codigo.trim() !== 'Cod61') updateNodoZanjaRecursivo(nodo.Children, metros)
7
-
8
- const nodoCod110 = nodo.Children.find(e => e.Codigo.trim() === 'Cod110')
9
-
10
- if (!nodoCod110) continue
11
-
12
- const childrenAux = nodo.Children.filter(e => !['Cod110'].includes(e.Codigo))
13
- const mtsCod110 = 50 //CAMBIAR SEGUN LO PEDIDO
14
- const numCod110 = Math.ceil(metros / mtsCod110)
15
- const newNodosCod110 = []
16
-
17
- for (let index = 0; index < numCod110; index++) {
18
- const inicial = index * mtsCod110
19
- const final = inicial + mtsCod110
20
- const textAdd = `${inicial}m - ${final}m`
21
- const numAdd = `${inicial}${final}`
22
- const newNodo = structuredClone(nodoCod110)
23
- newNodo.Codigo = `${newNodo.Codigo}${numAdd}`
24
- newNodo.Descripcion = textAdd
25
- newNodo.Titulo = textAdd
26
- newNodo.id = Number(`${newNodo.id}${numAdd}`)
27
- newNodo.label = textAdd
28
- updateChildren(newNodo.Children, numAdd)
29
- newNodosCod110.push(newNodo)
30
- }
31
-
32
- nodo.Children = [...childrenAux, ...newNodosCod110]
33
-
34
- }
35
- }
36
-
37
- function updateChildren(Children: NodoDocDto[], numAdd: string) {
38
- for (const nodo of Children) {
39
- nodo.Codigo = `${nodo.Codigo}${numAdd}`
40
- nodo.id = Number(`${nodo.id}${numAdd}`)
41
- updateChildren(nodo.Children, numAdd)
42
- }
1
+ import { NodoDocDto } from '../../../shared/dtos/NodoDocDto'
2
+
3
+ export const updateNodoZanjaRecursivo = (nodos: NodoDocDto[], metros: number) => {
4
+ for (const nodo of nodos) {
5
+
6
+ if (nodo.Codigo.trim() !== 'Cod61') updateNodoZanjaRecursivo(nodo.Children, metros)
7
+
8
+ const nodoCod110 = nodo.Children.find(e => e.Codigo.trim() === 'Cod110')
9
+
10
+ if (!nodoCod110) continue
11
+
12
+ const childrenAux = nodo.Children.filter(e => !['Cod110'].includes(e.Codigo))
13
+ const mtsCod110 = 50 //CAMBIAR SEGUN LO PEDIDO
14
+ const numCod110 = Math.ceil(metros / mtsCod110)
15
+ const newNodosCod110 = []
16
+
17
+ for (let index = 0; index < numCod110; index++) {
18
+ const inicial = index * mtsCod110
19
+ const final = inicial + mtsCod110
20
+ const textAdd = `${inicial}m - ${final}m`
21
+ const numAdd = `${inicial}${final}`
22
+ const newNodo = structuredClone(nodoCod110)
23
+ newNodo.Codigo = `${newNodo.Codigo}${numAdd}`
24
+ newNodo.Descripcion = textAdd
25
+ newNodo.Titulo = textAdd
26
+ newNodo.id = Number(`${newNodo.id}${numAdd}`)
27
+ newNodo.label = textAdd
28
+ updateChildren(newNodo.Children, numAdd)
29
+ newNodosCod110.push(newNodo)
30
+ }
31
+
32
+ nodo.Children = [...childrenAux, ...newNodosCod110]
33
+
34
+ }
35
+ }
36
+
37
+ function updateChildren(Children: NodoDocDto[], numAdd: string) {
38
+ for (const nodo of Children) {
39
+ nodo.Codigo = `${nodo.Codigo}${numAdd}`
40
+ nodo.id = Number(`${nodo.id}${numAdd}`)
41
+ updateChildren(nodo.Children, numAdd)
42
+ }
43
43
  }