koho 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/koho/version.rb +1 -1
- data/lib/koho.rb +31 -1
- metadata +2 -2
data/lib/koho/version.rb
CHANGED
data/lib/koho.rb
CHANGED
@@ -33,6 +33,7 @@ module Koho
|
|
33
33
|
|
34
34
|
def customers; Customers.new company_id, token; end
|
35
35
|
def invoices; Invoices.new company_id, token; end
|
36
|
+
def invoice_terms; InvoiceTerms.new company_id, token; end
|
36
37
|
def contracts; Contracts.new company_id, token; end
|
37
38
|
|
38
39
|
##########################3
|
@@ -54,6 +55,14 @@ module Koho
|
|
54
55
|
get "/#{id}"
|
55
56
|
end
|
56
57
|
|
58
|
+
def find_by_contract contract_id
|
59
|
+
get "/find_by_contract/#{contract_id}"
|
60
|
+
end
|
61
|
+
|
62
|
+
def find_by_customer customer_id
|
63
|
+
get "/find_by_customer/#{customer_id}"
|
64
|
+
end
|
65
|
+
|
57
66
|
def create params
|
58
67
|
post '/', invoice: params
|
59
68
|
end
|
@@ -89,6 +98,19 @@ module Koho
|
|
89
98
|
|
90
99
|
end
|
91
100
|
|
101
|
+
|
102
|
+
class InvoiceTerms < Koho::Client
|
103
|
+
base_uri API_BASE_URL+'/invoice_terms'
|
104
|
+
|
105
|
+
def find_by_contract contract_id
|
106
|
+
get "/find_by_contract/#{contract_id}"
|
107
|
+
end
|
108
|
+
|
109
|
+
def mark_non_invoicable id
|
110
|
+
post "/#{id}/mark_non_invoicable"
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
92
114
|
class Contracts < Koho::Client
|
93
115
|
|
94
116
|
base_uri API_BASE_URL+'/contracts'
|
@@ -101,7 +123,14 @@ module Koho
|
|
101
123
|
def find id
|
102
124
|
get "/#{id}"
|
103
125
|
end
|
104
|
-
|
126
|
+
|
127
|
+
def find_by_customer customer_id
|
128
|
+
get "/find_by_customer/#{customer_id}"
|
129
|
+
end
|
130
|
+
|
131
|
+
#...contracts.create name: 'Testisopimus', confirmed_by_manager: true, customer_id: XXX, description: 'Uintipaikka ja aika', start_date: '10.11.2013', products_attributes: [{product_type_id: YYY, count: 2}], acceptance_attributes: {verification_level: :signature}
|
132
|
+
|
133
|
+
|
105
134
|
def create params
|
106
135
|
post '/', contract: params
|
107
136
|
end
|
@@ -111,6 +140,7 @@ module Koho
|
|
111
140
|
end
|
112
141
|
|
113
142
|
end
|
143
|
+
|
114
144
|
end
|
115
145
|
end
|
116
146
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: koho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
type: :development
|