unidom-shipment 0.5.1 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/app/models/unidom/shipment/shipment.rb +4 -0
- data/app/models/unidom/shipment/shipment_item.rb +1 -0
- data/app/models/unidom/shipment/shipment_package.rb +1 -0
- data/app/models/unidom/shipment/shipment_package_item.rb +1 -0
- data/app/models/unidom/shipment/shipment_receipt.rb +1 -0
- data/app/types/unidom/shipment/conveyance.rb +7 -0
- data/config/enum.yml +15 -0
- data/config/locales/enum.zh-CN.yml +10 -0
- data/lib/unidom/shipment/engine.rb +6 -0
- data/lib/unidom/shipment/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f9a1eb9afc7121908038c8d96b5def3a1301e5
|
4
|
+
data.tar.gz: 485a2c6e736e9fd26f704eb1a19f4293533a2ee6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f91b27ce41acedda4d1b30837ccb0ec6f80b79297b5109fa3bb7b35b130fb8ee0d3d99705cdd30e3ecd3d80e4f7eb9af0c2d23d973564c7e5a911dd9581453
|
7
|
+
data.tar.gz: 9c09a19bdc10b9f343966ad572465967dcc0fd59eab9cbbf8ba98ec3bac1c27d96b02b5506c6ce7ccddb4773e3229f639a94e058b360bcaee5165e296a4eaa6b
|
data/README.md
CHANGED
@@ -59,3 +59,18 @@ include Unidom::Shipment::Concerns::AsShipped
|
|
59
59
|
The As Shipped concern do the following tasks for the includer automatically:
|
60
60
|
1. Define the has_many :shipment_items macro as: ``has_many :shipment_items, class_name: 'Unidom::Shipment::ShipmentItem', foreign_key: :shipped_id``
|
61
61
|
2. Define the has_many :shipment_receipts macro as: ``has_many :shipment_receipts, class_name: 'Unidom::Shipment::ShipmentReceipt', foreign_key: :shipped_id``
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
## Enum codes
|
66
|
+
|
67
|
+
### Conveyance enum code
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
Unidom::Shipment::Conveyance::customer_shipment # 客户装运
|
71
|
+
Unidom::Shipment::Conveyance::customer_return # 客户退回
|
72
|
+
Unidom::Shipment::Conveyance::purchase_shipment # 购买装运
|
73
|
+
Unidom::Shipment::Conveyance::purchase_return # 进货退回
|
74
|
+
Unidom::Shipment::Conveyance::transfer # 转运
|
75
|
+
Unidom::Shipment::Conveyance::drop_shipment # 直接装运
|
76
|
+
```
|
@@ -1,3 +1,4 @@
|
|
1
|
+
##
|
1
2
|
# Shipment 是装运。
|
2
3
|
# conveyance_code 是运送代码,可以是以下取值:
|
3
4
|
# CSSP: Customer Shipment 客户装运,把货物发给客户。
|
@@ -12,6 +13,7 @@ class Unidom::Shipment::Shipment < Unidom::Shipment::ApplicationRecord
|
|
12
13
|
self.table_name = 'unidom_shipments'
|
13
14
|
|
14
15
|
include Unidom::Common::Concerns::ModelExtension
|
16
|
+
include ProgneTapera::EnumCode
|
15
17
|
|
16
18
|
validates :estimated_amount, presence: true, numericality: { greater_than_or_equal_to: 0 }
|
17
19
|
validates :actual_amount, presence: true, numericality: { greater_than_or_equal_to: 0 }
|
@@ -28,4 +30,6 @@ class Unidom::Shipment::Shipment < Unidom::Shipment::ApplicationRecord
|
|
28
30
|
|
29
31
|
has_many :items, class_name: 'Unidom::Shipment::ShipmentItem'
|
30
32
|
|
33
|
+
code :conveyance, Unidom::Shipment::Conveyance
|
34
|
+
|
31
35
|
end
|
data/config/enum.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
'zh-CN':
|
2
|
+
enum:
|
3
|
+
|
4
|
+
unidom_conveyance:
|
5
|
+
customer_shipment: 客户装运 # 把货物发给客户。
|
6
|
+
customer_return: 客户退回 # 从购买了产品的客户那里把退回的产品运回来。
|
7
|
+
purchase_shipment: 购买装运 # 从供应商那里把购买的货物运进来。
|
8
|
+
purchase_return: 进货退回 # 把发来的货物返回给供应商。
|
9
|
+
transfer: 转运 # 从内部组织到另一个内部组织调拨。
|
10
|
+
drop_shipment: 直接装运 # 销售商把产品从供应商那里直接运送给客户。
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'unidom/common/yaml_helper'
|
2
|
+
|
1
3
|
module Unidom
|
2
4
|
module Shipment
|
3
5
|
|
@@ -5,6 +7,10 @@ module Unidom
|
|
5
7
|
|
6
8
|
isolate_namespace ::Unidom::Shipment
|
7
9
|
|
10
|
+
initializer :load_config_initializers do |app|
|
11
|
+
Unidom::Common::YamlHelper.load_enum config: app.config, root: config.root
|
12
|
+
end
|
13
|
+
|
8
14
|
initializer :append_migrations do |app|
|
9
15
|
config.paths['db/migrate'].expanded.each { |expanded_path| app.config.paths['db/migrate'] << expanded_path } unless app.root.to_s.match root.to_s
|
10
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-shipment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|
@@ -50,7 +50,10 @@ files:
|
|
50
50
|
- app/models/unidom/shipment/shipment_package.rb
|
51
51
|
- app/models/unidom/shipment/shipment_package_item.rb
|
52
52
|
- app/models/unidom/shipment/shipment_receipt.rb
|
53
|
+
- app/types/unidom/shipment/conveyance.rb
|
53
54
|
- app/views/layouts/unidom/shipment/application.html.erb
|
55
|
+
- config/enum.yml
|
56
|
+
- config/locales/enum.zh-CN.yml
|
54
57
|
- config/routes.rb
|
55
58
|
- db/migrate/20021001000000_create_unidom_shipments.rb
|
56
59
|
- db/migrate/20021002000000_create_unidom_shipment_items.rb
|