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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b88368021252fc6b94d5d6249d242ba646fcdb299a16d3fa55bdcc11fe1129b
4
- data.tar.gz: 05fe8866c539c134e0a563cefd2c8425e2d4c005117272fc87338b47597501c2
3
+ metadata.gz: 6619eb773ad35fccfea933cf7770f0a4b24ebf46a3f2874d7c75153d5b9cb41c
4
+ data.tar.gz: b3821a41b7a0275d4b4647dae8a712334a2a04625405f86365d773843ba8cdac
5
5
  SHA512:
6
- metadata.gz: 662612111fcf879502c8fe0f941d8e2f40c696a89bf78cbd5bb045a494a030266e550da48731514879f798e807e2e80fda110ec358e27bf61b5011fe14ed8d3e
7
- data.tar.gz: 436fc32e865bc87804a5379df097c5b862cf0695e48ed236e5b53a5ed694eaf7684d96644bd8a8372af3eac975fa49aae5d547b3975e117a4fe088dd49f87a79
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(:customer_order, :client, sales_order_items: :unit).order(created_at: :desc)
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: ["client", "customer_order", "sales_order_items", "sales_order_items.product", "sales_order_items.unit"]
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: ["client", "customer_order", "sales_order_items", "sales_order_items.product", "sales_order_items.unit"]
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(data, fields: ["client", "customer_order", "sales_order_items.product", "sales_order_items.unit"])
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
 
@@ -6,6 +6,7 @@ module Comee
6
6
  belongs_to :product
7
7
  belongs_to :supplier
8
8
  belongs_to :product_lookup
9
+ belongs_to :unit
9
10
  end
10
11
  end
11
12
  end
@@ -0,0 +1,5 @@
1
+ class AddSubsidiaryToClient < ActiveRecord::Migration[7.1]
2
+ def change
3
+ add_column :comee_core_clients, :subsidiary, :boolean, default: false
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.31".freeze
3
+ VERSION = "0.2.33".freeze
4
4
  end
5
5
  end
@@ -9,5 +9,6 @@ FactoryBot.define do
9
9
  consignees { [] }
10
10
  shipment_addresses { [] }
11
11
  currency
12
+ subsidiary { false }
12
13
  end
13
14
  end
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.31
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-15 00:00:00.000000000 Z
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