parroquia 1.1.33 → 1.1.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0726bb2230e5d5a4102040618f8f34929dff37a4b963b23be14c4244fb0ba23f
4
- data.tar.gz: f2c74b4d67aad6b37babe67dda8ce7a5d568d0b94a7e68c6eb638acfcf0b7a9f
3
+ metadata.gz: a53ed47d6de909cbe2a036b8839e5527c0d9782478dafc6178ed20322b99f824
4
+ data.tar.gz: 94f6a63197c4f971e61fcc62303259d2e41d2cf1eba182456e8f53198cb31724
5
5
  SHA512:
6
- metadata.gz: 2eecab1e6d26c98822eeba8082d95fb36f91b0130e0fbbab4d353c3346214831eba8daeaa40a58390a92336bd60fbfc36521cbc7c017f3c7cb597769191cc8f8
7
- data.tar.gz: 410df19372efd26f674db981d82ea269f8ca765ff625f9b27a81e2c45b86ad0c498e1011b5f52291412e61c65995bfac31d6646d980a694521eda723f118de25
6
+ metadata.gz: eac9c4c9304c4a390afb789a44c6ddbc5798ca1affb530a1bc5eb003f787e4eda5992917cfa8699de852f5edc698cb2a17333a75415f7d82cce27f8342ca49b1
7
+ data.tar.gz: b787b5820d6fccd900ccd7dd39db7d137df1a91313529ea65dbf4dab41f18967cbe59c9ca1a68c66b661d3cb4b7cd4bfd9a1545caacb9703d3386dd10d53f768
@@ -7,7 +7,7 @@ include Fox
7
7
  class ActualizarAlumno < FXMainWindow
8
8
  def initialize(app, registro)
9
9
  @registro = registro
10
- super(app, 'Parroquia San Judas Tadeo', width: 1050, height: 450)
10
+ super(app, 'Parroquia San Judas Tadeo', width: 1050, height: 330)
11
11
  self.backColor = FXRGB(3, 187, 133)
12
12
  # Title
13
13
  @lbltitle = FXLabel.new(self, 'Bienvenido a la Parroquia San Judas Tadeo',
@@ -27,71 +27,78 @@ class ActualizarAlumno < FXMainWindow
27
27
  @lbldate.backColor = FXRGB(3, 187, 133)
28
28
 
29
29
  # section datos
30
- @lbl_anio_lectivo = FXLabel.new(self, 'Año lectivo', opts: LAYOUT_EXPLICIT, width: 250,
30
+ @lbl_anio_lectivo = FXLabel.new(self, 'Año lectivo', opts: LAYOUT_EXPLICIT, width: 150,
31
31
  height: 20, x: 10, y: 150)
32
32
  @lbl_anio_lectivo.backColor = FXRGB(3, 187, 133)
33
- @input_anio_lectivo = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
33
+ @input_anio_lectivo = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
34
34
  y: 150)
35
35
  @input_anio_lectivo.text = @registro[12]
36
36
  @lbl_nivel = FXLabel.new(self, 'Nivel: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20,
37
- x: 680, y: 150)
37
+ x: 330, y: 150)
38
38
  @lbl_nivel.backColor = FXRGB(3, 187, 133)
39
- @input_nivel = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
39
+ @input_nivel = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 490,
40
40
  y: 150)
41
41
  @input_nivel.text = @registro[10]
42
- @lbl_sector = FXLabel.new(self, 'Sector: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
43
- y: 180)
42
+ @lbl_sector = FXLabel.new(self, 'Sector: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 650,
43
+ y: 150)
44
44
  @lbl_sector.backColor = FXRGB(3, 187, 133)
45
- @input_sector = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
46
- y: 180)
45
+ @input_sector = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 810,
46
+ y: 150)
47
47
  @input_sector.text = @registro[11]
48
48
  @lbl_name = FXLabel.new(self, 'Nombres: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
49
- y: 240)
49
+ y: 180)
50
50
  @lbl_name.backColor = FXRGB(3, 187, 133)
51
51
  @input_name = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
52
- y: 240)
52
+ y: 180)
53
53
  @input_name.text = @registro[1]
54
- @lbl_apellidos = FXLabel.new(self, 'Apellidos: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
55
- y: 270)
54
+ @lbl_apellidos = FXLabel.new(self, 'Apellidos: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 330,
55
+ y: 180)
56
56
  @lbl_apellidos.backColor = FXRGB(3, 187, 133)
57
- @input_apellidos = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
58
- y: 270)
57
+ @input_apellidos = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 490,
58
+ y: 180)
59
59
  @input_apellidos.text = @registro[2]
