Class: DtefacilXmlBuilder::TestDocuments

Inherits:
Object
  • Object
show all
Defined in:
lib/dtefacil_xml_builder/test_documents.rb

Instance Method Summary collapse

Instance Method Details

#read_collectionObject



18
19
20
21
22
# File 'lib/dtefacil_xml_builder/test_documents.rb', line 18

def read_collection
	response = RestClient.get "https://ptoTicket:[email protected]/1.2/documentos"
	reader = DteReader.new
	reader.collection= response.body
end

#read_dteObject



12
13
14
15
16
# File 'lib/dtefacil_xml_builder/test_documents.rb', line 12

def read_dte
	response = RestClient.get "https://acid:[email protected]/1.2/documentos/d3g3zty5qybgx3e5dcqls22iuwy"
	reader = DteReader.new
	reader.dte= response.body
end

#set_factura_electronica_with_hashObject



4
5
6
7
8
9
10
# File 'lib/dtefacil_xml_builder/test_documents.rb', line 4

def set_factura_electronica_with_hash
	receptor = { :rut => "15842089-9", :razon_social => "Vladimir", :giro => "Computacion", :direccion => "Alameda", :comuna => "Santiago", :ciudad => "Satiago" }
	detalles = [{:nombre => "Pelota", :cantidad => 3, :precio_unitario => 45}] 
	f = FacturaElectronica.new
	f.set_invoice [324], receptor, detalles
	f.render_xml
end