spf_tracking 0.0.16 → 0.0.17
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.
- checksums.yaml +8 -8
- data/lib/descriptivo.rb +77 -0
- data/lib/spf_tracking/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGYwNDBhZGM1ZDYwYWZmNzUwMmYxMTVjZTcwODZhNjg3ZjQ5NTQzMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTE1ZTQxZjkwZmY4ODdiMTdhMzViZDA1Mjk4N2U2ODBmMzBkMWMxZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzNjNmI2OGExY2RlNmZmZjYzMGRjMzE4OTAzMmUzYzE5NDBhNDUxNTMyN2Yw
|
10
|
+
OTBmMzYyMjVkYmU3ZDI0YjY4MTRlZGVmYTY1YmU4MDIxMzVkN2I0MTYxODkx
|
11
|
+
OGZiMjVkZWVjMmNkMjkzN2VjMjJjMmYyZGY5YzdiNjMyNzY2NTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2NjNDkwZDMzMTEzYzBlMGI1MzVmNDllY2E1Y2Y5N2M2NDU0ZTMyMmExNDU0
|
14
|
+
NGIyOWQ3ZTY0OTNjNjRjMzViOWQyYWUxZjc3OWRkZTBkNTA0NjliZTI4NmU5
|
15
|
+
MjMzY2FlZWZiN2QzMDljZDI5M2NmYzkyZmEyYzAxNTVhMmJiZGM=
|
data/lib/descriptivo.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
module Descriptivo
|
3
|
+
|
4
|
+
module DescriptivoItem
|
5
|
+
def descripcion_primer_vidrio
|
6
|
+
composicion.nil? ? "El item no tiene una compisición asignada" : composicion.primer_vidrio.elementos.map(&:descripcion).join(" ")
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module DescriptivoItemMedida
|
11
|
+
def etiqueta_excel
|
12
|
+
pedido = item.pedido
|
13
|
+
|
14
|
+
e_im = self.cardinalidad.to_s.rjust(3, '0')
|
15
|
+
e_i = item.cardinalidad.to_s.rjust(3, '0')
|
16
|
+
e_p = pedido.id.to_s.rjust(6, '0')
|
17
|
+
|
18
|
+
"#{e_p}-#{e_i}-#{e_im}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
module DescriptivoTrazabilidad
|
23
|
+
def etiqueta_string
|
24
|
+
item = composicion.item
|
25
|
+
pedido = item.pedido
|
26
|
+
componente = self.componente || self.elemento.try(:componente)
|
27
|
+
|
28
|
+
pedido_string = pedido.id.to_s.rjust(7, '0')
|
29
|
+
item_string = item.cardinalidad.to_s.rjust(3, '0')
|
30
|
+
item_medida_string = self.item_medida.cardinalidad.to_s.rjust(3, '0')
|
31
|
+
|
32
|
+
if self.elemento
|
33
|
+
componente_string = componente.orden.to_s
|
34
|
+
elemento_string = self.elemento.orden.to_s.rjust(2, '0')
|
35
|
+
else
|
36
|
+
if self.componente
|
37
|
+
componente_string = self.componente.orden.to_s
|
38
|
+
elemento_string = "00"
|
39
|
+
else
|
40
|
+
componente_string = "0"
|
41
|
+
elemento_string = "00"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
"#{pedido_string}-#{item_string}-#{item_medida_string}-#{componente_string}-#{elemento_string}"
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
module DescriptivoElemento
|
52
|
+
def descripcion
|
53
|
+
# (["Float 4"] + ["Pulido", "Termoendurecido"]).join(" ")
|
54
|
+
([self.elemento_de_componente.descripcion] + self.procesos_de_procesos.map(&:nombre)).join(" ")
|
55
|
+
end
|
56
|
+
|
57
|
+
def descripcion_corta_tango
|
58
|
+
# (["Float 4"] + ["Pulido", "Termoendurecido"]).join(" ")
|
59
|
+
([self.elemento_de_componente.descripcion_corta_tango] + self.procesos_de_procesos.map(&:descripcion_corta_tango)).join(" ")
|
60
|
+
end
|
61
|
+
|
62
|
+
def descripcion_tango
|
63
|
+
# (["Float 4"] + ["Pulido", "Termoendurecido"]).join(" ")
|
64
|
+
([self.elemento_de_componente.descripcion_tango] + self.procesos_de_procesos.map(&:descripcion_corta_tango)).join(" ")
|
65
|
+
end
|
66
|
+
|
67
|
+
def descripcion_elemento
|
68
|
+
self.elemento_de_componente.descripcion
|
69
|
+
end
|
70
|
+
|
71
|
+
def descripcion_sin_procesos
|
72
|
+
self.descripcion_elemento
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
end
|
data/lib/spf_tracking/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spf_tracking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Ramseyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- MIT-LICENSE
|
35
35
|
- README.rdoc
|
36
36
|
- Rakefile
|
37
|
+
- lib/descriptivo.rb
|
37
38
|
- lib/experto_rotura_trazabilidad.rb
|
38
39
|
- lib/experto_trazabilidad.rb
|
39
40
|
- lib/proceso_de_producto.rb
|