facturacr 1.0.2 → 1.0.4

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: 4bebcdc34802fd5819d42c9d03a493dd1f5978c8
4
- data.tar.gz: 386e218145ded7382bcad22816258ace2f5145cc
3
+ metadata.gz: 68246bb16feef98b233a637240e1aa1d8006c211
4
+ data.tar.gz: 2e1c8320dc3118bc00706d11e0e1658a22389a3b
5
5
  SHA512:
6
- metadata.gz: 39dca71def73211dc98f2081e6c291fb976755884fde5d436ccc53f89442e08da90e9f853dc6695a9857a5615efd05ef47e168e0fe0d2df219dc0f6078205e87
7
- data.tar.gz: ff1d1134455f109c881eeb8722a9a56d9ae15f984e8470c29c9db9386f9e941c2013938eb89a23bff01c62725c14b529efe2e7d7503441960598962b4bbb6786
6
+ metadata.gz: 8f90a47cfa56d388408dae727b2fe254cff98ccf9539a16a460d2c6b13f812e19b9850615c9634c40e15d9b99a4925d79d0d0365786abb7322b26c276d8f03df
7
+ data.tar.gz: c98466c34277acc0a7721efd8bec15444040a9d9567a5eda053ecfd6f7218dc7f2b5b1e311d4806dec1965746227176d14dbd5f0937e435530c8b953880f62be
@@ -23,6 +23,7 @@ module FE
23
23
  "xmlns:xsd"=>"http://www.w3.org/2001/XMLSchema",
24
24
  "xmlns"=>"https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/notaCreditoElectronica"#,
25
25
  }
26
+ @others = args[:others] || []
26
27
  end
27
28
 
28
29
  def document_tag
@@ -23,6 +23,7 @@ module FE
23
23
  "xmlns:xsd"=>"http://www.w3.org/2001/XMLSchema",
24
24
  "xmlns"=>"https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/notaDebitoElectronica"
25
25
  }
26
+ @others = args[:others] || []
26
27
  end
27
28
 
28
29
  def document_tag
@@ -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
@@ -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, :headquarters, :terminal
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'
@@ -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
@@ -23,6 +23,7 @@ module FE
23
23
  "xmlns:xsd"=>"http://www.w3.org/2001/XMLSchema",
24
24
  "xmlns"=>"https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/tiqueteElectronico"
25
25
  }
26
+ @others = args[:others] || []
26
27
  end
27
28
 
28
29
  def document_tag
@@ -1,3 +1,3 @@
1
1
  module FE
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.4"
3
3
  end
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.2
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-08 00:00:00.000000000 Z
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