comee_core 0.1.88 → 0.1.90
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/sales_order_items_controller.rb +2 -29
- data/app/controllers/comee/core/units_controller.rb +5 -0
- data/app/models/comee/core/pickup_schedule.rb +4 -0
- data/app/models/comee/core/pod.rb +1 -0
- data/app/models/comee/core/transport_availability.rb +4 -0
- data/app/models/comee/core/unit.rb +4 -0
- data/app/serializers/comee/core/sales_order_item_serializer.rb +2 -2
- data/config/routes.rb +5 -1
- data/config/spring.rb +1 -1
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/transport_availabilities.rb +1 -1
- metadata +2 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 756042163169e327bbf9e028c6666dbec6f9c52e907cf5d35b210ca37b310533
|
4
|
+
data.tar.gz: 9c3f9bee0f3b28e6988c490babdb6e56329fe546300920d1d287eb917fca1554
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 757759703fb6cf5f2dac0e7c9dadb29a7c7317c53f788d9a6993cd2ea49cad72c80727ec7d643c2259f5acc21a90aad0e12ce4d27292209429b202af3dbf23db
|
7
|
+
data.tar.gz: 95a9135eb3ad74e2a8666cbcbd8c151f2a19dc801f9249110f01bd1137e664a138958bad4038a309130428296742930f2f73efd4b46369fbded65bd7e280f006
|
@@ -25,39 +25,12 @@ module Comee
|
|
25
25
|
render json: {success: true}
|
26
26
|
end
|
27
27
|
|
28
|
-
# def filter_with_status
|
29
|
-
# items = SalesOrderItem.includes(:sales_order, :product, :unit)
|
30
|
-
# .ransack(params[:q]).result
|
31
|
-
# statuses = ItemStatus.where(sales_order_item_id: items.map(&:id))
|
32
|
-
# .select("MAX(id) AS max_id, sales_order_item_id")
|
33
|
-
# .group(:sales_order_item_id)
|
34
|
-
# .all
|
35
|
-
# ids = statuses.map(&:max_id)
|
36
|
-
# statuses = ItemStatus.where(id: ids).each_with_object({}) { |status, res| res[status.sales_order_item_id] = status }
|
37
|
-
# result = items.each_with_object([]) do |item, res|
|
38
|
-
# status = statuses[item.id]
|
39
|
-
# data = {
|
40
|
-
# sales_order_no: item.sales_order.order_number,
|
41
|
-
# customer_item_no: item.customer_item_no,
|
42
|
-
# product_code: item.product.code,
|
43
|
-
# unit: item.unit.code,
|
44
|
-
# quantity: item.quantity,
|
45
|
-
# delivery_date: item.delivery_date,
|
46
|
-
# handover_date: item.sales_order.handover_date,
|
47
|
-
# po_reference: item.po_reference,
|
48
|
-
# status: status&.status
|
49
|
-
# }
|
50
|
-
# res << data.merge(status&.details)
|
51
|
-
# end
|
52
|
-
# render json: {success: true, data: result}
|
53
|
-
# end
|
54
|
-
|
55
28
|
private
|
56
29
|
|
57
30
|
def model_params
|
58
31
|
params.require(:payload).permit(:sales_order_id, :customer_order_item_id, :product_id, :unit_id, :quantity, :quantity_delivered,
|
59
|
-
:customer_item_no, :price, :delivery_date, :eb_number, :lead_time, :comment,
|
60
|
-
:po_reference, :pallet_no, :source_id)
|
32
|
+
:customer_item_no, :price, :handover_date, :delivery_date, :eb_number, :lead_time, :comment,
|
33
|
+
:action_note, :po_reference, :pallet_no, :source_id)
|
61
34
|
end
|
62
35
|
end
|
63
36
|
end
|
@@ -11,6 +11,10 @@ module Comee
|
|
11
11
|
self.weekday = availability_date.strftime("%A")
|
12
12
|
self.weekday_short = availability_date.strftime("%a")
|
13
13
|
end
|
14
|
+
|
15
|
+
def self.ransackable_attributes(_auth_object = nil)
|
16
|
+
%w[availability_date weekday weekday_short]
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class SalesOrderItemSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :customer_item_no, :quantity, :quantity_delivered, :price, :
|
5
|
-
:action_note, :po_reference
|
4
|
+
attributes :id, :customer_item_no, :quantity, :quantity_delivered, :price, :handover_date, :delivery_date, :eb_number,
|
5
|
+
:lead_time, :comment, :action_note, :po_reference
|
6
6
|
|
7
7
|
belongs_to :sales_order
|
8
8
|
belongs_to :customer_order_item
|
data/config/routes.rb
CHANGED
@@ -66,7 +66,11 @@ Comee::Core::Engine.routes.draw do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
resources :currencies
|
69
|
-
resources :units
|
69
|
+
resources :units do
|
70
|
+
collection do
|
71
|
+
post "filter"
|
72
|
+
end
|
73
|
+
end
|
70
74
|
resources :unit_conversions
|
71
75
|
resources :users
|
72
76
|
post "/purchase_orders/filter", controller: :purchase_orders, action: :filter
|
data/config/spring.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Spring.application_root = "spec/dummy"
|
1
|
+
Spring.application_root = "./spec/dummy"
|
data/lib/comee/core/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :transport_availability, class: "Comee::Core::TransportAvailability" do
|
3
3
|
availability_date do
|
4
|
-
d = Date.current
|
4
|
+
d = Faker::Date.between(from: Date.current, to: Date.current.advance(months: 6))
|
5
5
|
d.advance(days: 1) if d.wday == 7
|
6
6
|
d.advance(days: 2) if d.wday == 6
|
7
7
|
d
|
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.1.
|
4
|
+
version: 0.1.90
|
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-01-
|
11
|
+
date: 2024-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -240,34 +240,6 @@ dependencies:
|
|
240
240
|
- - ">="
|
241
241
|
- !ruby/object:Gem::Version
|
242
242
|
version: '0'
|
243
|
-
- !ruby/object:Gem::Dependency
|
244
|
-
name: spring
|
245
|
-
requirement: !ruby/object:Gem::Requirement
|
246
|
-
requirements:
|
247
|
-
- - ">="
|
248
|
-
- !ruby/object:Gem::Version
|
249
|
-
version: '0'
|
250
|
-
type: :development
|
251
|
-
prerelease: false
|
252
|
-
version_requirements: !ruby/object:Gem::Requirement
|
253
|
-
requirements:
|
254
|
-
- - ">="
|
255
|
-
- !ruby/object:Gem::Version
|
256
|
-
version: '0'
|
257
|
-
- !ruby/object:Gem::Dependency
|
258
|
-
name: spring-commands-rspec
|
259
|
-
requirement: !ruby/object:Gem::Requirement
|
260
|
-
requirements:
|
261
|
-
- - ">="
|
262
|
-
- !ruby/object:Gem::Version
|
263
|
-
version: '0'
|
264
|
-
type: :development
|
265
|
-
prerelease: false
|
266
|
-
version_requirements: !ruby/object:Gem::Requirement
|
267
|
-
requirements:
|
268
|
-
- - ">="
|
269
|
-
- !ruby/object:Gem::Version
|
270
|
-
version: '0'
|
271
243
|
description: An engine which contains core models and end-points for the COMee ERP.
|
272
244
|
email:
|
273
245
|
- henockl@live.com
|