Class: SunatInvoice::Provider

Inherits:
Tributer show all
Includes:
Utils
Defined in:
lib/sunat_invoice/provider.rb

Constant Summary

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 Tributer

#commercial_name, #country_code, #department, #district, #document_type, #name, #province, #ruc, #street, #ubigeo, #zone

Instance Method Summary collapse

Methods included from Utils

#amount_xml, #ubl_ext

Methods inherited from Model

#initialize, #to_hash

Constructor Details

This class inherits a constructor from SunatInvoice::Model

Instance Attribute Details

#cert_fileObject

certificate file path



20
21
22
# File 'lib/sunat_invoice/provider.rb', line 20

def cert_file
  @cert_file
end

#pk_fileObject

public key file path



17
18
19
# File 'lib/sunat_invoice/provider.rb', line 17

def pk_file
  @pk_file
end

#signature_idObject

signature identification



11
12
13
# File 'lib/sunat_invoice/provider.rb', line 11

def signature_id
  @signature_id
end

#signature_location_idObject

Id for signature element in xml document



14
15
16
# File 'lib/sunat_invoice/provider.rb', line 14

def signature_location_id
  @signature_location_id
end

Instance Method Details

#info(xml, with_address = true) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/sunat_invoice/provider.rb', line 22

def info(xml, with_address = true)
  xml['cac'].AccountingSupplierParty do
    xml['cbc'].CustomerAssignedAccountID ruc
    xml['cbc'].AdditionalAccountID document_type
    build_party_xml(xml, with_address)
  end
end