clearbooks 0.18.2 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHORS.md +8 -0
- data/README.md +6 -6
- data/lib/clearbooks/model/entity.rb +36 -20
- data/spec/clearbooks/model/entity_spec.rb +18 -15
- data/spec/fixtures/response/list_entities.xml +39 -28
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80efc02878de7a20b15226b3407eb01ef041ac5c
|
4
|
+
data.tar.gz: 1c4952178173a3888a06830059ad60fb260d850a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dab19863667f800b261a530f0cbd0d32fa5753c1160e1ca9a3275b8c032c071d77502be32cdd2e203b941b75f1a47f245f48d58be11b61c9fb82a8999a00f13
|
7
|
+
data.tar.gz: df67b26898fa58e92790fd5cc7100009be13314e6701cee0d429c347572ed6ea0843578fda7a8ce8677d6129c399829bb8ba1b506958a9f3183e4a1fb2babc47
|
data/AUTHORS.md
CHANGED
@@ -22,6 +22,13 @@ AUTHORS
|
|
22
22
|
W: https://github.com/kukareka
|
23
23
|
S: Creator
|
24
24
|
|
25
|
+
CLEARBOOKS
|
26
|
+
P: Ziyan Junaideen
|
27
|
+
M: jdeen-solutions AT outlook DOT com
|
28
|
+
L: -
|
29
|
+
W: http://github.com/ziyan-junaideen
|
30
|
+
S: Associated
|
31
|
+
|
25
32
|
CLEARBOOKS
|
26
33
|
P: Bjoern Rennhak
|
27
34
|
M: bjoern AT greylon DOT com
|
@@ -29,3 +36,4 @@ AUTHORS
|
|
29
36
|
W: http://github.com/rennhak
|
30
37
|
S: BDFL, Creator
|
31
38
|
|
39
|
+
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Clearbooks
|
2
|
-
Version 0.
|
2
|
+
Version 0.19.0-1-gbc48881
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/clearbooks.svg)](http://badge.fury.io/rb/clearbooks)
|
5
5
|
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://img.shields.io/badge/license-MIT-brightgreen.svg)
|
@@ -486,7 +486,7 @@ Here is a current listing of all tasks:
|
|
486
486
|
|
487
487
|
|
488
488
|
```
|
489
|
-
rake build # Build clearbooks-0.
|
489
|
+
rake build # Build clearbooks-0.19.0.gem into the pkg directory
|
490
490
|
rake cucumber:pretty # Run Cucumber features
|
491
491
|
rake cucumber:progress # Run Cucumber features
|
492
492
|
rake default # Show the default task when executing rake without arguments
|
@@ -494,8 +494,8 @@ rake docs:generate # Generate Yardoc documentation for this project
|
|
494
494
|
rake docs:graph # Generate Yard Graphs for this project
|
495
495
|
rake guard:default # Execute Ruby Guard
|
496
496
|
rake help # Shows the usage help screen
|
497
|
-
rake install # Build and install clearbooks-0.
|
498
|
-
rake install:local # Build and install clearbooks-0.
|
497
|
+
rake install # Build and install clearbooks-0.19.0.gem into system gems
|
498
|
+
rake install:local # Build and install clearbooks-0.19.0.gem into system gems without network access
|
499
499
|
rake man:build # Build the manual pages
|
500
500
|
rake man:clean # Clean up from the built man pages
|
501
501
|
rake measurement:benchmark # When executing rake tasks measure elapsed time, used with other tasks
|
@@ -506,7 +506,7 @@ rake readme # Generate proper README file from templates
|
|
506
506
|
rake readme:all # Generate proper README file from templates
|
507
507
|
rake readme:subdirs # Builds generates readme files in all sub-directories
|
508
508
|
rake readme:topdir # Generate top level README file from template
|
509
|
-
rake release # Create tag v0.
|
509
|
+
rake release # Create tag v0.19.0 and build and push clearbooks-0.19.0.gem to Rubygems
|
510
510
|
rake spec # RSpec Core Tasks
|
511
511
|
rake todo # Look for TODO and FIXME tags in the code
|
512
512
|
rake version # Git Tag number of this repo
|
@@ -532,7 +532,7 @@ thor :docs:generate # Generate Yardoc documentation for this project
|
|
532
532
|
thor :docs:graph # Generate Yard Graphs for this project
|
533
533
|
thor :guard:default # Execute Ruby Guard
|
534
534
|
thor :help # Shows the usage help screen
|
535
|
-
thor :install # Build and install clearbooks-0.
|
535
|
+
thor :install # Build and install clearbooks-0.19.0.gem into system gems
|
536
536
|
thor :man:build # Build the manual pages
|
537
537
|
thor :man:clean # Clean up from the built man pages
|
538
538
|
thor :measurement:benchmark # When executing rake tasks measure elapsed time, used with other tasks
|
@@ -27,6 +27,8 @@ module Clearbooks
|
|
27
27
|
:fax, # string optional
|
28
28
|
:website, # string optional
|
29
29
|
:external_id, # integer optional
|
30
|
+
:vat_number, # integer optional
|
31
|
+
:company_number,# integer optional
|
30
32
|
:statement_url,
|
31
33
|
:supplier,
|
32
34
|
# default_account_code string optional
|
@@ -119,6 +121,16 @@ module Clearbooks
|
|
119
121
|
# Optional.
|
120
122
|
# @return [Fixnum]
|
121
123
|
# @see https://www.clearbooks.co.uk/support/api/docs/soap/createentity/
|
124
|
+
|
125
|
+
# @!attribute [r] vat_number
|
126
|
+
# Optional.
|
127
|
+
# @return [Fixnum]
|
128
|
+
# @see https://www.clearbooks.co.uk/support/api/docs/soap/createentity/
|
129
|
+
|
130
|
+
# @!attribute [r] company_number
|
131
|
+
# Optional.
|
132
|
+
# @return [Fixnum]
|
133
|
+
# @see https://www.clearbooks.co.uk/support/api/docs/soap/createentity/
|
122
134
|
|
123
135
|
# @!attribute [r] supplier
|
124
136
|
# Optional. [:default_account_code, :default_vat_rate, :default_credit_terms]
|
@@ -155,6 +167,8 @@ module Clearbooks
|
|
155
167
|
@fax = data.savon :fax
|
156
168
|
@website = data.savon :website
|
157
169
|
|
170
|
+
@company_number = data.savon :company_number
|
171
|
+
@vat_number = data.savon :vat_number
|
158
172
|
@statement_url = data.savon :statement_url
|
159
173
|
@external_id = data.savon :external_id
|
160
174
|
|
@@ -173,26 +187,28 @@ module Clearbooks
|
|
173
187
|
def to_savon
|
174
188
|
{
|
175
189
|
entity: {
|
176
|
-
:@company_name
|
177
|
-
:@contact_name
|
178
|
-
|
179
|
-
:@building
|
180
|
-
:@address1
|
181
|
-
:@address2
|
182
|
-
:@town
|
183
|
-
:@county
|
184
|
-
:@country
|
185
|
-
:@postcode
|
186
|
-
|
187
|
-
:@email
|
188
|
-
:@phone1
|
189
|
-
:@phone2
|
190
|
-
:@fax
|
191
|
-
:@website
|
192
|
-
|
193
|
-
:@
|
194
|
-
|
195
|
-
|
190
|
+
:@company_name => @company_name,
|
191
|
+
:@contact_name => @contact_name,
|
192
|
+
|
193
|
+
:@building => @building,
|
194
|
+
:@address1 => @address1,
|
195
|
+
:@address2 => @address2,
|
196
|
+
:@town => @town,
|
197
|
+
:@county => @county,
|
198
|
+
:@country => @country,
|
199
|
+
:@postcode => @postcode,
|
200
|
+
|
201
|
+
:@email => @email,
|
202
|
+
:@phone1 => @phone1,
|
203
|
+
:@phone2 => @phone2,
|
204
|
+
:@fax => @fax,
|
205
|
+
:@website => @website,
|
206
|
+
|
207
|
+
:@company_number => @company_number,
|
208
|
+
:@vat_number => @vat_number,
|
209
|
+
:@external_id => @external_id,
|
210
|
+
:supplier => entity_extra(@supplier),
|
211
|
+
:customer => entity_extra(@customer)
|
196
212
|
}.compact
|
197
213
|
}
|
198
214
|
end # }}}
|
@@ -90,7 +90,7 @@ module Clearbooks
|
|
90
90
|
|
91
91
|
it 'returns list of entnties' do
|
92
92
|
expect(entities).to be_an Array
|
93
|
-
expect(entities.length).to eq
|
93
|
+
expect(entities.length).to eq 6
|
94
94
|
end
|
95
95
|
|
96
96
|
describe Entity do
|
@@ -102,23 +102,26 @@ module Clearbooks
|
|
102
102
|
|
103
103
|
it 'has proper attribute values' do
|
104
104
|
expect(entity.id).to eq 6
|
105
|
-
expect(entity.company_name).to eq '
|
106
|
-
expect(entity.contact_name).to eq '
|
107
|
-
expect(entity.address1).to eq '
|
105
|
+
expect(entity.company_name).to eq 'Jane Industries'
|
106
|
+
expect(entity.contact_name).to eq 'Mrs Jane Doe'
|
107
|
+
expect(entity.address1).to eq 'Example Lane'
|
108
108
|
expect(entity.town).to eq 'London'
|
109
|
-
expect(entity.county).to eq '
|
109
|
+
expect(entity.county).to eq 'Greater London'
|
110
|
+
expect(entity.country).to eq 'GB'
|
110
111
|
expect(entity.postcode).to eq '01100'
|
111
|
-
expect(entity.email).to eq '
|
112
|
-
expect(entity.phone1).to eq '
|
113
|
-
expect(entity.building).to eq '
|
114
|
-
expect(entity.address2).to eq '
|
115
|
-
expect(entity.phone2).to eq '
|
116
|
-
expect(entity.fax).to eq '
|
117
|
-
expect(entity.website).to eq 'http://
|
118
|
-
expect(entity.external_id).to eq '
|
119
|
-
expect(entity.
|
112
|
+
expect(entity.email).to eq 'janedoe@test.com'
|
113
|
+
expect(entity.phone1).to eq '+1 234 567 8911'
|
114
|
+
expect(entity.building).to eq 'Building 2'
|
115
|
+
expect(entity.address2).to eq 'Example Place'
|
116
|
+
expect(entity.phone2).to eq '+1 234 567 8913'
|
117
|
+
expect(entity.fax).to eq '+1 234 567 8917'
|
118
|
+
expect(entity.website).to eq 'http://www.janedoe.com'
|
119
|
+
expect(entity.external_id).to eq '106'
|
120
|
+
expect(entity.vat_number).to eq '105'
|
121
|
+
expect(entity.company_number).to eq '106'
|
122
|
+
expect(entity.statement_url).to eq 'https://secure.clearbooks.co.uk/s/64372:97lRduxMpTcowPCTWOxvLg'
|
120
123
|
expect(entity.supplier[:default_account_code]).to eq '30'
|
121
|
-
expect(entity.supplier[:default_vat_rate]).to eq '
|
124
|
+
expect(entity.supplier[:default_vat_rate]).to eq '0.2'
|
122
125
|
expect(entity.supplier[:default_credit_terms]).to eq 30
|
123
126
|
expect(entity.customer).to be_nil
|
124
127
|
end
|
@@ -1,29 +1,40 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<SOAP-ENV:Envelope
|
3
|
-
|
4
|
-
|
5
|
-
<
|
6
|
-
|
7
|
-
|
8
|
-
<SOAP-ENV:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
2
|
+
<SOAP-ENV:Envelope
|
3
|
+
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
4
|
+
xmlns:ns1="https://secure.clearbooks.co.uk/api/soap/">
|
5
|
+
<SOAP-ENV:Header>
|
6
|
+
<ns1:authenticate>true</ns1:authenticate>
|
7
|
+
</SOAP-ENV:Header>
|
8
|
+
<SOAP-ENV:Body>
|
9
|
+
<SOAP-ENV:listEntitiesResponse>
|
10
|
+
<entities>
|
11
|
+
<ns1:Entity id="1" company_name="Bank Account 1" contact_name="" address1="" town="" county="" country="" postcode="" email="" phone1="" building="" address2="" phone2="" fax="" website="" date_modified="2010-03-04 11:32:14" external_id="0" vat_number="" company_number="" statement_url="https://secure.clearbooks.co.uk/s/64372:jPr2XuqMLUE8cu3nncYs-w">
|
12
|
+
<supplier/>
|
13
|
+
<customer/>
|
14
|
+
<bankAccount bankName="" name="" sortcode="" accountNumber=""/>
|
15
|
+
</ns1:Entity>
|
16
|
+
<ns1:Entity id="2" company_name="Supplier 1" contact_name="" address1="" town="" county="" country="" postcode="" email="supplier1@ex.com" phone1="+94727790315" building="" address2="" phone2="" fax="+94727790315" website="" date_modified="2015-10-26 14:55:00" external_id="aeolus_1" vat_number="" company_number="" statement_url="https://secure.clearbooks.co.uk/s/64372:uuU7uPz-VOcmDAcfGMWbWw">
|
17
|
+
<supplier default_account_code="30" default_vat_rate="0.2" default_credit_terms="30"/>
|
18
|
+
<bankAccount bankName="" name="" sortcode="" accountNumber=""/>
|
19
|
+
</ns1:Entity>
|
20
|
+
<ns1:Entity id="3" company_name="Test User" contact_name="" address1="" town="" county="" country="" postcode="" email="ziyan@jdeen.com" phone1="ziyan@jdeen.com" building="" address2="" phone2="" fax="" website="" date_modified="2015-10-30 08:00:58" external_id="aeolus_3" vat_number="" company_number="" statement_url="https://secure.clearbooks.co.uk/s/64372:ut2JNQrd4jRklcyIPC_8jQ">
|
21
|
+
<customer default_account_code="1001001" default_vat_rate="0.2" default_credit_terms="30"/>
|
22
|
+
<bankAccount bankName="" name="" sortcode="" accountNumber=""/>
|
23
|
+
</ns1:Entity>
|
24
|
+
<ns1:Entity id="4" company_name="Supplier 2" contact_name="" address1="" town="" county="" country="" postcode="" email="supplier2@ex.com" phone1="" building="" address2="" phone2="" fax="" website="" date_modified="2015-10-26 14:54:58" external_id="aeolus_2" vat_number="" company_number="" statement_url="https://secure.clearbooks.co.uk/s/64372:Ma2LVzrkvgMcuUriKA80Rg">
|
25
|
+
<supplier default_account_code="30" default_vat_rate="0.2" default_credit_terms="30"/>
|
26
|
+
<bankAccount bankName="" name="" sortcode="" accountNumber=""/>
|
27
|
+
</ns1:Entity>
|
28
|
+
<ns1:Entity id="5" company_name="John Doe" contact_name="Mr John Doe" address1="Example Lane" town="London" county="Greater London" country="GB" postcode="01100" email="johndoe@test.com" phone1="+1 234 567 8910" building="Building 1" address2="Example Place" phone2="+1 234 567 8912" fax="+1 234 567 8914" website="http://www.johndoe.com" date_modified="2015-10-30 12:55:07" external_id="106" vat_number="106" company_number="106" statement_url="https://secure.clearbooks.co.uk/s/64372:t8MdYoBZxFiSuyAyKVNBFw">
|
29
|
+
<customer default_account_code="0" default_vat_rate="0" default_credit_terms="30"/>
|
30
|
+
<bankAccount bankName="" name="" sortcode="" accountNumber=""/>
|
31
|
+
</ns1:Entity>
|
32
|
+
<ns1:Entity id="6" company_name="Jane Industries" contact_name="Mrs Jane Doe" address1="Example Lane" town="London" county="Greater London" country="GB" postcode="01100" email="janedoe@test.com" phone1="+1 234 567 8911" building="Building 2" address2="Example Place" phone2="+1 234 567 8913" fax="+1 234 567 8917" website="http://www.janedoe.com" date_modified="2015-10-30 13:00:28" external_id="106" vat_number="105" company_number="106" statement_url="https://secure.clearbooks.co.uk/s/64372:97lRduxMpTcowPCTWOxvLg">
|
33
|
+
<supplier default_account_code="30" default_vat_rate="0.2" default_credit_terms="30"/>
|
34
|
+
<bankAccount bankName="" name="" sortcode="" accountNumber=""/>
|
35
|
+
</ns1:Entity>
|
36
|
+
</entities>
|
37
|
+
</SOAP-ENV:listEntitiesResponse>
|
38
|
+
</SOAP-ENV:Body>
|
39
|
+
</SOAP-ENV:Envelope>
|
40
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearbooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bjoern Rennhak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -161,7 +161,7 @@ post_install_message: "
|
|
161
161
|
| | ____| / | _ | __ ) / _ / _ | |/ / ___| \n | | | | | _| / _
|
162
162
|
\ | |_) | _ | | | | | | | ' /___ \n | |___| |___| |___ / ___ | _ <| |_) |
|
163
163
|
|_| | |_| | . ___) |\n ____|_____|_____/_/ __| _____/ ___/ ___/|_|_____/
|
164
|
-
\n \n\n (c) 2015-
|
164
|
+
\n \n\n (c) 2015-11-03
|
165
165
|
00:00:00 UTC, All rights reserved\n Bjoern Rennhak, Greylon Ltd.\n\n Don't
|
166
166
|
forget to get Clearbooks API key from http://clearbooks.co.uk\n and save it in
|
167
167
|
~/.clearbooks/config.yml:\n\n $ echo \"api_key: {your_api_key}\" >> ~/.clearbooks/config.yml\n\n
|