parroquia 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,71 +4,110 @@ include Fox
4
4
  class Matrimonio < FXMainWindow
5
5
  def initialize(app)
6
6
  super(app, "Parroquia San Judas Tadeo", :width => 1050, :height => 530)
7
- # create label
7
+ self.backColor = FXRGB(3,187,133)
8
+ # Title
8
9
  @lbltitle = FXLabel.new(self, "Bienvenido a la Parroquia San Judas Tadeo", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 20)
9
- # create label
10
- @lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - VICARIA NORTE SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 40)
11
-
12
- #create label
13
- @date = Time.now.strftime("%d/%m/%Y %H:%M:%S")
14
- @lbldate = FXLabel.new(self, "Fecha: #{@date}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 1000, :height => 20, :x => 0, :y => 60)
15
- #section libros
10
+ @lbltitle.font = FXFont.new(app, "Geneva", 16, FONTWEIGHT_BOLD)
11
+ @lbltitle.backColor = FXRGB(3,187,133)
12
+ # Subtitle
13
+ @lblsubtitle = FXLabel.new(self, "ARQUIDIOSESIS DE QUITO - SERVICIO PARROQUIAL DE SAN JUDAS TADEO", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 0, :y => 40)
14
+ @lblsubtitle.font = FXFont.new(app, "Geneva", 10, FONTWEIGHT_BOLD)
15
+ @lblsubtitle.backColor = FXRGB(3,187,133)
16
+ # Date
17
+ @date = Time.now.strftime("%d/%m/%Y")
18
+ @lbldate = FXLabel.new(self, "Fecha: #{cambiar_formato_fecha(@date)}", :opts => LAYOUT_EXPLICIT|JUSTIFY_RIGHT, :width => 1050, :height => 20, :x => 0, :y => 60, :padRight => 20)
19
+ @lbldate.font = FXFont.new(app, "Geneva", 12, FONTWEIGHT_BOLD)
20
+ @lbldate.backColor = FXRGB(3,187,133)
21
+ # section libros
16
22
  @lbl_tomo = FXLabel.new(self, "Tomo", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 100)
23
+ @lbl_tomo.backColor = FXRGB(3,187,133)
17
24
  @input_tomo = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 110, :y => 100)
18
25
  @lbl_page = FXLabel.new(self, "Pagina", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 100)
26
+ @lbl_page.backColor = FXRGB(3,187,133)
19
27
  @input_page = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 230, :y => 100)
20
28
  @lbl_number = FXLabel.new(self, "Numero", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 100)
29
+ @lbl_number.backColor = FXRGB(3,187,133)
21
30
  @input_number = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 350, :y => 100)
22
31
 
23
32
  #section datos
24
33
  @lbl_fecha = FXLabel.new(self, "Fecha de matrimonio (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 250, :height => 20, :x => 10, :y => 150)
34
+ @lbl_fecha.backColor = FXRGB(3,187,133)
25
35
  @input_fecha = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 340, :y => 150)
26
36
  @lbl_sacramento = FXLabel.new(self, "Sacramento: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 150)
37
+ @lbl_sacramento.backColor = FXRGB(3,187,133)
27
38
  @input_sacramento = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 150)
39
+ @input_sacramento.text = "Matrimonio"
40
+ @input_sacramento.disable
28
41
  @lbl_parroquia = FXLabel.new(self, "Iglesia parroquial: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 180)
42
+ @lbl_parroquia.backColor = FXRGB(3,187,133)
29
43
  @input_parroquia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 180)
44
+ @input_parroquia.text = "San Judas Tadeo"
45
+ @input_parroquia.disable
30
46
  @lbl_sector = FXLabel.new(self, "Sector: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 180)
47
+ @lbl_sector.backColor = FXRGB(3,187,133)
31
48
  @input_sector = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 180)
49
+ @input_sector.text = "La Roldós"
50
+ @input_sector.disable
32
51
  @lbl_parroco = FXLabel.new(self, "Parroco: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 180)
52
+ @lbl_parroco.backColor = FXRGB(3,187,133)
33
53
  @input_parroco = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 180)
34
54
  @lbl_celebrante = FXLabel.new(self, "Celebrante: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 210)
55
+ @lbl_celebrante.backColor = FXRGB(3,187,133)
35
56
  @input_celebrante = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 210)
