sk_api_schema 0.8.8 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  See [commit messages](https://github.com/salesking/sk_api_schema/commits/) for details.
4
4
  Also sign up to our [Developer Newsletter](http://www.salesking.eu/dev/newsletter/) to stay up-to-date !!!
5
5
 
6
+ ##2013-12
7
+
8
+ * add cost_total, gross_margin to documents
9
+ * rename product.cost_price to cost
10
+
11
+ line_item:
12
+ * remove use_product switch. Now copy product fields into item whenever a product_id is set.
13
+ * remove required quantity and position, now defaulting to 1
14
+ * add cost, cost_total, gross_margin
15
+
6
16
  ##2013-10
7
17
 
8
18
  * add net_total, gross_total to line item
@@ -185,6 +185,21 @@
185
185
  "description": "Net total, 6 decimal places incl. discount",
186
186
  "readonly":true,
187
187
  "type":"number"
188
+ },
189
+ "cost_total":{
190
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
191
+ "readonly":true,
192
+ "type":"number"
193
+ },
194
+ "gross_margin_total":{
195
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
196
+ "readonly":true,
197
+ "type":"number"
198
+ },
199
+ "gross_margin_pct":{
200
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
201
+ "readonly":true,
202
+ "type":"number"
188
203
  }
189
204
  },
190
205
  "links":[
@@ -170,6 +170,21 @@
170
170
  "description": "Net total, 6 decimal places incl. discount",
171
171
  "readonly":true,
172
172
  "type":"number"
173
+ },
174
+ "cost_total":{
175
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
176
+ "readonly":true,
177
+ "type":"number"
178
+ },
179
+ "gross_margin_total":{
180
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
181
+ "readonly":true,
182
+ "type":"number"
183
+ },
184
+ "gross_margin_pct":{
185
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
186
+ "readonly":true,
187
+ "type":"number"
173
188
  }
174
189
  },
175
190
  "links":[
@@ -186,6 +186,21 @@
186
186
  "readonly":true,
187
187
  "type":"number"
188
188
  },
189
+ "cost_total":{
190
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
191
+ "readonly":true,
192
+ "type":"number"
193
+ },
194
+ "gross_margin_total":{
195
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
196
+ "readonly":true,
197
+ "type":"number"
198
+ },
199
+ "gross_margin_pct":{
200
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
201
+ "readonly":true,
202
+ "type":"number"
203
+ },
189
204
  "recurring_id":{
190
205
  "description":"Recurring document ID, if the invoice was created from a recurring.",
191
206
  "readonly":true,
@@ -12,9 +12,9 @@
12
12
  "minLength":22
13
13
  },
14
14
  "position":{
15
- "description": "Required since items are sorted by position.",
15
+ "description": "Position by which the items are sorted. Two items can have the same position(if you dont care) and numbers dont need to continuous",
16
16
  "type":"integer",
17
- "required":true
17
+ "default": 1
18
18
  },
19
19
  "name":{
20
20
  "description": "The name of an item",
@@ -40,6 +40,25 @@
40
40
  "description": "Net price of a single item",
41
41
  "type":"number"
42
42
  },
43
+ "cost":{
44
+ "description": "Cost price for a single item. Used to calculate the gross margin",
45
+ "type":"number"
46
+ },
47
+ "cost_total":{
48
+ "description": "Total costs. Calculated from cost_single * quantity",
49
+ "readonly":true,
50
+ "type":"number"
51
+ },
52
+ "gross_margin_total":{
53
+ "description": "Gross margin, the difference between revenue and cost before accounting for certain other costs. Calculated from net_total - cost_total",
54
+ "readonly":true,
55
+ "type":"number"
56
+ },
57
+ "gross_margin_pct":{
58
+ "description": "Gross margin percentage. Calculated from gross_margin_total/cost_total",
59
+ "readonly":true,
60
+ "type":"number"
61
+ },
43
62
  "net_total":{
44
63
  "description": "Net price of a single item. Calculated from price_single * quantity * discount",
45
64
  "readonly":true,
@@ -67,18 +86,14 @@
67
86
  "description": "Quantity of the item. Must be >= 0",
68
87
  "type":"number",
69
88
  "minimum":0,
70
- "required":true
89
+ "default": 1
71
90
  },
72
91
  "product_id":{
73
- "description": "A uuid of a product, referenced in this item. This makes it easier to track a products turnover and list the documents it is used on. Also see use_product",
92
+ "description": "A uuid of a product, used by this item. If set or changed, the product fields (name, description, quantity, unit, price, cost price) are copied if the according item fields are missing/blank. Besides this product link makes it possible to track a products turnover and find the documents it is used on.",
74
93
  "type":"string",
75
94
  "maxLength": 22,
76
95
  "minLength":22
77
96
  },
