class SunatInvoice::DailySummary

Attributes

reference_date[RW]

Public Instance Methods

document_name() click to toggle source
# File lib/sunat_invoice/daily_summary.rb, line 26
def document_name
  "#{@provider.ruc}-#{document_number}"
end
namespaces() click to toggle source
# File lib/sunat_invoice/daily_summary.rb, line 7
def namespaces
  DAILY_SUMMARY_NAMESPACES.merge(SUMMARY_NAMESPACES)
end
operation() click to toggle source
# File lib/sunat_invoice/daily_summary.rb, line 22
def operation
  :send_summary
end
xml() click to toggle source
# 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

Private Instance Methods

build_summary_info(xml) click to toggle source
# File lib/sunat_invoice/daily_summary.rb, line 41
def build_summary_info(xml)
  xml['cbc'].ReferenceDate formatted_date(reference_date)
  xml['cbc'].IssueDate formatted_date(date)
end
document_number() click to toggle source
# File lib/sunat_invoice/daily_summary.rb, line 36
def document_number
  formatted = date.strftime('%Y%m%d') #  YYYYMMDD
  "RC-#{formatted}-1"
end
root_name() click to toggle source
# File lib/sunat_invoice/daily_summary.rb, line 32
def root_name
  'SummaryDocuments'
end