meta data de esta página
Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
enviarfactura [2025/05/19 13:28] 217.182.134.106 se ha restaurado la vieja versión (2024/12/05 12:49) |
enviarfactura [2025/05/19 15:40] (actual) 62.84.180.29 se ha restaurado la vieja versión (2024/04/04 09:46) |
||
---|---|---|---|
Línea 1: | Línea 1: | ||
====== Método EnviarFactura() ====== | ====== Método EnviarFactura() ====== | ||
+ | |||
[[manual_de_integracion_obj|{{ : | [[manual_de_integracion_obj|{{ : | ||
El request del método es el siguiente: | El request del método es el siguiente: | ||
+ | |||
+ | | Request: Parámetro a enviar ||| | ||
+ | ^ **Tipo** ^ **Identificador** ^ **Descripción** ^ | ||
+ | | String | RUC | Proporcionado por el cliente. | | ||
+ | | String | Usuario | Proporcionado por The Factory HKA. | | ||
+ | | String | Password | Proporcionado por The Factory HKA. | | ||
+ | | Object | Documento | xml siguiente | ||
+ | |||
+ | ---- | ||
+ | |||
+ | == OBJETO EJEMPLO == | ||
+ | |||
+ | (Solo rellenar los nodos que consideren necesarios y que apliquen para su modelo de Factura) | ||
<code xml> | <code xml> | ||
Línea 19: | Línea 33: | ||
< | < | ||
< | < | ||
- | < | ||
- | < | ||
< | < | ||
< | < | ||
Línea 30: | Línea 42: | ||
< | < | ||
</ | </ | ||
+ | < | ||
</ | </ | ||
< | < | ||
Línea 364: | Línea 377: | ||
</ | </ | ||
</ | </ | ||
- | |||
---- | ---- | ||
+ | === Proceso para consumo EnviarFactura === | ||
+ | * Se inicializa un objeto ServiceClient o Servicio | ||
+ | * Se inicializa un objeto PeticionFactura donde se ingresan el RUC, el usuario de Integración ,clave de Integración y Documento | ||
+ | * Se hace consumo del método EnviarFactura contenido en el objeto serviceClient y se coloca como parámetro la petición anterior, la respuesta estará contenida en un objeto llamado RepuestaPeticion, | ||
+ | |||
+ | <code csharp Codigo Ejemplo .NET> | ||
+ | try | ||
+ | { | ||
+ | | ||
+ | servicio.Endpoint.Address = new System.ServiceModel.EndpointAddress(Url()); | ||
+ | PeticionFactura pet = new PeticionFactura(); | ||
+ | Factura fact = new Factura(); // Creamos una factura | ||
+ | |||
+ | | ||
+ | // | ||
+ | InfoTributaria infotrib = new InfoTributaria(); | ||
+ | fact.InfoTributaria = InformacionTrib(); | ||
+ | pet.Documento = fact; | ||
+ | fact.Version = textBox20.Text; | ||
+ | fact.CorreoNotificar = textBox76.Text; | ||
+ | fact.Notificar = " | ||
+ | fact.DirCliente = " | ||
+ | |||
+ | // | ||
+ | InfoFactura infoFactura = new InfoFactura(); | ||
+ | fact.InfoFactura = infoFactura; | ||
+ | infoFactura.FechaEmision = textBox1.Text; | ||
+ | infoFactura.DirEstablecimiento = textBox2.Text; | ||
+ | infoFactura.ContribuyenteEspecial = textBox3.Text; | ||
+ | infoFactura.ObligadoContabilidad = textBox4.Text; | ||
+ | infoFactura.TipoIdentificacionComprador = textBox5.Text; | ||
+ | infoFactura.RazonSocialComprador = textBox6.Text; | ||
+ | infoFactura.IdentificacionComprador = textBox7.Text; | ||
+ | infoFactura.DireccionComprador = textBox8.Text; | ||
+ | infoFactura.TotalSinImpuestos = textBox9.Text; | ||
+ | infoFactura.ImporteTotal = textBox10.Text; | ||
+ | infoFactura.TotalImpuestoReembolso = textBox34.Text; | ||
+ | infoFactura.TotalConImpuestos = new List< | ||
+ | infoFactura.TotalConImpuestos.Add(TotImp()); | ||
+ | infoFactura.TotalDescuento = " | ||
+ | infoFactura.Moneda = " | ||
+ | infoFactura.TotalSubsidio = " | ||
+ | | ||
+ | | ||
+ | // | ||
+ | |||
+ | fact.Detalles = new List< | ||
+ | DetalleFactura det = new DetalleFactura() | ||
+ | { | ||
+ | |||
+ | CodigoPrincipal = textBox67.Text, | ||
+ | CodigoAuxiliar = textBox68.Text, | ||
+ | Descripcion = textBox69.Text, | ||
+ | Cantidad = textBox70.Text, | ||
+ | PrecioUnitario = textBox71.Text, | ||
+ | UnidadMedida = textBox72.Text, | ||
+ | Descuento = textBox73.Text, | ||
+ | PrecioSinSubsidio = textBox74.Text, | ||
+ | PrecioTotalSinImpuesto = textBox75.Text | ||
+ | |||
+ | |||
+ | }; | ||
+ | |||
+ | det.Impuestos = new List< | ||
+ | det.Impuestos.Add(ImpuestDet()); | ||
+ | | ||
+ | det.DetAdicional = new List< | ||
+ | DetAdicional detAd = new DetAdicional | ||
+ | { | ||
+ | Nombre = " | ||
+ | Valor = " | ||
+ | }; | ||
+ | det.DetAdicional.Add(detAd); | ||
+ | |||
+ | fact.Detalles.Add(det); | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | // | ||
+ | Pago pago = new Pago | ||
+ | { | ||
+ | FormaPago = textBox63.Text, | ||
+ | Total = textBox64.Text, | ||
+ | Plazo = textBox65.Text, | ||
+ | UnidadTiempo = textBox66.Text | ||
+ | |||
+ | }; | ||
+ | |||
+ | fact.InfoFactura.Pagos = new List< | ||
+ | fact.InfoFactura.Pagos.Add(pago); | ||
+ | fact.InfoFactura.TotalConImpuestos = new List< | ||
+ | fact.InfoFactura.TotalConImpuestos.Add(TotImp()); | ||
+ | | ||
+ | | ||
+ | | ||
+ | // | ||
+ | |||
+ | pet.Clave = " | ||
+ | pet.RUC = " | ||
+ | pet.Usuario = " | ||
+ | RepuestaPeticion resp = servicio.EnviarFactura(pet); | ||
+ | servicio.Close(); | ||
+ | |||
+ | | ||
+ | |||
+ | richTextBox1.Text = resp.Mensaje + " | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | } | ||
+ | catch (Exception ex) | ||
+ | { | ||
+ | |||
+ | MessageBox.Show(" | ||
+ | } | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | == ARCHIVOS FACTURA XML/XSD == | ||
+ | |||
+ | En este enlace se encuentran disponibles los xml y xsd de factura en sus distintas versiones | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ---- | ||
- | [[manual_de_integracion_obj|Ir Atrás]] | + | [[manual_de_integracion_obj|{{: |