alego_functions 0.0.6 → 0.0.7
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.
- data/lib/alego_functions.rb +6 -51
- metadata +4 -4
data/lib/alego_functions.rb
CHANGED
@@ -1,19 +1,13 @@
|
|
1
1
|
module Funcoes
|
2
2
|
|
3
|
-
def self.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
return "FINALIZADO"
|
8
|
-
when 2
|
9
|
-
return "NÃO ENTREGUE"
|
10
|
-
else
|
11
|
-
return "INCOMPLETO"
|
12
|
-
end
|
3
|
+
def self.tratar_status(status)
|
4
|
+
"FINALIZADO" if status == 1
|
5
|
+
"NÃO ENTREGUE" if status == 2
|
6
|
+
"INCOMPLETO" if status == 3
|
13
7
|
end
|
14
8
|
|
15
9
|
|
16
|
-
def self.
|
10
|
+
def self.tratar_valor_check_box(valor_campo)
|
17
11
|
|
18
12
|
if valor_campo == "1"
|
19
13
|
return true
|
@@ -23,45 +17,8 @@ module Funcoes
|
|
23
17
|
|
24
18
|
end
|
25
19
|
|
26
|
-
def self.build_rghost_doc(modo_layout, margem)
|
27
|
-
|
28
|
-
if modo_layout == "retrato"
|
29
|
-
eixo_x = 0.5
|
30
|
-
eixo_y = 18.8
|
31
|
-
doc = RGhost::Document.new :paper => :A4, :landscape => false, :margin =>[margem,margem,margem,margem]
|
32
|
-
else
|
33
|
-
eixo_x = 0.5
|
34
|
-
eixo_y = 19
|
35
|
-
doc = RGhost::Document.new :paper => :A4, :landscape => true, :margin =>[margem,margem,margem,margem]
|
36
|
-
end
|
37
|
-
|
38
|
-
doc.before_page_create do |chunk|
|
39
|
-
chunk.text_in :x => 28, :y => 19.9, :write => "%current_page%"
|
40
|
-
chunk.image "public/template.eps", :x => 0.8, :y => 0.65 if modo_layout == "retrato"
|
41
|
-
end
|
42
|
-
|
43
|
-
doc.define_tags do
|
44
|
-
tag :hel_normal, :name => 'Helvetica', :size => 10, :color => '#000000'
|
45
|
-
tag :hel_negrito, :name => 'Helvetica-Bold', :size => 10, :color => '#000000'
|
46
|
-
|
47
|
-
tag :hel_normal_destaque, :name => 'Helvetica', :size => 10, :color => '#000000'
|
48
|
-
tag :hel_negrito_destaque, :name => 'Helvetica-Bold', :size => 14, :color => '#000000'
|
49
|
-
tag :hel_negrito_destaque_reduzido, :name => 'Helvetica-Bold', :size => 12, :color => '#000000'
|
50
|
-
|
51
|
-
tag :hel_normal_tit, :name => 'Helvetica', :size => 18, :color => '#000000'
|
52
|
-
tag :hel_negrito_tit, :name => 'Helvetica-Bold', :size => 16, :color => '#000000'
|
53
|
-
|
54
|
-
tag :cour_normal, :name => 'Courier', :size => 10, :color => '#000000'
|
55
|
-
tag :cour_normal_reduzido, :name => 'Courier', :size => 8, :color => '#000000'
|
56
|
-
tag :cour_negrito, :name => 'Courier-Bold', :size => 10, :color => '#000000'
|
57
|
-
tag :cour_negrito_destaque, :name => 'Courier-Bold', :size => 12, :color => '#000000'
|
58
|
-
end
|
59
|
-
|
60
|
-
doc
|
61
|
-
end
|
62
|
-
|
63
20
|
module Data
|
64
|
-
def self.
|
21
|
+
def self.imprimir_data(data)
|
65
22
|
return data.strftime("%d/%m/%Y") unless data.blank?
|
66
23
|
return nil
|
67
24
|
end
|
@@ -69,8 +26,6 @@ module Funcoes
|
|
69
26
|
|
70
27
|
module Moeda
|
71
28
|
|
72
|
-
# include ActionView::Helpers::NumberHelper
|
73
|
-
|
74
29
|
def self.formatar_moeda(valor)
|
75
30
|
return valor if valor == nil
|
76
31
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alego_functions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Gustavo Gomes da F\xC3\xA9"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-11-
|
18
|
+
date: 2012-11-23 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: "Tem a funcionalidade de prover m\xC3\xA9todos prontos de manipula\xC3\xA7\xC3\xA3o de data, moeda e outros"
|