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 +4 -4
- data/app/controllers/comee/core/client_prices_controller.rb +6 -1
- data/app/controllers/comee/core/sales_order_items_controller.rb +2 -2
- data/app/models/comee/core/sales_order.rb +1 -1
- data/app/serializers/comee/core/purchase_order_serializer.rb +9 -0
- data/lib/comee/core/version.rb +1 -1
- 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: b3647a23605f256be409ffe92d604c6c3cf2145c59973380f73d38ac866b5249
|
4
|
+
data.tar.gz: e8ddef5687858b3b4c4f443e5f1f8235e7c3bf11c90b9b2270589855106a13e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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: :
|
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
|
@@ -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
|
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.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-
|
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
|