60
60
  @lbl_lugar_nacimiento = FXLabel.new(self, 'Lugar de nacimiento: ', opts: LAYOUT_EXPLICIT, width: 150,
61
- height: 20, x: 10, y: 300)
61
+ height: 20, x: 10, y: 210)
62
62
  @lbl_lugar_nacimiento.backColor = FXRGB(3, 187, 133)
63
63
  @input_lugar_nacimiento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
64
- x: 170, y: 300)
64
+ x: 170, y: 210)
65
65
  @input_lugar_nacimiento.text = @registro[3]
66
66
  @lbl_fecha_nacimiento = FXLabel.new(self, 'Fecha de nacimiento (AAAA/MM/DD): ', opts: LAYOUT_EXPLICIT,
67
- width: 250, height: 20, x: 340, y: 300)
67
+ width: 250, height: 20, x: 340, y: 210)
68
68
  @lbl_fecha_nacimiento.backColor = FXRGB(3, 187, 133)
69
69
  @input_fecha_nacimiento = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
70
- x: 590, y: 300)
70
+ x: 590, y: 210)
71
71
  @input_fecha_nacimiento.text = @registro[4]
72
72
  @lbl_cedula = FXLabel.new(self, 'Cédula: ', opts: LAYOUT_EXPLICIT, width: 80, height: 20, x: 750,
73
- y: 300)
73
+ y: 210)
74
74
  @lbl_cedula.backColor = FXRGB(3, 187, 133)
75
75
  @input_cedula = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 850,
76
- y: 300)
76
+ y: 210)
77
77
  @input_cedula.text = @registro[5]
78
78
  @lbl_nombres_catequista = FXLabel.new(self, 'Nombres Catequista: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
79
- y: 330)
79
+ y: 240)
80
80
  @lbl_nombres_catequista.backColor = FXRGB(3, 187, 133)
81
81
  @input_nombres_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
82
- y: 330)
82
+ y: 240)
83
83
  @input_nombres_catequista.text = @registro[7]
84
- @lbl_apellidos_catequista = FXLabel.new(self, 'Apellidos catequista: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 10,
85
- y: 360)
84
+ @lbl_apellidos_catequista = FXLabel.new(self, 'Apellidos catequista: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 340,
85
+ y: 240)
86
86
  @lbl_apellidos_catequista.backColor = FXRGB(3, 187, 133)
87
- @input_apellidos_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 170,
88
- y: 360)
87
+ @input_apellidos_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 510,
88
+ y: 240)
89
89
  @input_apellidos_catequista.text = @registro[8]
90
+ @lbl_parroco = FXLabel.new(self, 'Párroco: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 680,
91
+ y: 240)
92
+ @lbl_parroco.backColor = FXRGB(3, 187, 133)
93
+ @input_parroco = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 840,
94
+ y: 240)
95
+ @input_parroco.text = @registro[13]
96
+
90
97
  # create buttons
91
98
  @btnupdate = FXButton.new(self, 'Actualizar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
92
- x: 790, y: 400)
99
+ x: 790, y: 280)
93
100
  @btncancel = FXButton.new(self, 'Cancelar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
94
- x: 900, y: 400)
101
+ x: 900, y: 280)
95
102
 
96
103
  # connect buttons
97
104
  @btnupdate.connect(SEL_COMMAND) do
@@ -105,6 +112,7 @@ class ActualizarAlumno < FXMainWindow
105
112
  cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
106
113
  nombres_catequista = @input_nombres_catequista.text.empty? ? nil : @input_nombres_catequista.text
107
114
  apellidos_catequista = @input_apellidos_catequista.text.empty? ? nil : @input_apellidos_catequista.text
115
+ parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
108
116
 
109
117
  # tables
110
118
  # tabla catequistas (id, nombres, apellidos, fecha de nacimiento, lugar de nacimiento, cedula)
@@ -118,8 +126,8 @@ class ActualizarAlumno < FXMainWindow
118
126
 
119
127
  # Actualizar la tabla niveles
120
128
  $conn.exec(
121
- 'UPDATE niveles SET anio_lectivo = $1, nivel = $2, sector = $3 WHERE id = $4', [
122
- anio_lectivo, nivel, sector, registro[9]
129
+ 'UPDATE niveles SET anio_lectivo = $1, nivel = $2, sector = $3, parroco = $4 WHERE id = $5', [
130
+ anio_lectivo, nivel, sector, parroco, registro[9]
123
131
  ]
124
132
  )
125
133
 
@@ -77,6 +77,12 @@ class Alumno < FXMainWindow
77
77
  @lbl_apellidos_catequista.backColor = FXRGB(3, 187, 133)
78
78
  @input_apellidos_catequista = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20,
79
79
  x: 510, y: 240)
