Class: FE::CreditNote

Inherits:
Document show all
Defined in:
lib/facturacr/credit_note.rb

Constant Summary

Constants inherited from Document

Document::CONDITIONS, Document::DOCUMENT_SITUATION, Document::DOCUMENT_TYPES, Document::PAYMENT_TYPES

Instance Attribute Summary

Attributes inherited from Document

#condition, #credit_term, #date, #document_situation, #document_type, #issuer, #items, #namespaces, #number, #payment_type, #receiver, #reference_information, #references, #regulation, #security_code, #serial, #service_type, #summary

Instance Method Summary collapse

Methods inherited from Document

#api_payload, #build_xml, #document_name, #generate, #headquarters, #key, #sequence, #terminal

Constructor Details

#initialize(args = {}) ⇒ CreditNote

Returns a new instance of CreditNote.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/facturacr/credit_note.rb', line 6

def initialize(args={})
  @date = args[:date]
  @issuer = args[:issuer]
  @receiver = args[:receiver]
  @items = args[:items]
  @number = args[:number]
  @condition = args[:condition]
  @payment_type = args[:payment_type] || "01"
  @document_type = "03"
  @credit_term = args[:credit_term]
  @summary = args[:summary]
  @regulation = args[:regulation] ||= FE::Document::Regulation.new
  @security_code = args[:security_code]
  @document_situation = args[:document_situation]
  @references = args[:references]
  @namespaces = {
    "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance", 
    "xmlns:xsd"=>"http://www.w3.org/2001/XMLSchema",
    "xmlns"=>"https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/notaCreditoElectronica"#,
  }
end

Instance Method Details

#document_tagObject



28
29
30
# File 'lib/facturacr/credit_note.rb', line 28

def document_tag
  "NotaCreditoElectronica"
end