Last active
July 12, 2022 14:25
-
-
Save matezito/da26903d74bb614ab61938497158c2f2 to your computer and use it in GitHub Desktop.
Factura E Facturante
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$client = new SoapClient("http://testing.facturante.com/api/comprobantes.svc?wsdl"); | |
$auth = array( | |
"Empresa" => 1111, | |
"Hash" => "hashdefacturante", | |
"Usuario" => "[email protected]" | |
); | |
$cliente = array( | |
"RazonSocial" => "Juan Perez", | |
"TipoDocumento" => 16, | |
"NroDocumento" => "28809634", | |
"DireccionFiscal" => "Calle 1234", | |
"CodigoPostal" => "7600", | |
"PercibeIVA" => false, | |
"PercibeIIBB" => false, | |
"TratamientoImpositivo" => 3, | |
"CondicionPago" => 1, | |
"EnviarComprobante" => true, | |
"MailFacturacion" => "[email protected]", | |
"MailContacto" => "[email protected]", | |
"Contacto" => "Juan Perez", | |
"Telefono" => "5521111" | |
); | |
$encabezado = array( | |
"FechaHora" => date('Y-m-d\TH:i:s'), | |
"Prefijo" => "00099", | |
"TipoComprobante" => "FE", | |
"TotalNeto" => 664.46, | |
"TotalConDescuento" => 0, | |
"PercepcionIVA" => 0, | |
"PercepcionIIBB" => 0, | |
"Total" => 804, | |
"Bienes" => 2, | |
"EnviarComprobante" => true, | |
'FechaServDesde' => date('Y-m-d\TH:i:s'), | |
'FechaServHasta' => date('Y-m-d\TH:i:s', strtotime(date('Y-m-d\TH:i:s') . ' + 30 days')), | |
'FechaVtoPago' => date('Y-m-d\TH:i:s'), | |
"SubTotal" => 664.46, | |
"ImporteImpuestosInternos" => 0, | |
"ImportePercepcionesMunic" => 0, | |
"Moneda" => 3, | |
"TipoDeCambio" => 1, | |
"CondicionVenta" => 1, | |
"SubTotalNoAlcanzado" => 0, | |
"SubTotalExcento" => 0, | |
"PorcentajeIIBB" => 0, | |
); | |
$encabezadoe = array( | |
"CodPais" => "221", //paraguay | |
"CuitPais" => "50000000024", //persona fisica | |
); | |
//item 1 | |
$ComprobanteItem_1 = array( | |
"Cantidad" => 1, | |
"Detalle" => "Producto Uno", | |
"Codigo" => "CODPROD", | |
"IVA" => 21, | |
"PrecioUnitario" => 100, | |
"Total" => 121, | |
"Gravado" => true, | |
"Bonificacion" => 0 | |
); | |
//item 2 | |
$ComprobanteItem_2 = array( | |
"Cantidad" => 1, | |
"Detalle" => "Producto Dos", | |
"Codigo" => "CODPROD2", | |
"IVA" => 21, | |
"PrecioUnitario" => 164.46, | |
"Total" => 199, | |
"Gravado" => true, | |
"Bonificacion" => 0 | |
); | |
//item 3 | |
$ComprobanteItem_3 = array( | |
"Cantidad" => 2, | |
"Detalle" => "Producto Tres", | |
"Codigo" => "CODPROD3", | |
"IVA" => 21, | |
"PrecioUnitario" => 200, | |
"Total" => 484, | |
"Gravado" => true, | |
"Bonificacion" => 0 | |
); | |
//Listado de items | |
$items = array( | |
$ComprobanteItem_1, | |
$ComprobanteItem_2, | |
$ComprobanteItem_3 | |
); | |
//Parametros | |
$param = array( | |
"Autenticacion" => $auth, | |
"Cliente" => $cliente, | |
"Encabezado" => $encabezado, | |
"EncabezadoE" => $encabezadoe, | |
"Items" => $items | |
); | |
//Request | |
$request = array("request" => $param); | |
//Response | |
$reponse = $client->CrearComprobanteFull($request); | |
print "<pre>"; | |
print_r($reponse); | |
print "</pre>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment