utn-cli 2.0.67 → 2.0.69

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.0.67",
3
+ "version": "2.0.69",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -103,6 +103,63 @@ class Miscelaneo {
103
103
  }
104
104
 
105
105
  //REPORTE INICIA AQUÍ
106
+
107
+ async generarFirmaHTML(Identificador, FechaDeLaFirma) {
108
+ const [persona] = await ejecutarConsultaSIGU("SELECT Identificacion, CONCAT(Nombre, ' ', PrimerApellido, ' ', SegundoApellido) AS NombreCompleto FROM SIGU.SIGU_Personas WHERE Identificador = ?", [Identificador]);
109
+
110
+ if (!persona) return '';
111
+
112
+ const nombre = persona.NombreCompleto;
113
+ const identificacion = persona.Identificacion;
114
+ const instancia = await (async () => {
115
+ try {
116
+ const result = await ejecutarConsultaSIGU(`
117
+ SELECT
118
+ CASE
119
+ WHEN i.TipoDeResponsabilidad = 'Ninguna' THEN sup.Nombre
120
+ ELSE i.Nombre
121
+ END AS Nombre
122
+ FROM SIGU.EstructuraOrganizacional_Instancias i
123
+ LEFT JOIN SIGU.EstructuraOrganizacional_Instancias sup
124
+ ON i.IdentificadorDeInstanciaSuperior = sup.IdentificadorDeInstancia
125
+ WHERE i.Identificador = ?
126
+ `, [Identificador]);
127
+ return result?.[0]?.Nombre || 'N/A';
128
+ } catch {
129
+ return 'N/A';
130
+ }
131
+ })();
132
+
133
+ return ` <div style="
134
+ font-size: 9px;
135
+ border: 1px solid #eee;
136
+ padding: 6px;
137
+ display: inline-flex;
138
+ align-items: center;
139
+ background-color: #fcfcfc;
140
+ gap: 8px;
141
+ ">
142
+ <div class="logo" style="display:flex; align-items:center;">
143
+ <img src="https://storage.sigu.utn.ac.cr/images/cards/LogoUTN.svg"
144
+ alt="Logo UTN"
145
+ style="height:25px;">
146
+ </div>
147
+ <div style="
148
+ width: 1px;
149
+ height: 50px;
150
+ background-color: #ccc;
151
+ "></div>
152
+ <div style="text-align: left;">
153
+ <strong>FIRMADO DIGITALMENTE POR:</strong><br>
154
+ ${nombre}<br>
155
+ Cédula: ${identificacion}<br>
156
+ Instancia: ${instancia}<br>
157
+ Fecha: ${FechaDeLaFirma}
158
+ </div>
159
+
160
+ </div>`;
161
+ }
162
+
106
163
  GenerarReporteHTMLRegistrosVerticales(ElementosParaLaTabla, ParametrosExcluidos = [], ParametrosExtra = []) {
107
164
  //Ejemplo ElementosParaLaTabla:
108
165
  // [
@@ -28,8 +28,10 @@
28
28
  <div [class]="cantidadLugar">
29
29
  <p>{{ (cantidadAMostrar !== 0 ? cantidadAMostrar : '') }}</p>
30
30
  </div>
31
- <hr [id]="'porcentaje'+titulo" class="linea" [matTooltip]="'Cantidad: ' + cantidad" matTooltipPosition="above"/>
32
- <div class="pie">
31
+ @if(cantidad > 0) {
32
+ <hr [id]="'porcentaje'+titulo" class="linea" [matTooltip]="'Cantidad: ' + cantidad" matTooltipPosition="above" />
33
+ }
34
+ <!-- <div class="pie">
33
35
  <p>CONTINUAR</p>
34
- </div>
36
+ </div> -->
35
37
  </div>