78
- "use_product":{
79
- "description": "If set and product_id is present, the products name, description, quantity, unit, price are copied if the according item fields are missing.",
80
- "type":"boolean"
81
- },
82
97
  "created_at":{
83
98
  "description": "Date the object was created in SK. Never changes afterwards",
84
99
  "format":"date-time",
data/json/v1.0/order.json CHANGED
@@ -175,6 +175,21 @@
175
175
  "description": "Net total, 6 decimal places incl. discount",
176
176
  "readonly":true,
177
177
  "type":"number"
178
+ },
179
+ "cost_total":{
180
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
181
+ "readonly":true,
182
+ "type":"number"
183
+ },
184
+ "gross_margin_total":{
185
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
186
+ "readonly":true,
187
+ "type":"number"
188
+ },
189
+ "gross_margin_pct":{
190
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
191
+ "readonly":true,
192
+ "type":"number"
178
193
  }
179
194
  },
180
195
  "links":[
@@ -36,7 +36,7 @@
36
36
  "type":"number",
37
37
  "required":true
38
38
  },
39
- "cost_price":{
39
+ "cost":{
40
40
  "description": "Cost price of a single product",
41
41
  "type":"number"
42
42
  },
@@ -163,6 +163,21 @@
163
163
  "readonly":true,
164
164
  "type":"number"
165
165
  },
166
+ "cost_total":{
167
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
168
+ "readonly":true,
169
+ "type":"number"
170
+ },
171
+ "gross_margin_total":{
172
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
173
+ "readonly":true,
174
+ "type":"number"
175
+ },
176
+ "gross_margin_pct":{
177
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
178
+ "readonly":true,
179
+ "type":"number"
180
+ },
166
181
  "pdf_template_id":{
167
182
  "description": "The PDF template used for printing the invoice when auto sending. Required when auto_send'ing is enabled.",
168
183
  "type":"string",
@@ -1,7 +1,7 @@
1
1
  module SK
2
2
  module Api
3
3
  class Schema
4
- VERSION='0.8.8'
4
+ VERSION='0.9.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sk_api_schema
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 8
9
- - 8
10
- version: 0.8.8
8
+ - 9
9
+ - 0
10
+ version: 0.9.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Georg Leciejewski
@@ -15,10 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-10-22 00:00:00 Z
18
+ date: 2013-12-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- type: :runtime
21
+ name: activesupport
22
+ prerelease: false
22
23
  requirement: &id001 !ruby/object:Gem::Requirement
23
24
  none: false
24
25
  requirements:
@@ -28,11 +29,11 @@ dependencies:
28
29
  segments:
29
30
  - 0
30
31
  version: "0"
32
+ type: :runtime
31
33
  version_requirements: *id001
32
- prerelease: false
33
- name: activesupport
34
34
  - !ruby/object:Gem::Dependency
35
- type: :development
35
+ name: rdoc
36
+ prerelease: false
36
37
  requirement: &id002 !ruby/object:Gem::Requirement
37
38
  none: false
38
39
  requirements:
@@ -42,11 +43,11 @@ dependencies:
42
43
  segments:
43
44
  - 0
44
45
  version: "0"
46
+ type: :development
45
47
  version_requirements: *id002
46
- prerelease: false
47
- name: rdoc
48
48
  - !ruby/object:Gem::Dependency
49
- type: :development
49
+ name: rspec
50
+ prerelease: false
50
51
  requirement: &id003 !ruby/object:Gem::Requirement
51
52
  none: false
52
53
  requirements:
@@ -56,11 +57,11 @@ dependencies:
56
57
  segments:
57
58
  - 0
58
59
  version: "0"
60
+ type: :development
59
61
  version_requirements: *id003
60
- prerelease: false
61
- name: rspec
62
62
  - !ruby/object:Gem::Dependency
63
- type: :development
63
+ name: simplecov
64
+ prerelease: false
64
65
  requirement: &id004 !ruby/object:Gem::Requirement
65
66
  none: false
66
67
  requirements:
@@ -70,11 +71,11 @@ dependencies:
70
71
  segments:
71
72
  - 0
72
73
  version: "0"
74
+ type: :development
73
75
  version_requirements: *id004
74
- prerelease: false
75
- name: simplecov
76
76
  - !ruby/object:Gem::Dependency
77
- type: :development
77
+ name: rake
78
+ prerelease: false
78
79
  requirement: &id005 !ruby/object:Gem::Requirement
79
80
  none: false
80
81
  requirements:
@@ -86,9 +87,8 @@ dependencies:
86
87
  - 9
87
88
  - 2
88
89
  version: 0.9.2
90
+ type: :development
89
91
  version_requirements: *id005
90
- prerelease: false
91
- name: rake
92
92
  description: |-
93
93
  The SalesKing JSON Schema describes our business API in terms of available objects, their fields and links to url endpoints with related objects.
94
94
  Besides ruby users can use a small lib with utility methods to load and test the schema files.