cats_core 1.4.44 → 1.4.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/cats/core/dispatch_plans_controller.rb +1 -1
- data/app/controllers/cats/core/dispatch_transactions_controller.rb +5 -0
- data/app/controllers/cats/core/loans_controller.rb +2 -2
- data/app/controllers/cats/core/purchase_orders_controller.rb +1 -1
- data/app/controllers/cats/core/receipt_transactions_controller.rb +5 -0
- data/app/controllers/cats/core/swaps_controller.rb +3 -3
- data/app/models/cats/core/commodity_donation.rb +4 -0
- data/app/models/cats/core/loan.rb +4 -0
- data/app/models/cats/core/purchase_order.rb +4 -0
- data/app/models/cats/core/swap.rb +4 -0
- data/app/services/cats/core/authorization_service.rb +17 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20210717032855_create_cats_core_purchase_orders.rb +1 -0
- data/db/migrate/20220626063501_create_cats_core_loans.rb +1 -0
- data/db/migrate/20220626063757_create_cats_core_swaps.rb +1 -0
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/loans.rb +1 -0
- data/spec/factories/cats/core/purchase_orders.rb +1 -0
- data/spec/factories/cats/core/swaps.rb +1 -0
- 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: 710ffdc5b10d0f97aa5f40aaa8e67a99eaea21120c0b96894d46f86a47b10312
|
4
|
+
data.tar.gz: 3c1b7594b8717c668bb9f38d481afa54057005f524171bd3c088fdf6047344b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b522fa9d586d12f3255b0a9044caff4c8b694e336e3b284a657bc14d2f10a0e10ad3fce4d082784b65435bd73c396b8a593c6c7630bc90b9ac1388bf6f51915
|
7
|
+
data.tar.gz: 46fbc7ca6360f71e4f6cc992f03a3711b302f2f351c7dca8996999cee8c8eaf196321324bf9ed3f6bf16940c04f5224c72bd5124147663a7b4533aeddd9f27bd
|
@@ -12,8 +12,8 @@ module Cats
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def model_params
|
15
|
-
params.require(:payload).permit(:reference_no, :lender, :agreement_date, :repayment_date,
|
16
|
-
:commodity_category_id)
|
15
|
+
params.require(:payload).permit(:reference_no, :description, :lender, :agreement_date, :repayment_date,
|
16
|
+
:quantity, :unit_id, :commodity_category_id)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -17,7 +17,7 @@ module Cats
|
|
17
17
|
def model_params
|
18
18
|
params.require(:payload).permit(:reference_no, :order_date, :requisition_no, :supplier, :cash_donation_id,
|
19
19
|
:commodity_category_id, :quantity, :purchase_type, :unit_id, :price,
|
20
|
-
:currency_id)
|
20
|
+
:currency_id, :description)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -12,9 +12,9 @@ module Cats
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def model_params
|
15
|
-
params.require(:payload).permit(:reference_no, :swapper, :agreement_date, :issued_commodity_id,
|
16
|
-
:issued_quantity, :received_commodity_id, :received_quantity,
|
17
|
-
:
|
15
|
+
params.require(:payload).permit(:reference_no, :swapper, :agreement_date, :issued_commodity_id, :description,
|
16
|
+
:issued_quantity, :received_commodity_id, :received_quantity, :issued_unit_id,
|
17
|
+
:received_unit_id)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -10,6 +10,10 @@ module Cats
|
|
10
10
|
delegate(:reference_no, to: :plan, prefix: true, allow_nil: true)
|
11
11
|
delegate(:name, to: :commodity_category, prefix: true)
|
12
12
|
delegate(:abbreviation, to: :unit, prefix: true)
|
13
|
+
|
14
|
+
def commodity_name
|
15
|
+
commodity_category.name
|
16
|
+
end
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
@@ -14,6 +14,10 @@ module Cats
|
|
14
14
|
delegate(:name, to: :received_commodity, prefix: true)
|
15
15
|
delegate(:abbreviation, to: :issued_unit, prefix: true)
|
16
16
|
delegate(:abbreviation, to: :received_unit, prefix: true)
|
17
|
+
|
18
|
+
def commodity_name
|
19
|
+
received_commodity.name
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -43,6 +43,23 @@ module Cats
|
|
43
43
|
authorization.dispatch.stack
|
44
44
|
authorization
|
45
45
|
end
|
46
|
+
|
47
|
+
def receipt_authorization(id)
|
48
|
+
item = DispatchPlanItem.find(id).includes(
|
49
|
+
:destination,
|
50
|
+
:unit,
|
51
|
+
commodity: { project: :source }
|
52
|
+
)
|
53
|
+
{
|
54
|
+
date: Date.today,
|
55
|
+
reference_no: item.reference_no,
|
56
|
+
destination: item.destination.name,
|
57
|
+
source: item.commodity.project.source.description,
|
58
|
+
commodity: "#{item.commodity.project.source.commodity_name} (#{item.commodity.batch_no})",
|
59
|
+
unit: item.unit.abbreviation,
|
60
|
+
quantity: item.quantity
|
61
|
+
}
|
62
|
+
end
|
46
63
|
end
|
47
64
|
end
|
48
65
|
end
|
data/config/routes.rb
CHANGED
@@ -167,7 +167,9 @@ Cats::Core::Engine.routes.draw do
|
|
167
167
|
action: :create_allocation,
|
168
168
|
as: :allocation_transaction
|
169
169
|
)
|
170
|
+
post '/dispatch_transactions/filter', controller: :dispatch_transactions, action: :filter
|
170
171
|
resources :dispatch_transactions, except: %i[index new edit destroy]
|
172
|
+
post '/receipt_transactions/filter', controller: :receipt_transactions, action: :filter
|
171
173
|
resources :receipt_transactions, except: %i[index new edit destroy]
|
172
174
|
resources :lost_commodities, except: %i[index destroy]
|
173
175
|
get '/plans/:id/round_plans', controller: :round_plans, action: :index, as: :round_plans_plan
|
@@ -2,6 +2,7 @@ class CreateCatsCorePurchaseOrders < ActiveRecord::Migration[6.1]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_purchase_orders do |t|
|
4
4
|
t.string :reference_no, unique: true
|
5
|
+
t.string :description
|
5
6
|
t.date :order_date, null: false
|
6
7
|
t.string :requisition_no
|
7
8
|
t.string :supplier, null: false
|
@@ -2,6 +2,7 @@ class CreateCatsCoreSwaps < ActiveRecord::Migration[7.0]
|
|
2
2
|
def change
|
3
3
|
create_table :cats_core_swaps do |t|
|
4
4
|
t.string :reference_no, unique: true
|
5
|
+
t.string :description
|
5
6
|
t.string :swapper, null: false
|
6
7
|
t.date :agreement_date, null: false
|
7
8
|
t.float :issued_quantity, null: false
|
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.4.
|
4
|
+
version: 1.4.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|