comee_core 0.1.59 → 0.1.61
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 +1 -0
- data/app/controllers/comee/core/item_statuses_controller.rb +5 -0
- data/app/controllers/comee/core/quotation_requests_controller.rb +4 -3
- data/app/models/comee/core/item_status.rb +4 -0
- data/app/serializers/comee/core/customer_order_item_serializer.rb +1 -2
- data/app/serializers/comee/core/customer_order_serializer.rb +1 -2
- data/app/serializers/comee/core/quotation_request_item_serializer.rb +1 -1
- data/app/serializers/comee/core/sales_order_item_serializer.rb +2 -2
- data/config/routes.rb +1 -0
- data/lib/comee/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c663809128b4a531924cc39cc2b2acdc2ebcc13bf0a58c7baee7ea495c81baa2
|
4
|
+
data.tar.gz: 3d0b2fa555567992df840625f61b774b6b0484325a40692b0c344617a1b0e1db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca3073726cb726242aad1bc47e0fae40ecfa56ff8fb2c1e3886d5d93ad47bc190dbce1051aa284bfc0410c42c3586b95f0a535e10f33ef80c1688b4e8ad3933a
|
7
|
+
data.tar.gz: 27c36425bbf84ecb5b6e3041659a55478737c96f23f2e8039150ce30033d3432b5f8f56131e2ea58b404a4b5aefcbf7911e3c920e268c11897c754f920dcb328
|
@@ -3,6 +3,11 @@ module Comee
|
|
3
3
|
class ItemStatusesController < ApplicationController
|
4
4
|
include Common
|
5
5
|
|
6
|
+
def filter
|
7
|
+
@item_statuses = Comee::Core::ItemStatus.ransack(params[:q]).result
|
8
|
+
render json: {success: true, data: serialize(@item_statuses)}
|
9
|
+
end
|
10
|
+
|
6
11
|
private
|
7
12
|
|
8
13
|
def model_params
|
@@ -10,8 +10,9 @@ module Comee
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def filter
|
13
|
-
query = QuotationRequest.ransack(params[:q])
|
14
|
-
|
13
|
+
query = QuotationRequest.ransack(params[:q]).result
|
14
|
+
query = query.then(&paginate)
|
15
|
+
render json: {success: true, data: serialize(query.includes(:client))}
|
15
16
|
end
|
16
17
|
|
17
18
|
def rfq_products_for_client
|
@@ -70,7 +71,7 @@ module Comee
|
|
70
71
|
|
71
72
|
def rfq_params
|
72
73
|
params.require(:payload).permit(:client_id, :order_number, :order_date, :delivery_address, :invoice_address,
|
73
|
-
items: %i[product_id unit_id quantity expected_delivery_date])
|
74
|
+
items: %i[product_id unit_id customer_item_no quantity expected_delivery_date])
|
74
75
|
end
|
75
76
|
end
|
76
77
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class CustomerOrderItemSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :customer_item_no, :quantity, :price, :delivery_date, :canceled
|
4
|
+
attributes :id, :customer_item_no, :quantity, :price, :delivery_date, :canceled, :product, :unit
|
5
5
|
belongs_to :product
|
6
|
-
belongs_to :customer_order
|
7
6
|
belongs_to :unit
|
8
7
|
end
|
9
8
|
end
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class CustomerOrderSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :order_number, :order_date, :order_terms, :delivery_address, :invoice_address, :status, :file_url
|
5
|
-
belongs_to :client
|
4
|
+
attributes :id, :order_number, :order_date, :order_terms, :delivery_address, :invoice_address, :status, :file_url, :client
|
6
5
|
has_many :customer_order_items
|
7
6
|
end
|
8
7
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class QuotationRequestItemSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :customer_item_no, :price, :discount, :valid_from, :valid_to
|
4
|
+
attributes :id, :customer_item_no, :price, :discount, :valid_from, :valid_to, :quantity, :expected_delivery_date
|
5
5
|
belongs_to :product
|
6
6
|
belongs_to :quotation_request
|
7
7
|
belongs_to :unit
|
@@ -2,8 +2,8 @@ module Comee
|
|
2
2
|
module Core
|
3
3
|
class SalesOrderItemSerializer < ActiveModel::Serializer
|
4
4
|
attributes :id, :customer_item_no, :quantity, :quantity_delivered, :price, :delivery_date, :eb_number, :lead_time, :comment,
|
5
|
-
:action_note, :po_reference
|
6
|
-
|
5
|
+
:action_note, :po_reference, :product, :unit
|
6
|
+
|
7
7
|
belongs_to :customer_order_item
|
8
8
|
belongs_to :source
|
9
9
|
belongs_to :unit
|
data/config/routes.rb
CHANGED
data/lib/comee/core/version.rb
CHANGED