jortt 4.0.0 → 4.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7faec2150bcc8753be6af239ea3efcb49ca5d5c3
4
- data.tar.gz: 3d5e611607ae2e4bfe21a2dd24419ea355cd4c61
3
+ metadata.gz: 9fb355ea7092b575b6bea7c989535898af0aea62
4
+ data.tar.gz: 62f389c052bac3710d7abd9672f1c1b86cb2cfb7
5
5
  SHA512:
6
- metadata.gz: b1d1e1c59783b565a28c4056006811288e007b27860a41a67a3b75bcc29f0cc7560a23fe7f16193e9267f589bab2260bed4e73c02f93d4faf349a65c2b7543d1
7
- data.tar.gz: 35e95f431f5a10dd0fa92c13caeef7125ec6e7bb19862d139885adc97ba030709612c1c022f6a304d476b8fc1350bc99077e4e18e8a8a5b0a81b4258d9b93362
6
+ metadata.gz: cbcb1bfc7f77b82498ae2c08feb079a95e965b833774b836e77d6866ffe563cbc5637eaeade9e68a42ee7374b64996dc08f370ee312be48009c4d465d20805d9
7
+ data.tar.gz: 94009c1f00dedb5bc269f6496ed20859f998ce0928f331f34dee9ddd78c664ede83279ca68417ca43a0ded29aee277775980df4ace69dd2cc82d1a962e6b857b
data/README.md CHANGED
@@ -27,7 +27,7 @@ jortt = Jortt.client(
27
27
 
28
28
  ### Customers
29
29
 
30
- Accessing customers (`jortt.customers.search('Jortt')`) returns:
30
+ Searching customers (`jortt.customers.search('Jortt')`) returns:
31
31
  ```ruby
32
32
  [{
33
33
  company_name: 'Jortt',
@@ -62,6 +62,83 @@ jortt.customers.create(
62
62
  ```
63
63
 
64
64
  ### Invoices
65
+ Searching invoices (`jortt.invoices.search('201606-012')`) returns:
66
+ ```ruby
67
+ [
68
+ {
69
+ "invoice_id": "934d59dd-76f6-4716-9e0f-82a618e1be21",
70
+ "recipient": {
71
+ "company_name": "Zilverine B.V.",
72
+ "attn": null,
73
+ "address": {
74
+ "street": "Cruquisweg 109F",
75
+ "city": "Amsterdam",
76
+ "postal_code": "1111SX",
77
+ "country": {
78
+ "code": "NL",
79
+ "name": "Nederland"
80
+ }
81
+ },
82
+ "email": "ben@jortt.nl",
83
+ "customer_id": "e1c5e15b-e34e-423e-a291-4ed43226a190",
84
+ "extra_information": null,
85
+ "shift_vat": null,
86
+ "vat_number": null,
87
+ "payment_term": 30
88
+ },
89
+ "recipient_in_eu": true,
90
+ "organization": {
91
+ "company_name": "Jortt BV",
92
+ "company_name_line_2": null,
93
+ "address": {
94
+ "street": "Straat 1",
95
+ "city": "Amsterdam",
96
+ "postal_code": "1000 AA",
97
+ "country": {
98
+ "code": "NL",
99
+ "name": "Nederland"
100
+ }
101
+ },
102
+ "phonenumber": null,
103
+ "bank_information": {
104
+ "bic": "RABONL2U",
105
+ "iban": "NL50RABO0150000001",
106
+ "in_the_name_of": "Jortt B.V.",
107
+ "description": null
108
+ },
109
+ "coc_number": "unique number",
110
+ "vat_number": "NL821898279B01",
111
+ "profession": null,
112
+ "healthcare_data": null,
113
+ "free_of_vat": false,
114
+ "finance_email": "Jortt BV <compleet@jortt.nl>"
115
+ },
116
+ "line_items": [
117
+ {
118
+ "description": "Scrum",
119
+ "vat": "0.21",
120
+ "amount": "-100.0",
121
+ "total_amount_ex_vat": "-100.0",
122
+ "currency": "EUR",
123
+ "quantity": "1.0"
124
+ }
125
+ ],
126
+ "invoice_currency": null,
127
+ "invoice_total": "-100.0",
128
+ "invoice_total_incl_vat": "-121.0",
129
+ "invoice_number": "201607-011",
130
+ "invoice_status": "paid",
131
+ "invoice_due_date": "2016-08-06",
132
+ "invoice_date": "2016-07-07",
133
+ "invoice_delivery_period": "2016-07-01",
134
+ "invoice_remarks": null,
135
+ "invoice_language": "nl",
136
+ "invoice_reference": null
137
+ }
138
+ ]
139
+
140
+ ```
141
+
65
142
 
66
143
  Adding invoices:
67
144
  ```ruby
@@ -75,6 +152,22 @@ jortt.invoices.create(
75
152
  )
76
153
  ```
77
154
 
155
+ Sending invoices:
156
+ ```ruby
157
+ jortt.invoice(:invoice_id).send_invoice(
158
+ mail_data: {
159
+ to: 'ben@jortt.nl', # optional
160
+ subject: 'Thank you for your assignment', # optional
161
+ body: 'I hereby send you the invoice', # optional
162
+ },
163
+ invoice_date: Date.today, # optional
164
+ payment_term: 7, # optional
165
+ language: 'nl', # optional
166
+ send_method: 'email', # optional
167
+ )
168
+ ```
169
+
170
+
78
171
  ## Documentation
79
172
 
80
173
  Check https://app.jortt.nl/api-documentatie for more info.
data/jortt.gemspec CHANGED
@@ -8,13 +8,13 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Jortt::Client::VERSION
9
9
  spec.authors = [
10
10
  'Bob Forma',
11
- 'Steven Weller',
11
+ 'Michael Franken',
12
12
  'Lars Vonk',
13
13
  'Stephan van Diepen',
14
14
  ]
15
15
  spec.email = [
16
16
  'bforma@zilverline.com',
17
- 'suweller@zilverline.com',
17
+ 'mfranken@zilverline.com',
18
18
  'lvonk@zilverline.com',
19
19
  'svdiepen@zilverline.com',
20
20
  ]
@@ -40,6 +40,12 @@ module Jortt # :nodoc:
40
40
  end
41
41
  end
42
42
 
43
+ def search(query)
44
+ resource["search"].get(params: {query: query}) do |response|
45
+ JSON.parse(response.body)
46
+ end
47
+ end
48
+
43
49
  private
44
50
 
45
51
  attr_reader :resource
@@ -2,6 +2,6 @@
2
2
  module Jortt
3
3
  # Define the version of +Jortt::Client+
4
4
  class Client
5
- VERSION = '4.0.0'
5
+ VERSION = '4.1.0'
6
6
  end
7
7
  end
@@ -19,4 +19,13 @@ describe Jortt::Client::Invoices do
19
19
  end
20
20
  it { should eq('invoice_id' => 'abc') }
21
21
  end
22
+
23
+ describe '#search' do
24
+ subject { invoices.search('terms') }
25
+ before do
26
+ stub_request(:get, 'http://app:secret@foo/invoices/search?query=terms').
27
+ to_return(status: 200, body: '{"invoices": []}')
28
+ end
29
+ it { should eq('invoices' => []) }
30
+ end
22
31
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jortt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Forma
8
- - Steven Weller
8
+ - Michael Franken
9
9
  - Lars Vonk
10
10
  - Stephan van Diepen
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-07-05 00:00:00.000000000 Z
14
+ date: 2016-07-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
@@ -142,7 +142,7 @@ dependencies:
142
142
  description:
143
143
  email:
144
144
  - bforma@zilverline.com
145
- - suweller@zilverline.com
145
+ - mfranken@zilverline.com
146
146
  - lvonk@zilverline.com
147
147
  - svdiepen@zilverline.com
148
148
  executables: []