comee_core 0.2.59 → 0.2.61
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6815a7ee31b8b4093b9773f7be5911ba012bf51ab79f1ea46aacfcdd72f20828
|
4
|
+
data.tar.gz: 338559521710c2d42c5a8ec652a7f6f4542604258e2b70eb5defed818b36627d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa97f2ed8242ef366884d8e45297f6032a152e0971067230bf5cc80fab56a57732b91c7ade1bfc0569deb82a997359043ab39b7799929d9e810582b165a18fc8
|
7
|
+
data.tar.gz: 92089c305cbfc4de7e4078d52fd0d6be3bd0dac33aa168697787d20e28be347c128cdb0daac7fb27def1cb463129caf68a24a30cac399cc88353c7f74d8dd776
|
@@ -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
|
@@ -23,6 +23,28 @@ module Comee
|
|
23
23
|
purchase_requisition.total_price = purchase_requisition.calculate_total_price
|
24
24
|
purchase_requisition.save!
|
25
25
|
end
|
26
|
+
|
27
|
+
def self.ransackable_attributes(_auth_object = nil)
|
28
|
+
%w[
|
29
|
+
delivery_date
|
30
|
+
id
|
31
|
+
price
|
32
|
+
processing_status
|
33
|
+
product_id
|
34
|
+
purchase_order_item_id
|
35
|
+
purchase_requisition_id
|
36
|
+
quantity
|
37
|
+
supplier_id
|
38
|
+
total_price
|
39
|
+
unit_id
|
40
|
+
created_at
|
41
|
+
updated_at
|
42
|
+
]
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.ransackable_associations(_auth_object = nil)
|
46
|
+
[]
|
47
|
+
end
|
26
48
|
end
|
27
49
|
end
|
28
50
|
end
|
data/lib/comee/core/version.rb
CHANGED