cats_core 1.1.1 → 1.1.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae62c0b230969901c7405d3bdf56b72dc099e77e4e6d9a21ba89243f91a1bd07
|
4
|
+
data.tar.gz: cc0d85257ffb25fc70a890011b1ae670dd18a0ea6938f79e73ec87a757787cd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 582d0f4d63492a2ce3b3e12a7d6e84088c5c5badab3135cb108fc8876348f3e593f70d0498d6c23e79de143efb04436fd858325c6bac8a5bf29785d3a1d4d899
|
7
|
+
data.tar.gz: 581e221e3dff760e51095cc7094736b0a2c7f7c261d4693c8f811f3b9e2aac1ee5093ba6823895bb910488947f8616cee32b799178b5d1da64905ca40cc7b20c
|
@@ -4,7 +4,9 @@ module Cats
|
|
4
4
|
# Receipt status
|
5
5
|
DRAFT = 'Draft'.freeze
|
6
6
|
CONFIRMED = 'Confirmed'.freeze
|
7
|
-
|
7
|
+
STACKING = 'Stacking'.freeze
|
8
|
+
STACKED = 'Stacked'.freeze
|
9
|
+
RECEIPT_STATUSES = [DRAFT, CONFIRMED, STACKING, STACKED].freeze
|
8
10
|
|
9
11
|
belongs_to :dispatch
|
10
12
|
belongs_to :prepared_by, class_name: 'Cats::Core::User'
|
@@ -40,7 +40,7 @@ module Cats
|
|
40
40
|
dispatch
|
41
41
|
end
|
42
42
|
|
43
|
-
def search(user)
|
43
|
+
def search(user, status)
|
44
44
|
details = user.details
|
45
45
|
|
46
46
|
unless details['stores'] || details['warehouse'] || details['hub']
|
@@ -54,12 +54,12 @@ module Cats
|
|
54
54
|
dispatches = Cats::Core::Dispatch.joins(:allocation_item)
|
55
55
|
.where(
|
56
56
|
allocation_item: { destination: hub },
|
57
|
-
dispatch_status:
|
57
|
+
dispatch_status: status
|
58
58
|
).or(
|
59
59
|
Cats::Core::Dispatch.joins(:allocation_item)
|
60
60
|
.where(
|
61
61
|
allocation_item: { destination: warehouse },
|
62
|
-
dispatch_status:
|
62
|
+
dispatch_status: status
|
63
63
|
)
|
64
64
|
)
|
65
65
|
elsif details['warehouse']
|
@@ -68,12 +68,12 @@ module Cats
|
|
68
68
|
dispatches = Cats::Core::Dispatch.joins(:allocation_item)
|
69
69
|
.where(
|
70
70
|
allocation_item: { destination: hub },
|
71
|
-
dispatch_status:
|
71
|
+
dispatch_status: status
|
72
72
|
).or(
|
73
73
|
Cats::Core::Dispatch.joins(:allocation_item)
|
74
74
|
.where(
|
75
75
|
allocation_item: { destination: warehouse },
|
76
|
-
dispatch_status:
|
76
|
+
dispatch_status: status
|
77
77
|
)
|
78
78
|
)
|
79
79
|
elsif details['hub']
|
@@ -81,7 +81,7 @@ module Cats
|
|
81
81
|
dispatches = Cats::Core::Dispatch.joins(:allocation_item)
|
82
82
|
.where(
|
83
83
|
allocation_item: { destination: hub },
|
84
|
-
dispatch_status:
|
84
|
+
dispatch_status: status
|
85
85
|
)
|
86
86
|
end
|
87
87
|
dispatches
|
data/lib/cats/core/version.rb
CHANGED