80
+ @lbl_parroco = FXLabel.new(self, 'Párroco: ', opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 680,
81
+ y: 240)
82
+ @lbl_parroco.backColor = FXRGB(3, 187, 133)
83
+ @input_parroco = FXTextField.new(self, 10, opts: LAYOUT_EXPLICIT, width: 150, height: 20, x: 840,
84
+ y: 240)
85
+
80
86
  # create buttons
81
87
  @btnsave = FXButton.new(self, 'Guardar', opts: LAYOUT_EXPLICIT | BUTTON_NORMAL, width: 100, height: 30,
82
88
  x: 790, y: 270)
@@ -95,7 +101,7 @@ class Alumno < FXMainWindow
95
101
  cedula = @input_cedula.text.empty? ? nil : @input_cedula.text
96
102
  nombres_catequista = @input_nombre_catequista.text.empty? ? nil : @input_nombre_catequista.text
97
103
  apellidos_catequista = @input_apellidos_catequista.text.empty? ? nil : @input_apellidos_catequista.text
98
-
104
+ parroco = @input_parroco.text.empty? ? nil : @input_parroco.text
99
105
 
100
106
  # tables
101
107
  # tabla catequistas (id, nombres, apellidos, fecha de nacimiento, lugar de nacimiento, cedula)
@@ -106,17 +112,14 @@ class Alumno < FXMainWindow
106
112
  @registro_catequistas = $conn.exec('INSERT INTO catequistas (nombres, apellidos) VALUES ($1, $2)',
107
113
  [nombres_catequista, apellidos_catequista])
108
114
  # Insertar en la tabla niveles
109
- @registro_parroquias = $conn.exec('INSERT INTO niveles (anio_lectivo, nivel, sector) VALUES ($1, $2, $3)',
110
- [anio_lectivo, nivel, sector])
115
+ @registro_parroquias = $conn.exec('INSERT INTO niveles (anio_lectivo, nivel, sector, parroco) VALUES ($1, $2, $3, $4)',
116
+ [anio_lectivo, nivel, sector, parroco])
111
117
  # Insertar en la tabla alumnos
112
118
  @registro_creyentes = $conn.exec(
113
119
  'INSERT INTO alumnos (nombres, apellidos, lugar_nacimiento, fecha_nacimiento, cedula) VALUES ($1, $2, $3, $4, $5)', [
114
120
  name, apellidos, lugar_nacimiento, fecha_nacimiento, cedula
115
121
  ]
116
122
  )
117
- puts @registro_creyentes
118
- puts @registro_parroquias
119
- puts @registro_catequistas
120
123
 
121
124
  # Confirmar la transacción
122
125
  $conn.exec('COMMIT')
@@ -140,6 +143,7 @@ class Alumno < FXMainWindow
140
143
  @input_cedula.text = ''
141
144
  @input_nombre_catequista.text = ''
142
145
  @input_apellidos_catequista.text = ''
146
+ @input_parroco.text = ''
143
147
  end
144
148
  end
145
149
 
@@ -18,7 +18,7 @@ class ResultadosConsulta < FXMainWindow
18
18
  @tabla.visibleRows = 10
19
19
  @tabla.visibleColumns = 10
20
20
  # El tamaño de la tabla depende del número de columnas nombrada en poner nombre a las columnas y las filas al numero de registros encontrados
21
- @tabla.setTableSize(@result_data.length, 13)
21
+ @tabla.setTableSize(@result_data.length, 14)
22
22
 
23
23
 
24
24
  # Llena la tabla con los datos de resultados
@@ -39,9 +39,10 @@ class ResultadosConsulta < FXMainWindow
39
39
  @tabla.setColumnText(7, 'Nivel')
40
40
  @tabla.setColumnText(8, 'Sector')
41
41
  @tabla.setColumnText(9, 'Año lectivo')
42
- @tabla.setColumnText(10, 'ID Catequistas')
43
- @tabla.setColumnText(11, 'Nombres')
44
- @tabla.setColumnText(12, 'Apellidos')
42
+ @tabla.setColumnText(10, 'Párroco')
43
+ @tabla.setColumnText(11, 'ID Catequistas')
44
+ @tabla.setColumnText(12, 'Nombres')
45
+ @tabla.setColumnText(13, 'Apellidos')
45
46
 
46
47
 
47
48
  # Al hacer clic en una fila, se selecciona la fila completa para imprimir los datos
@@ -126,6 +127,14 @@ class ResultadosConsulta < FXMainWindow
126
127
  listar_pdf
127
128
  end
128
129
 
