comee_core 0.2.60 → 0.2.62

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: bf2a038860b8510f876109ece2bd8b805b17f3daeb20c13cebfb9b5e9af3329c
4
- data.tar.gz: 25517d12bce6ab946a9cbc2edc6102b34c5e9458c1197f661060c65b7f9523a7
3
+ metadata.gz: b3647a23605f256be409ffe92d604c6c3cf2145c59973380f73d38ac866b5249
4
+ data.tar.gz: e8ddef5687858b3b4c4f443e5f1f8235e7c3bf11c90b9b2270589855106a13e5
5
5
  SHA512:
6
- metadata.gz: 692be3876a190479f7a2d0cecc6d8e5b9fbfeeb5cd936ed2db37e2035a6f0b907eb7979ccf47c29d1030009d939b4b6eb10e913036440ec03896bf3eff646321
7
- data.tar.gz: 145d9b19082364fd6541a2a3456cbae38292854be28b5cdca125a3d65865f9a0121fa78799d5f7c164036b3905c5c3ca4bd19fa9b1808f82d03e796d91fe3fdb
6
+ metadata.gz: 29924b04d90bbd2daa6d4e59077713c42491b94dceaf98a351c94ea433f06af36e582600a775580cee02ba55d99f019d4a20ccec6eaf0fd3125a9f7cd40cc7c9
7
+ data.tar.gz: 91469b52049d64914608cd1b73e1ea2a0026a1b16486f7ba01691bbe6715e7a3b94eee935ef5a930b0fe4f5b97c92626e69b216875ba07fedcbeeb87d1fb4fc9
@@ -26,10 +26,15 @@ module Comee
26
26
  product_id = model_params[:product_id] || @obj.product_id
27
27
  master_price = MasterPrice.find_by(product_id: product_id, primary: true)
28
28
  @obj.price = master_price&.selling_price
29
+ @obj.valid_from = model_params[:valid_from] if model_params[:valid_from]
30
+ @obj.valid_to = model_params[:valid_to] if model_params[:valid_to]
31
+ @obj.margin = model_params[:margin] if model_params[:margin]
32
+ @obj.margin_type = model_params[:margin_type] if model_params[:margin_type]
29
33
  if @obj.price
30
34
  @obj.price = @obj.margin_increase? ? @obj.price * (1 + @obj.margin / 100) : @obj.price * (1 - @obj.margin / 100)
35
+ @obj.price = @obj.price.round(2)
31
36
  end
32
- if @obj.update(model_params)
37
+ if @obj.save
33
38
  render_content(@obj)
34
39
  else
35
40
  render json: {success: false, error: @obj.errors.full_messages[0]}, status: :unprocessable_entity
@@ -34,7 +34,7 @@ module Comee
34
34
  :item_statuses
35
35
  ],
36
36
  sales_order: :fulfillment_center,
37
- purchase_order_item: :purchase_order
37
+ purchase_order_item: [{purchase_order: :supplier}]
38
38
  ).find(params[:id])
39
39
  render_content(
40
40
  details,
@@ -42,7 +42,7 @@ module Comee
42
42
  include: [
43
43
  "shipment_items.shipment_instruction_items.pod",
44
44
  "shipment_items.item_statuses",
45
- "purchase_order_item.purchase_order",
45
+ "purchase_order_item.purchase_order.supplier",
46
46
  "sales_order.fulfillment_center"
47
47
  ],
48
48
  serializer: SalesOrderItemDetailSerializer
@@ -41,7 +41,7 @@ module Comee
41
41
  end
42
42
 
43
43
  def self.ransackable_associations(_auth_object = nil)
44
- []
44
+ ["client"]
45
45
  end
46
46
 
47
47
  def files_url
@@ -0,0 +1,9 @@
1
+ module Comee
2
+ module Core
3
+ class PurchaseOrderSerializer < ActiveModel::Serializer
4
+ attributes :id, :po_number, :supplier_id, :order_date, :status, :delivery_address, :delivery_date, :terms, :total_price,
5
+ :created_at, :updated_at
6
+ belongs_to :supplier
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.60".freeze
3
+ VERSION = "0.2.62".freeze
4
4
  end
5
5
  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.60
4
+ version: 0.2.62
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-04-22 00:00:00.000000000 Z
11
+ date: 2024-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -375,6 +375,7 @@ files:
375
375
  - app/serializers/comee/core/product_serializer.rb
376
376
  - app/serializers/comee/core/product_type_serializer.rb
377
377
  - app/serializers/comee/core/purchase_order_item_serializer.rb
378
+ - app/serializers/comee/core/purchase_order_serializer.rb
378
379
  - app/serializers/comee/core/quotation_request_item_serializer.rb
379
380
  - app/serializers/comee/core/quotation_request_serializer.rb
380
381
  - app/serializers/comee/core/sales_order_item_detail_serializer.rb