facturacr 1.0.5 → 1.0.6
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 +4 -4
- data/lib/facturacr/cli.rb +5 -1
- data/lib/facturacr/document/item.rb +1 -0
- data/lib/facturacr/version.rb +1 -1
- data/lib/facturacr/xml_document.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f79a7e9d0f44bbdc3655d3ec903cba6bc87c8a7
|
4
|
+
data.tar.gz: e9c3a32ada42c6adea6145681dbdf0141a4688af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6da6d3d09e8c9e73b647115371e8efae27d652a789a020eb5ceaa19d9eb9e3073fa73442ad27d9e5c6c3167bf235f771e0e816cee8ed4bc875b97fda739fb9c
|
7
|
+
data.tar.gz: cad88e6a82f1af07418c41c777eb2310115bc6a7baf2767f8587647e811533b4e6cc87d54e85684d0193cf258533c663f1ef334014bf3f49b37c8c74743757e8
|
data/lib/facturacr/cli.rb
CHANGED
@@ -69,7 +69,11 @@ module FE
|
|
69
69
|
invoke :check, [check_key], :config_file=>options[:config_file]
|
70
70
|
else
|
71
71
|
puts "ERROR".red
|
72
|
-
|
72
|
+
request = api.errors[:request]
|
73
|
+
response = request[:response]
|
74
|
+
ap request
|
75
|
+
puts "Code: #{response.code}".red
|
76
|
+
puts "Cause: #{response.headers[:x_error_cause]}".red
|
73
77
|
raise "Sending Document Error"
|
74
78
|
end
|
75
79
|
puts " (send)=> API Logout"
|
@@ -29,6 +29,7 @@ module FE
|
|
29
29
|
validates :discount_reason, presence: true, if: -> { discount.present? }
|
30
30
|
validates :subtotal, presence: true
|
31
31
|
validates :net_total, presence: true
|
32
|
+
validates :code, presence: true, length: {maximum: 20}
|
32
33
|
|
33
34
|
def initialize(args = {})
|
34
35
|
@line_number = args[:line_number]
|
data/lib/facturacr/version.rb
CHANGED
@@ -36,13 +36,14 @@ module FE
|
|
36
36
|
@document.date = DateTime.parse(@doc.css("#{root_tag} FechaEmision").text)
|
37
37
|
@key = @doc.css("#{root_tag} Clave").text
|
38
38
|
@document.key = @key if @key.present?
|
39
|
+
@document.headquarters = @key[21..23]
|
40
|
+
@document.terminal = @key[24..28]
|
39
41
|
@document.number = @key[31..40].to_i
|
40
42
|
@document.document_situation = @key[41]
|
41
43
|
@document.security_code = @key[42..-1]
|
42
44
|
@document.condition = @doc.css("#{root_tag} CondicionVenta").text
|
43
45
|
@document.credit_term = @doc.css("#{root_tag} PlazoCredito").text unless @doc.css("#{root_tag} PlazoCredito").empty?
|
44
46
|
@document.payment_type = @doc.css("#{root_tag} MedioPago").first.text
|
45
|
-
|
46
47
|
@issuer = FE::Document::Issuer.new
|
47
48
|
@issuer.identification_document = FE::Document::IdentificationDocument.new type: @doc.css("#{root_tag} Emisor Identificacion Tipo").text, number: @doc.css("#{root_tag} Emisor Identificacion Numero").text.to_i
|
48
49
|
@issuer.name = @doc.css("#{root_tag} Emisor Nombre").text
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facturacr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Sauter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -234,8 +234,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
236
|
rubyforge_project:
|
237
|
-
rubygems_version: 2.6
|
237
|
+
rubygems_version: 2.4.6
|
238
238
|
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: Facturación Electrónica de Costa Rica
|
241
241
|
test_files: []
|
242
|
+
has_rdoc:
|