xsys 0.0.13 → 0.0.14

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: b9023cacad32fd0446d894f180354f35a6b784a9
4
- data.tar.gz: 2fbffe3eb4db94c88b16ec285748a338e867a436
3
+ metadata.gz: df84c8736633a9c41b8f2d1d0271621a96412544
4
+ data.tar.gz: 46bf9ac5472121cf9627715edf214dc191e88ad4
5
5
  SHA512:
6
- metadata.gz: 2626587b2ee7ec646475e623d83c6280a0b330785bea7a13e6b7f03a02e32c49db463d8c31f6b3492421f9c7f541a36093ad74f74170b2df683f6a1494e06c05
7
- data.tar.gz: 33045d2226df5bff54493340ddeb629f4e1b76786932d6ceb4297fbbe6935620762668f23cda5d0ced4ec8f9063ea6835883c99744260e8904086c3436a435cf
6
+ metadata.gz: 7e98aeb05ba04a1e503614316aa1ed8dc534f2a6b2165fc3891ee1ad7bd9f062cba0e3bfb20cd5ff3a6b175f0cab7eca4d027394ac473f03972109618691931a
7
+ data.tar.gz: 549f43f793f988f8378d2ecb0c965bd1db0e91b2c0584112aeecc6898892d7dda0404ccfca87c09ad72c1e184dd4d027756703eca961e32445206025d49be8a0
data/CHANGELOG.md CHANGED
@@ -49,3 +49,7 @@
49
49
  ## v0.0.13
50
50
 
51
51
  * Fixed syntax error
52
+
53
+ ## v0.0.14
54
+
55
+ * Added fiscal position methods
data/lib/xsys/api.rb CHANGED
@@ -91,6 +91,16 @@ module Xsys
91
91
  request
92
92
  end
93
93
 
94
+ def self.get_sales_position(period)
95
+ request = get_request("/sales_position/#{period}")
96
+ request.map { |r| Model::SalesPosition.new(r) }
97
+ end
98
+
99
+ def self.get_purchases_position(period)
100
+ request = get_request("/purchases_position/#{period}")
101
+ request.map { |r| Model::PurchasesPosition.new(r) }
102
+ end
103
+
94
104
  private
95
105
 
96
106
  def self.get_request(action, params={})
@@ -0,0 +1,14 @@
1
+ module Xsys
2
+ module Model
3
+ class PurchasesPosition
4
+ attr_accessor :business_unit, :amount_taxes_21, :amount_taxes_27,
5
+ :amount_taxes_10_5, :amount_total, :amount_iva_perception, :amount_iva_retention
6
+
7
+ def initialize(attributes={})
8
+ attributes.each do |k,v|
9
+ self.send("#{k}=", v)
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Xsys
2
+ module Model
3
+ class SalesPosition
4
+ attr_accessor :shop_code, :business_unit, :amount_taxes_21,
5
+ :amount_taxes_10_5, :amount_total, :extra_payments_total
6
+
7
+ def initialize(attributes={})
8
+ attributes.each do |k,v|
9
+ self.send("#{k}=", v)
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
data/lib/xsys/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xsys
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
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.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,8 +72,10 @@ files:
72
72
  - lib/xsys/model/product_provider.rb
73
73
  - lib/xsys/model/provider_kind.rb
74
74
  - lib/xsys/model/purchase_order_item.rb
75
+ - lib/xsys/model/purchases_position.rb
75
76
  - lib/xsys/model/sale_item.rb
76
77
  - lib/xsys/model/sales_period.rb
78
+ - lib/xsys/model/sales_position.rb
77
79
  - lib/xsys/model/seller.rb
78
80
  - lib/xsys/model/shop.rb
79
81
  - lib/xsys/model/stock.rb