36
57
  @lbl_name_novio = FXLabel.new(self, "Nombres del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 240)
58
+ @lbl_name_novio.backColor = FXRGB(3,187,133)
37
59
  @input_name_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 240)
38
60
  @lbl_apellido_novio = FXLabel.new(self, "Apellidos del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 240)
61
+ @lbl_apellido_novio.backColor = FXRGB(3,187,133)
39
62
  @input_apellido_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 240)
40
63
  @lbl_cedula_novio = FXLabel.new(self, "Cédula del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 240)
64
+ @lbl_cedula_novio.backColor = FXRGB(3,187,133)
41
65
  @input_cedula_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 240)
42
66
  @lbl_name_novia = FXLabel.new(self, "Nombres de la novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 270)
67
+ @lbl_name_novia.backColor = FXRGB(3,187,133)
43
68
  @input_name_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 270)
44
69
  @lbl_apellido_novia = FXLabel.new(self, "Apellidos de la novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 270)
70
+ @lbl_apellido_novia.backColor = FXRGB(3,187,133)
45
71
  @input_apellido_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 270)
46
72
  @lbl_cedula_novia = FXLabel.new(self, "Cédula de la novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 270)
73
+ @lbl_cedula_novia.backColor = FXRGB(3,187,133)
47
74
  @input_cedula_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 270)
48
75
  @lbl_testigo_novio = FXLabel.new(self, "Testigo del novio: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 300)
76
+ @lbl_testigo_novio.backColor = FXRGB(3,187,133)
49
77
  @input_nombres_testigo_novio = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170, :y => 300)
50
78
  @lbl_testigo_novia = FXLabel.new(self, "Testigo novia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 300)
79
+ @lbl_testigo_novia.backColor = FXRGB(3,187,133)
51
80
  @input_nombres_testigo_novia = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y => 300)
52
81
  @lbl_certifica = FXLabel.new(self, "Certifica: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 300)
82
+ @lbl_certifica.backColor = FXRGB(3,187,133)
53
83
  @input_certifica = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850, :y => 300)
54
84
 
55
85
  #section registro civil
56
86
  @lbl_reg_civ = FXLabel.new(self, "------------------------------------ REGISTRO CIVIL ------------------------------------", :opts => LAYOUT_EXPLICIT|JUSTIFY_CENTER_X, :width => 1050, :height => 20, :x => 10, :y => 330)
87
+ @lbl_reg_civ.backColor = FXRGB(3,187,133)
57
88
  @lbl_provincia_rc = FXLabel.new(self, "Provincia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 360)
89
+ @lbl_provincia_rc.backColor = FXRGB(3,187,133)
58
90
  @input_provincia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 360)
59
91
  @lbl_canton_rc = FXLabel.new(self, "Cantón: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 340, :y => 360)
92
+ @lbl_canton_rc.backColor = FXRGB(3,187,133)
60
93
  @input_canton_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 510, :y =>360)
61
94
  @lbl_parroquia_rc = FXLabel.new(self, "Parroquia: ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 680, :y => 360)
95
+ @lbl_parroquia_rc.backColor = FXRGB(3,187,133)
62
96
  @input_parroquia_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 850,:y => 360)
63
97
  @lbl_anio_rc = FXLabel.new(self, "Año: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 50, :y => 390)
98
+ @lbl_anio_rc.backColor = FXRGB(3,187,133)
64
99
  @input_anio_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 110,:y => 390)
65
100
  @lbl_tomo_rc = FXLabel.new(self, "Tomo: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 170, :y => 390)
101
+ @lbl_tomo_rc.backColor = FXRGB(3,187,133)
66
102
  @input_tomo_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 230,:y => 390)
67
103
  @lbl_pag_rc = FXLabel.new(self, "Página: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 290, :y => 390)
104
+ @lbl_pag_rc.backColor = FXRGB(3,187,133)
68
105
  @input_pag_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 350,:y => 390)
69
106
  @lbl_acta_rc = FXLabel.new(self, "Acta: ", :opts => LAYOUT_EXPLICIT, :width => 50, :height => 20, :x => 410, :y => 390)
107
+ @lbl_acta_rc.backColor = FXRGB(3,187,133)
70
108
  @input_acta_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 50,:height => 20, :x => 470,:y => 390)
