xsys 0.31.0 → 0.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/xsys/api.rb +11 -1
- data/lib/xsys/model/corporation.rb +25 -0
- data/lib/xsys/model/corporation_tax.rb +2 -1
- data/lib/xsys/version.rb +1 -1
- data/lib/xsys.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddfb434b5d9549e3c2df038a56c793f2599ce3d3
|
4
|
+
data.tar.gz: a12a9d17447e57239446a642daf64e7afe0035c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b3c38271b4fe9d7f9a3966252e0da84f5e37033772d0e3b8d8cd436c3002cd559a85ffb807982220cb0dc7d06658d57e6630b92147f40b03b0cdfdf4972c0ed
|
7
|
+
data.tar.gz: ca09aae5c8d849d94d80aa40748c260d323c7fa6209d4010b7ce91fabb758dff2ecc87f9ee5f8721f262962fb0309079570b93e1f1ccb7fd0f655d34fea40ec1
|
data/CHANGELOG.md
CHANGED
data/lib/xsys/api.rb
CHANGED
@@ -213,7 +213,7 @@ module Xsys
|
|
213
213
|
if result == 'null'
|
214
214
|
nil
|
215
215
|
else
|
216
|
-
Model::Company.new(
|
216
|
+
Model::Company.new(result)
|
217
217
|
end
|
218
218
|
end
|
219
219
|
|
@@ -226,6 +226,16 @@ module Xsys
|
|
226
226
|
Model::CompanyTaxCalculation.new(get_request('/companies/calculate_taxes', attrs)[:body])
|
227
227
|
end
|
228
228
|
|
229
|
+
def self.get_corporation(cuit)
|
230
|
+
result = get_request("/corporations/#{cuit}")[:body]
|
231
|
+
|
232
|
+
if result == 'null'
|
233
|
+
nil
|
234
|
+
else
|
235
|
+
Model::Corporation.new(result)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
229
239
|
def self.calculate_corporation_taxes(cuit, items)
|
230
240
|
response = post_request('/corporations/taxes_calculation', {
|
231
241
|
cuit: cuit,
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Xsys
|
2
|
+
module Model
|
3
|
+
class Corporation
|
4
|
+
def self.attr_list
|
5
|
+
[:cuit, :name, :taxes]
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_reader *attr_list
|
9
|
+
|
10
|
+
def initialize(attributes={})
|
11
|
+
attributes.each do |k, v|
|
12
|
+
if k.to_s == 'taxes'
|
13
|
+
@taxes = v.map { |x| CorporationTax.new(x) } unless v.nil?
|
14
|
+
else
|
15
|
+
end
|
16
|
+
self.send("#{k}=", v) if self.respond_to?(k)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_writer *attr_list
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -2,12 +2,13 @@ module Xsys
|
|
2
2
|
module Model
|
3
3
|
class CorporationTax
|
4
4
|
def self.attr_list
|
5
|
-
[:tax_kind_code, :tax_kind_name, :quotient, :amount, :use_default_value]
|
5
|
+
[:cuit, :tax_kind_code, :tax_kind_name, :quotient, :amount, :use_default_value]
|
6
6
|
end
|
7
7
|
|
8
8
|
attr_reader *attr_list
|
9
9
|
|
10
10
|
def initialize(attributes={})
|
11
|
+
self.cuit = attributes['cuit']
|
11
12
|
self.tax_kind_code = attributes['tax_kind_code']
|
12
13
|
self.tax_kind_name = attributes['tax_kind_name']
|
13
14
|
self.quotient = BigDecimal.new(attributes['quotient'])
|
data/lib/xsys/version.rb
CHANGED
data/lib/xsys.rb
CHANGED
@@ -3,6 +3,7 @@ require 'xsys/model/company'
|
|
3
3
|
require 'xsys/model/company_tax_calculation'
|
4
4
|
require 'xsys/model/corporation_tax'
|
5
5
|
require 'xsys/model/corporation_taxes_calculation'
|
6
|
+
require 'xsys/model/corporation'
|
6
7
|
require 'xsys/model/job_event'
|
7
8
|
require 'xsys/model/price_list'
|
8
9
|
require 'xsys/model/product'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xsys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias Hick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/xsys/model/background_job.rb
|
68
68
|
- lib/xsys/model/company.rb
|
69
69
|
- lib/xsys/model/company_tax_calculation.rb
|
70
|
+
- lib/xsys/model/corporation.rb
|
70
71
|
- lib/xsys/model/corporation_tax.rb
|
71
72
|
- lib/xsys/model/corporation_taxes_calculation.rb
|
72
73
|
- lib/xsys/model/job_event.rb
|