cats_core 1.5.21 → 1.5.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/cats/core/commodity.rb +4 -0
- data/app/models/cats/core/dispatch.rb +13 -0
- data/app/models/cats/core/dispatch_authorization.rb +5 -1
- data/app/models/cats/core/dispatch_plan.rb +8 -0
- data/app/models/cats/core/dispatch_plan_item.rb +10 -0
- data/app/models/cats/core/dispatch_transaction.rb +7 -0
- data/app/models/cats/core/receipt_authorization.rb +17 -1
- data/app/models/cats/core/receipt_transaction.rb +16 -1
- data/app/models/cats/core/round_plan.rb +19 -1
- data/app/models/cats/core/round_plan_item.rb +23 -1
- data/app/models/cats/core/route.rb +14 -1
- data/app/models/cats/core/stack.rb +10 -0
- data/lib/cats/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0913c502d73b044d84e08daf43fb9fc7fb67df1a6fbda3ef7ca7748d610a1082'
|
4
|
+
data.tar.gz: 2f9cec73382125463e3624d48f5f7f852097d90120c98579347a32ecb87df085
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d030d99a36bc3c42e0f1a906e10cde70bd4a52a816534cbfe87eed1050721f93d1eaf0e3a8a634cdcc199bf0188bd60a2aead8630aa797e6318b2a961f455861
|
7
|
+
data.tar.gz: a0c790f3e8def0e808fd71df23b9473e1d78d079a5d15231b2bbaccb321412ed6b02a23afd7d60f01e50ddb582eb1a950603623f2a66ee51c29947bf134a864f
|
@@ -133,6 +133,19 @@ module Cats
|
|
133
133
|
unit_id
|
134
134
|
]
|
135
135
|
end
|
136
|
+
|
137
|
+
def self.ransackable_associations(_auth_object = nil)
|
138
|
+
%w[
|
139
|
+
prepared_by
|
140
|
+
transporter
|
141
|
+
dispatch_plan_item
|
142
|
+
unit
|
143
|
+
dispatch_authorizations
|
144
|
+
receipt_authorizations
|
145
|
+
dispatch_transactions
|
146
|
+
receipt_transactions
|
147
|
+
]
|
148
|
+
end
|
136
149
|
end
|
137
150
|
end
|
138
151
|
end
|
@@ -36,7 +36,7 @@ module Cats
|
|
36
36
|
return
|
37
37
|
end
|
38
38
|
stack_quantity = stacks.map { |s| UnitConversion.convert(s.unit, unit, s.quantity) }.sum
|
39
|
-
authorizations = DispatchAuthorization.where(dispatch: dispatch)
|
39
|
+
authorizations = DispatchAuthorization.where(dispatch: dispatch, store: store)
|
40
40
|
authorized = authorizations.map { |a| UnitConversion.convert(a.unit, unit, a.quantity) }.sum
|
41
41
|
authorized -= quantity_was if persisted?
|
42
42
|
|
@@ -47,6 +47,10 @@ module Cats
|
|
47
47
|
def self.ransackable_attributes(_auth_object = nil)
|
48
48
|
%w[authorized_by_id dispatch_id quantity status store_id unit_id]
|
49
49
|
end
|
50
|
+
|
51
|
+
def self.ransackable_associations(_auth_object = nil)
|
52
|
+
%w[dispatch_transactions]
|
53
|
+
end
|
50
54
|
end
|
51
55
|
end
|
52
56
|
end
|
@@ -16,7 +16,23 @@ module Cats
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.ransackable_attributes(_auth_object = nil)
|
19
|
-
%w[
|
19
|
+
%w[
|
20
|
+
authorized_by_id
|
21
|
+
dispatch_id
|
22
|
+
received_quantity
|
23
|
+
quantity
|
24
|
+
status
|
25
|
+
store_id
|
26
|
+
unit_id
|
27
|
+
]
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.ransackable_associations(_auth_object = nil)
|
31
|
+
%w[
|
32
|
+
receipts
|
33
|
+
lost_commodities
|
34
|
+
receipt_transactions
|
35
|
+
]
|
20
36
|
end
|
21
37
|
end
|
22
38
|
end
|
@@ -47,7 +47,22 @@ module Cats
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.ransackable_attributes(_auth_object = nil)
|
50
|
-
%w[
|
50
|
+
%w[
|
51
|
+
destination_id
|
52
|
+
quantity
|
53
|
+
receipt_authorization_id
|
54
|
+
receipt_number
|
55
|
+
status
|
56
|
+
transaction_date
|
57
|
+
unit_id
|
58
|
+
]
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.ransackable_associations(_auth_object = nil)
|
62
|
+
%w[
|
63
|
+
receipt_authorization
|
64
|
+
destination
|
65
|
+
]
|
51
66
|
end
|
52
67
|
end
|
53
68
|
end
|
@@ -73,7 +73,25 @@ module Cats
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def self.ransackable_attributes(_auth_object = nil)
|
76
|
-
%w[
|
76
|
+
%w[
|
77
|
+
plan_id
|
78
|
+
reference_no
|
79
|
+
region_id
|
80
|
+
rounds
|
81
|
+
status
|
82
|
+
]
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.ransackable_associations(_auth_object = nil)
|
86
|
+
%w[
|
87
|
+
plan
|
88
|
+
region
|
89
|
+
round_plan_items
|
90
|
+
round_rations
|
91
|
+
beneficiary_round_plan_items
|
92
|
+
round_plan_item_details
|
93
|
+
round_beneficiaries
|
94
|
+
]
|
77
95
|
end
|
78
96
|
end
|
79
97
|
end
|
@@ -23,7 +23,29 @@ module Cats
|
|
23
23
|
delegate(:name, to: :operator, prefix: true)
|
24
24
|
|
25
25
|
def self.ransackable_attributes(_auth_object = nil)
|
26
|
-
%w[
|
26
|
+
%w[
|
27
|
+
fdp_id
|
28
|
+
operator_id
|
29
|
+
plan_item_id
|
30
|
+
region_id
|
31
|
+
round_plan_id
|
32
|
+
woreda_id
|
33
|
+
zone_id
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.ransackable_associations(_auth_object = nil)
|
38
|
+
%w[
|
39
|
+
round_plan
|
40
|
+
region
|
41
|
+
zone
|
42
|
+
woreda
|
43
|
+
fdp
|
44
|
+
operator
|
45
|
+
beneficiary_round_plan_items
|
46
|
+
round_plan_item_details
|
47
|
+
round_beneficiaries
|
48
|
+
]
|
27
49
|
end
|
28
50
|
end
|
29
51
|
end
|
@@ -45,7 +45,20 @@ module Cats
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.ransackable_attributes(_auth_object = nil)
|
48
|
-
%w[
|
48
|
+
%w[
|
49
|
+
destination_id
|
50
|
+
name
|
51
|
+
region_id
|
52
|
+
source_id
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.ransackable_associations(_auth_object = nil)
|
57
|
+
%w[
|
58
|
+
region
|
59
|
+
source
|
60
|
+
destination
|
61
|
+
]
|
49
62
|
end
|
50
63
|
end
|
51
64
|
end
|
data/lib/cats/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cats_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|