71
109
  @lbl_date_rc = FXLabel.new(self, "Fecha (AAAA/MM/DD): ", :opts => LAYOUT_EXPLICIT, :width => 150, :height => 20, :x => 10, :y => 420)
110
+ @lbl_date_rc.backColor = FXRGB(3,187,133)
72
111
  @input_date_rc = FXTextField.new(self, 10, :opts => LAYOUT_EXPLICIT, :width => 150,:height => 20, :x => 170,:y => 420)
73
112
 
74
113
 
@@ -123,6 +162,7 @@ class Matrimonio < FXMainWindow
123
162
  clear_input_fields
124
163
  end
125
164
  rescue PG::Error => e
165
+ $conn.exec("ROLLBACK")
126
166
  FXMessageBox.error(self, MBOX_OK, "Error", "Error al guardar los datos")
127
167
  # Imprimir el error en la consola
128
168
  puts e.message
@@ -140,9 +180,6 @@ class Matrimonio < FXMainWindow
140
180
  @input_page.text = ""
141
181
  @input_number.text = ""
142
182
  @input_fecha.text = ""
143
- @input_sacramento.text = ""
144
- @input_parroquia.text = ""
145
- @input_sector.text = ""
146
183
  @input_parroco.text = ""
147
184
  @input_celebrante.text = ""
148
185
  @input_name_novio.text = ""
@@ -163,9 +200,39 @@ class Matrimonio < FXMainWindow
163
200
  @input_acta_rc.text = ""
164
201
  @input_date_rc.text = ""
165
202
  end
203
+ end
166
204
 
205
+ # Nombre del mes
206
+ def nombre_mes(mes)
207
+ meses = {
208
+ "01" => "enero",
209
+ "02" => "febrero",
210
+ "03" => "marzo",
211
+ "04" => "abril",
212
+ "05" => "mayo",
213
+ "06" => "junio",
214
+ "07" => "julio",
215
+ "08" => "agosto",
216
+ "09" => "septiembre",
217
+ "10" => "octubre",
218
+ "11" => "noviembre",
219
+ "12" => "diciembre"
220
+ }
221
+ meses[mes]
222
+ end
167
223
 
168
- end
224
+
225
+ # Cambiar el formato de la fecga de YYYY-MM-DD a DD de nombre_mes de YYYY
226
+ def cambiar_formato_fecha(fecha)
227
+ # split "-" or "/"
228
+ fecha = fecha.split(/-|\//)
229
+ # si el formato de fecha es YYYY-MM-DD o YYYY/MM/DD, sino si es DD-MM-YYYY o DD/MM/YYYY
230
+ if fecha[0].length == 4
231
+ "#{fecha[2]} de #{nombre_mes(fecha[1])} de #{fecha[0]}"
232
+ else
233
+ "#{fecha[0]} de #{nombre_mes(fecha[1])} de #{fecha[2]}"
234
+ end
235
+ end
169
236
 
170
237
  def create
171
238
  super
@@ -153,7 +153,7 @@ class ResultadosConsulta < FXMainWindow
153
153
  # Encabezado
154
154
  pdf.image File.join(File.dirname(__FILE__), "assets/images/arquidiocesisquito.png"), height: 100, position: :absolute, at: [-60, 680]
155
155
  pdf.text_box "Arquidiócesis de Quito", align: :center, size: 16, style: :bold, at: [10, 670], width: pdf.bounds.width
156
- pdf.text_box "Parroquia \"San Judas Tadeo\"", align: :center, size: 14, style: :bold, at: [10, 650], width: pdf.bounds.width
156
+ pdf.text_box "Parroquia Eclesiástica \"San Judas Tadeo\"", align: :center, size: 14, style: :bold, at: [10, 650], width: pdf.bounds.width
157
157
  pdf.text_box "Jaime Roldós Aguilera, calle Oe13A y N82\nEl Condado, Quito - Ecuador\nTeléfono: 02496446", align: :center, size: 10, at: [10, 630], width: pdf.bounds.width
158
158
  pdf.image File.join(File.dirname(__FILE__), "assets/images/sanjudastadeo.png"), height: 100, position: :absolute, at: [430, 680]
159
159
 
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.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Javier Borja Lobato