comee_core 0.2.31 → 0.2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/comee/core/clients_controller.rb +1 -1
- data/app/controllers/comee/core/sales_orders_controller.rb +28 -5
- data/app/models/comee/core/client.rb +3 -0
- data/app/serializers/comee/core/master_price_serializer.rb +1 -0
- data/db/migrate/20240315163900_add_subsidiary_to_client.rb +5 -0
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/clients.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6619eb773ad35fccfea933cf7770f0a4b24ebf46a3f2874d7c75153d5b9cb41c
|
4
|
+
data.tar.gz: b3821a41b7a0275d4b4647dae8a712334a2a04625405f86365d773843ba8cdac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1216ca3faffbc0fda6176d90195819549a905d2d2984f63f90a1af61d270f17b78f9c5a67a46c5ead7ba35a1a64a993fc02ff99e430063aa4b366c1dd83075c4
|
7
|
+
data.tar.gz: 5641da7714023cd6d6c8673e95a6fe262e3c2726a80f392ff6c0c0783c2f15f2f63da085e61902f81b6253c529af32abec51cfba6bc59b0b1061195bf6d482d0
|
@@ -55,7 +55,7 @@ module Comee
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def model_params
|
58
|
-
params.require(:payload).permit(:code, :name, :address, :locale, :user_id, :parent_id, :currency,
|
58
|
+
params.require(:payload).permit(:code, :name, :address, :locale, :user_id, :parent_id, :currency, :subsidiary,
|
59
59
|
consignees: [])
|
60
60
|
end
|
61
61
|
|
@@ -6,10 +6,22 @@ module Comee
|
|
6
6
|
|
7
7
|
def index
|
8
8
|
super do
|
9
|
-
data = SalesOrder.includes(
|
9
|
+
data = SalesOrder.includes(
|
10
|
+
:customer_order,
|
11
|
+
:client,
|
12
|
+
:customs_detail,
|
13
|
+
sales_order_items: :unit
|
14
|
+
).order(created_at: :desc)
|
10
15
|
[
|
11
16
|
data,
|
12
|
-
fields: [
|
17
|
+
fields: [
|
18
|
+
"client",
|
19
|
+
"customer_order",
|
20
|
+
"sales_order_items",
|
21
|
+
"sales_order_items.product",
|
22
|
+
"sales_order_items.unit",
|
23
|
+
"customs_detail"
|
24
|
+
]
|
13
25
|
]
|
14
26
|
end
|
15
27
|
end
|
@@ -17,8 +29,15 @@ module Comee
|
|
17
29
|
def show
|
18
30
|
super do
|
19
31
|
[
|
20
|
-
SalesOrder.includes(:customer_order, :client, sales_order_items: :unit).find(params[:id]),
|
21
|
-
fields: [
|
32
|
+
SalesOrder.includes(:customer_order, :client, :customs_detail, sales_order_items: :unit).find(params[:id]),
|
33
|
+
fields: [
|
34
|
+
"client",
|
35
|
+
"customer_order",
|
36
|
+
"sales_order_items",
|
37
|
+
"sales_order_items.product",
|
38
|
+
"sales_order_items.unit",
|
39
|
+
"customs_detail"
|
40
|
+
]
|
22
41
|
]
|
23
42
|
end
|
24
43
|
end
|
@@ -33,9 +52,13 @@ module Comee
|
|
33
52
|
data = SalesOrder.includes(
|
34
53
|
:customer_order,
|
35
54
|
:client,
|
55
|
+
:customs_detail,
|
36
56
|
sales_order_items: :unit
|
37
57
|
).ransack(params[:q]).result
|
38
|
-
render_content(
|
58
|
+
render_content(
|
59
|
+
data,
|
60
|
+
fields: ["client", "customer_order", "sales_order_items.product", "sales_order_items.unit", "customs_detail"]
|
61
|
+
)
|
39
62
|
end
|
40
63
|
|
41
64
|
def submit
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class Client < ApplicationRecord
|
4
|
+
before_save -> { self.subsidiary = !parent.nil? }
|
5
|
+
|
4
6
|
belongs_to :user, optional: true
|
5
7
|
belongs_to :parent, class_name: "Comee::Core::Client", optional: true
|
6
8
|
belongs_to :currency, optional: true
|
@@ -22,6 +24,7 @@ module Comee
|
|
22
24
|
name
|
23
25
|
locale
|
24
26
|
parent_id
|
27
|
+
subsidiary
|
25
28
|
]
|
26
29
|
end
|
27
30
|
|
data/lib/comee/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comee_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -442,6 +442,7 @@ files:
|
|
442
442
|
- db/migrate/20240303191625_add_amount_paid_field_to_invoice.rb
|
443
443
|
- db/migrate/20240314111117_create_comee_core_purchase_requisitions.rb
|
444
444
|
- db/migrate/20240314111307_create_comee_core_purchase_requisition_items.rb
|
445
|
+
- db/migrate/20240315163900_add_subsidiary_to_client.rb
|
445
446
|
- lib/comee/core.rb
|
446
447
|
- lib/comee/core/engine.rb
|
447
448
|
- lib/comee/core/version.rb
|