sellsy 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/sellsy/api.rb +3 -3
- data/lib/sellsy/invoices.rb +18 -0
- data/sellsy.gemspec +2 -2
- data/test/test_sellsy.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecad828fbc0bcf562f519a88d8449eef686966b0
|
4
|
+
data.tar.gz: 37d509dbf7d699323491f276750879101d85ebd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a466fb070cf68d03d454347a565c0226fd81b5d8781fde2437553c62ebd9e96864713ad3ccf9e48edb87f345ef11c0fadbda95daaf0a2d32ebff935635d111c
|
7
|
+
data.tar.gz: 86e18736c9ae8f51a5bb9d5d2e37852bb876900770ec912f584076d1b1f2ad9d814840e7c1a941585be3e9f158343cdedfa188035d1a7f19367672b04dd2f5e7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/sellsy/api.rb
CHANGED
@@ -29,12 +29,12 @@ module Sellsy
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.info
|
32
|
-
|
32
|
+
command = {
|
33
33
|
:method => 'Infos.getInfos',
|
34
34
|
:params => {}
|
35
35
|
}
|
36
36
|
|
37
|
-
self.request
|
37
|
+
MultiJson.load(self.request command)
|
38
38
|
end
|
39
39
|
|
40
40
|
def self.request(payload)
|
@@ -43,7 +43,7 @@ module Sellsy
|
|
43
43
|
'io_mode' => 'json',
|
44
44
|
'do_in' => payload.to_json
|
45
45
|
}
|
46
|
-
|
46
|
+
|
47
47
|
# RestClient.log = 'stdout'
|
48
48
|
RestClient.post 'https://apifeed.sellsy.com/0/', {:request => 1, :io_mode => 'json', 'do_in' => payload.to_json, :multipart => true}, {:authorization => self.authentication_header}
|
49
49
|
end
|
data/lib/sellsy/invoices.rb
CHANGED
@@ -3,6 +3,15 @@ require 'multi_json'
|
|
3
3
|
module Sellsy
|
4
4
|
class Invoice
|
5
5
|
attr_accessor :id
|
6
|
+
attr_accessor :corp_name
|
7
|
+
attr_accessor :owner_full_name
|
8
|
+
attr_accessor :status
|
9
|
+
attr_accessor :identity
|
10
|
+
|
11
|
+
attr_accessor :total_amount_taxes_free
|
12
|
+
attr_accessor :taxes_amount_sum
|
13
|
+
attr_accessor :total_amount
|
14
|
+
|
6
15
|
attr_accessor :client_id
|
7
16
|
attr_accessor :packaging_name
|
8
17
|
attr_accessor :shipping_name
|
@@ -10,6 +19,8 @@ module Sellsy
|
|
10
19
|
attr_accessor :unit_amount
|
11
20
|
attr_accessor :tax_rate
|
12
21
|
|
22
|
+
# {"status":"ok","filename":"","fileid":"0","nbpages":"1","thirdident":"","thirdname":"Alain","thirdid":"2655","thirdvatnum":"","contactId":"0","contactName":"","displayedDate":"0000-00-00","currencysymbol":"\u20ac","subject":"","docspeakerText":"Votre contact","corpaddressid":"36047","thirdaddressid":"36048","shipaddressid":"36049","rowsAmount":"0.000000000","discountPercent":"0.000000000","discountAmount":"0.000000000","rowsAmountDiscounted":"0.000000000","offerAmount":"0.000000000","rowsAmountAllInc":"0.000000000","packagingsAmount":"49.900000000","shippingsAmount":"60.000000000","totalAmountTaxesFree":"109.900000000","taxesAmountSum":"21.540400000","taxesAmountDetails":"a:1:{s:12:\"19.600000000\";s:12:\"21.540400000\";}","totalAmount":"131.440400000","payDateText":"","payDateCustom":"0000-00-00","payMediumsText":"a:1:{i:0;s:7:\"ch\u00e8que\";}","payCheckOrderText":"","payBankAccountText":"","shippingNbParcels":"0","shippingWeight":"0.000000000","shippingWeightUnit":"g","shippingVolume":"0.000000000","shippingTrackingNumber":"","shippingTrackingUrl":"","saveThirdPrefs":"N","displayShipAddress":"N","corpid":"2","ownerid":"2","linkedtype":"invoice","linkedid":"9512","created":"2012-03-21 14:30:32","prefsid":"14679","parentid":"0","docmapid":"11599","hasVat":"Y","doctypeid":"9512","step":"draft","isDeposit":"N","dueAmount":"131.440400000","currencyid":"1","currencyposition":"right","numberformat":"fr","numberdecimals":",","numberthousands":"","numberprecision":"2","formatted_dueAmount":"131,44 \u20ac","step_color":"pink","step_hex":"#C033DA","step_label":"Non envoy\u00e9e","step_css":"colorDraft","step_banner":"draft_f","step_id":"draft","displayed_payMediumsText":"ch\u00e8que","formatted_totalAmount":"131,44 \u20ac","formatted_totalAmountTaxesFree":"109,90 \u20ac","formatted_displayedDate":"04\/04\/2012","formatted_payDateCustom":"04\/04\/2012","noedit":"N"}
|
23
|
+
|
13
24
|
def create(invoice)
|
14
25
|
command = {
|
15
26
|
'method' => 'Document.create',
|
@@ -130,6 +141,13 @@ module Sellsy
|
|
130
141
|
response['response']['result'].each do |key, value|
|
131
142
|
invoice = Invoice.new
|
132
143
|
invoice.id = value['id']
|
144
|
+
invoice.corp_name = value['corpname']
|
145
|
+
invoice.owner_full_name = value['ownerFullName']
|
146
|
+
invoice.status = value['status']
|
147
|
+
invoice.identity = value['ident']
|
148
|
+
invoice.total_amount_taxes_free = value['totalAmountTaxesFree']
|
149
|
+
invoice.taxes_amount_sum = value['taxesAmountSum']
|
150
|
+
invoice.total_amount = value['totalAmount']
|
133
151
|
invoice.amount = value['rowsAmount']
|
134
152
|
invoices << invoice
|
135
153
|
end
|
data/sellsy.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: sellsy 0.
|
5
|
+
# stub: sellsy 0.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "sellsy"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.3.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
data/test/test_sellsy.rb
CHANGED