Class: SunatInvoice::DailySummary

Inherits:
XmlDocument show all
Defined in:
lib/sunat_invoice/daily_summary.rb

Direct Known Subclasses

Voided

Constant Summary

Constants inherited from XmlDocument

XmlDocument::CUSTOMIZATION, XmlDocument::UBL_VERSION

Constants included from Utils

Utils::COMMON_NAMESPACES, Utils::CREDIT_NOTE_NAMESPACES, Utils::DAILY_SUMMARY_NAMESPACES, Utils::DEBIT_NOTE_NAMESPACES, Utils::INVOICE_NAMESPACES, Utils::SUMMARY_NAMESPACES, Utils::TRADE_NAMESPACES, Utils::VOIDED_NAMESPACES

Instance Attribute Summary collapse

Attributes inherited from XmlDocument

#currency, #date, #lines, #provider, #signature

Instance Method Summary collapse

Methods inherited from XmlDocument

#build_ext, #build_lines_xml, #build_number, #build_xml, #formatted_date, #initialize

Methods included from Utils

#amount_xml, #ubl_ext

Methods inherited from Model

#initialize, #to_hash

Constructor Details

This class inherits a constructor from SunatInvoice::XmlDocument

Instance Attribute Details

#reference_dateObject

Returns the value of attribute reference_date.



5
6
7
# File 'lib/sunat_invoice/daily_summary.rb', line 5

def reference_date
  @reference_date
end

Instance Method Details

#document_nameObject



26
27
28
# File 'lib/sunat_invoice/daily_summary.rb', line 26

def document_name
  "#{@provider.ruc}-#{document_number}"
end

#namespacesObject



7
8
9
# File 'lib/sunat_invoice/daily_summary.rb', line 7

def namespaces
  DAILY_SUMMARY_NAMESPACES.merge(SUMMARY_NAMESPACES)
end

#operationObject



22
23
24
# File 'lib/sunat_invoice/daily_summary.rb', line 22

def operation
  :send_summary
end

#xmlObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/sunat_invoice/daily_summary.rb', line 11

def xml
  build = build_xml do |xml|
    build_number(xml)
    build_summary_info(xml)
    @signature.signer_data(xml)
    @provider.info(xml, false)
    build_lines_xml(xml)
  end
  @signature.sign(build.to_xml)
end