130
+ def registros_seleccionados
131
+ registros = []
132
+ (0...@tabla.numRows).each do |i|
133
+ registros << @result_data[i] if @tabla.isRowSelected(i)
134
+ end
135
+ registros
136
+ end
137
+
129
138
  def listar_pdf
130
139
  selected_columns = seleccionar_columna
131
140
  registros_seleccionados = registros_seleccionados() # Obtén los registros seleccionados
@@ -186,6 +195,56 @@ class ResultadosConsulta < FXMainWindow
186
195
  end
187
196
  end
188
197
 
198
+ def imprimir_pdf
199
+ if registros_seleccionados.empty?
200
+ FXMessageBox.warning(self, MBOX_OK, 'Advertencia', 'Debe seleccionar al menos un registro')
201
+ else
202
+ # Genera el archivo PDF
203
+ Prawn::Document.generate(@archivo_pdf, margin: [100, 100, 100, 100]) do |pdf|
204
+ pdf.font 'Helvetica'
205
+ pdf.font_size 12
206
+ # Definir tres casos en los que se puede imprimir el certificado y los distintos formatos para bautismo, confirmación y matrimonio
207
+ # Bautismo
208
+ # Encabezado
209
+ pdf.image File.join(File.dirname(__FILE__), '../assets/images/arquidiocesisquito.png'), height: 80,
210
+ position: :absolute, at: [-60, 680]
211
+ pdf.text_box 'Arquidiócesis de Quito', align: :center, size: 16, style: :bold, at: [10, 670],
212
+ width: pdf.bounds.width
213
+ pdf.text_box 'Parroquia Eclesiástica "San Judas Tadeo"', align: :center, size: 14, style: :bold,
214
+ at: [10, 650], width: pdf.bounds.width
215
+ pdf.text_box "Jaime Roldós Aguilera, calle Oe13A y N82\nEl Condado, Quito - Ecuador\nTeléfono: 02496446",
216
+ align: :center, size: 10, at: [10, 630], width: pdf.bounds.width
217
+ pdf.image File.join(File.dirname(__FILE__), '../assets/images/sanjudastadeo.png'), height: 80,
218
+ position: :absolute, at: [430, 680]
219
+ # Título del certificado en color rojo
220
+ pdf.move_down 20
221
+ pdf.text 'CERTIFICADO', align: :center, size: 20, style: :bold, color: 'FF0000'
222
+ pdf.move_down 20
223
+ registros_seleccionados.each do |registro|
224
+ # Añadir márgenes izquierdo y derecho
225
+ # Fecha actual alineada a la derecha
226
+ pdf.text "Quito, #{cambiar_formato_fecha(Time.now.strftime('%d/%m/%Y'))}", align: :right
227
+ pdf.move_down 20
228
+ # Cuerpo
229
+ pdf.text "A quien interese por la presente CERTIFICO, que #{registro[1]} #{registro[2]}, participó en esta parroquia en el nivel de #{registro[7]} durante el periodo lectivo #{registro[9]}.", align: :justify
230
+ pdf.move_down 20
231
+ # Despedida
232
+ pdf.text 'Es todo cuanto puedo certificar en honor a la verdad', align: :justify
233
+ pdf.move_down 40
234
+ # Firma del párroco
235
+ pdf.text '_______________________________', align: :center
236
+ # Nombre del párroco
237
+ pdf.text (registro[10]).to_s, align: :center
238
+ # Parroco
239
+ pdf.text 'Párroco', align: :center
240
+ end
241
+ end
242
+ # Abre el archivo PDF con el visor de PDF predeterminado del sistema
243
+ system("xdg-open '#{@archivo_pdf}'")
244
+ # Mensaje de confirmación
245
+ FXMessageBox.information(self, MBOX_OK, 'Información', 'El archivo PDF se ha generado correctamente')
246
+ end
247
+ end
189
248
 
190
249
  @btnedit.connect(SEL_COMMAND) do
191
250
  # Editar registros seleccionados y actualizar la basee de datos
@@ -213,7 +272,7 @@ class ResultadosConsulta < FXMainWindow
213
272
  sql = 'DELETE FROM alumnos WHERE id = $1'
214
273
  $conn.exec_params(sql, [registro[0]])
215
274
  sql = 'DELETE FROM catequistas WHERE id = $1'
216
- $conn.exec_params(sql, [registro[10]])
275
+ $conn.exec_params(sql, [registro[11]])
217
276
  sql = 'DELETE FROM niveles WHERE id = $1'
218
277
  $conn.exec_params(sql, [registro[6]])
219
278
  # Mensaje de confirmación
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parroquia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.33
4
+ version: 1.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Javier Borja Lobato