spf_tracking 0.0.12 → 0.0.13
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/spf_tracking/version.rb +1 -1
- data/lib/util_trazabilidad.rb +40 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmUwYWIxY2M5MDM4MDE4Mzg2NzllMDMxNzFiN2RmYzJhYzg1OGMwYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGM5YzllMGIwNmE0M2YzYzE3NGNmZjQyZGQ4YmFiZWQ0NzZjZmMxYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWRhN2E1OTMwMzk3MmZhODM4OTZmMWY1OGI2YjAzZjYyZDFhNDJhMmIwZGM3
|
10
|
+
OWM5MTUwZGNmNmEzMjA0MmU4MTE1NjBkZjljNzg3MDFmZjY3ZWVkNGViZThj
|
11
|
+
YmYzNmQ0NGFkNzM3NTUyYWRkOGZkMzI0Njc5NzA4MTNiNTE3YzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njg4M2I5MTU4MWQ3MDYxOTUxYzNjYWU2YWQ4MGMxY2EzMWU1NzY5OWEyYWIy
|
14
|
+
M2FiZTFiOGJiMmZjNTkyNDE0ZWNkM2I0Yjk0ZmIwODkxZjcwZjI2ZGM1OWVh
|
15
|
+
NmQ2NDY5MmZjYmQyZmEyMjIxMTRlODhhZjczNTU2NTA3ZmI2Y2I=
|
data/lib/spf_tracking/version.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
module UtilTrazabilidad
|
2
|
+
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
def estado_string
|
6
|
+
esta_terminado? ? puesto_control.verbo_terminado : trabajos_disponibles > 0 ? "Disponible" : "No disponible"
|
7
|
+
end
|
8
|
+
|
9
|
+
def esta_terminado?
|
10
|
+
terminado - retrabajo == total_pedido
|
11
|
+
end
|
12
|
+
|
13
|
+
def esta_terminado_parcial?
|
14
|
+
(!esta_terminado? && (terminado - retrabajo > 0))
|
15
|
+
end
|
16
|
+
|
17
|
+
# trabajos disponibles reales en cada sección
|
18
|
+
# terminados seccion anterior menos terminados de la actual
|
19
|
+
# REVISAR ceros y nulos
|
20
|
+
def trabajos_disponibles
|
21
|
+
if self.class == Tracking::PrdIniTrack
|
22
|
+
return total_pedido - (terminado - retrabajo)
|
23
|
+
else
|
24
|
+
minimo_de_los_terminados_anterior = prev.min_by(&:terminado_listo)
|
25
|
+
return minimo_de_los_terminados_anterior.terminado_listo - terminado_listo
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def puesto_actual_y_siguiente_completos?
|
30
|
+
prd_track_actual_completo = self.try(:esta_terminado?)
|
31
|
+
prd_track_siguiente_completo = self.next.try(:esta_terminado?)
|
32
|
+
# si están completos, entonces el icono no se muestra
|
33
|
+
(prd_track_actual_completo && prd_track_siguiente_completo)
|
34
|
+
end
|
35
|
+
|
36
|
+
def cant_disponibles_siguiente
|
37
|
+
self.next.try(:trabajos_disponibles)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Ramseyer
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- lib/tracking/carga_rotura.rb
|
51
51
|
- lib/tracking/registro_trabajo.rb
|
52
52
|
- lib/tracking/routes.rb
|
53
|
+
- lib/util_trazabilidad.rb
|
53
54
|
- test/dummy/README.rdoc
|
54
55
|
- test/dummy/Rakefile
|
55
56
|
- test/dummy/app/assets/javascripts/application.js
|