facturacr 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/facturacr/credit_note.rb +1 -0
- data/lib/facturacr/debit_note.rb +1 -0
- data/lib/facturacr/document/other_text.rb +27 -0
- data/lib/facturacr/document.rb +11 -1
- data/lib/facturacr/invoice.rb +1 -0
- data/lib/facturacr/ticket.rb +1 -0
- data/lib/facturacr/version.rb +1 -1
- 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: 68246bb16feef98b233a637240e1aa1d8006c211
|
4
|
+
data.tar.gz: 2e1c8320dc3118bc00706d11e0e1658a22389a3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f90a47cfa56d388408dae727b2fe254cff98ccf9539a16a460d2c6b13f812e19b9850615c9634c40e15d9b99a4925d79d0d0365786abb7322b26c276d8f03df
|
7
|
+
data.tar.gz: c98466c34277acc0a7721efd8bec15444040a9d9567a5eda053ecfd6f7218dc7f2b5b1e311d4806dec1965746227176d14dbd5f0937e435530c8b953880f62be
|
data/lib/facturacr/debit_note.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
module FE
|
2
|
+
class Document
|
3
|
+
class OtherText
|
4
|
+
attr_accessor :xml_attributes, :content
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
def initialize(args={})
|
9
|
+
@xml_attributes = args[:xml_attributes] || {}
|
10
|
+
@content = args[:content]
|
11
|
+
end
|
12
|
+
|
13
|
+
def build_xml(node)
|
14
|
+
raise "xml_attributes is not a Hash" unless @xml_attributes.is_a?(Hash)
|
15
|
+
|
16
|
+
node = Nokogiri::XML::Builder.new if node.nil?
|
17
|
+
node.OtroTexto(@xml_attributes) do |xml|
|
18
|
+
xml.text(@content)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/facturacr/document.rb
CHANGED
@@ -42,7 +42,8 @@ module FE
|
|
42
42
|
attr_accessor :serial, :date, :issuer, :receiver, :condition, :credit_term,
|
43
43
|
:payment_type, :service_type, :reference_information,
|
44
44
|
:regulation, :number, :document_type, :security_code,
|
45
|
-
:items, :references, :namespaces, :summary, :document_situation,
|
45
|
+
:items, :references, :namespaces, :summary, :document_situation,
|
46
|
+
:headquarters, :terminal, :others
|
46
47
|
|
47
48
|
validates :date, presence: true
|
48
49
|
validates :number, presence: true
|
@@ -124,6 +125,14 @@ module FE
|
|
124
125
|
end
|
125
126
|
|
126
127
|
regulation.build_xml(xml)
|
128
|
+
|
129
|
+
if others.any?
|
130
|
+
xml.Otros do |x|
|
131
|
+
@others.each do |o|
|
132
|
+
o.build_xml(x)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
127
136
|
end
|
128
137
|
|
129
138
|
builder
|
@@ -170,3 +179,4 @@ require 'facturacr/document/reference'
|
|
170
179
|
require 'facturacr/document/regulation'
|
171
180
|
require 'facturacr/document/summary'
|
172
181
|
require 'facturacr/document/tax'
|
182
|
+
require 'facturacr/document/other_text'
|
data/lib/facturacr/invoice.rb
CHANGED
@@ -24,6 +24,7 @@ module FE
|
|
24
24
|
"xmlns"=>"https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica"#,
|
25
25
|
#"xsi:schemaLocation"=>"https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica.xsd"
|
26
26
|
}
|
27
|
+
@others = args[:others] || []
|
27
28
|
end
|
28
29
|
|
29
30
|
def document_tag
|
data/lib/facturacr/ticket.rb
CHANGED
data/lib/facturacr/version.rb
CHANGED
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Sauter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- lib/facturacr/document/issuer.rb
|
189
189
|
- lib/facturacr/document/item.rb
|
190
190
|
- lib/facturacr/document/location.rb
|
191
|
+
- lib/facturacr/document/other_text.rb
|
191
192
|
- lib/facturacr/document/phone.rb
|
192
193
|
- lib/facturacr/document/phone_type.rb
|
193
194
|
- lib/facturacr/document/receiver.rb
|