![]() | enajenaciondeacciones10 (Clase) |
Espacio de nombres: EasyOne.Retenciones.Complemento
public class enajenaciondeacciones10
El tipo enajenaciondeacciones10 expone a los siguientes miembros.
Nombre | Descripción | |
---|---|---|
![]() ![]() | EasyOne_enajenaciondeacciones10_Create |
Construye el objeto enajenaciondeacciones10
|
![]() ![]() | EasyOne_enajenaciondeacciones10_Free |
Libera los recursos usados por este objeto
|
![]() ![]() | EasyOne_enajenaciondeacciones10_SetEnajenaciondeAcciones |
Complemento para expresar la enajenación de acciones u operaciones de valores (incluye ganancia o pérdida).
|
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace Consola.EasyOne { class ConsolaEasyOne { #region wrappers easyone [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern int EasyOne_FirmaComprobante(int p, string csd, string key, string pwd); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern string EasyOne_LeeResultado(int p, int valor); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_SetInvoiceOneFachadaInfoPrueba(int p, string AgenteId, string SoftwareId); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_AddComplemento(int p, int pComp); #endregion #region wrappers retenciones10 [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern int EasyOne_retenciones10_Create(string outFile); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_SetRetenciones(int p, string FolioInt, string FechaExp, string CveRetenc, string DescRetenc); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_SetEmisor(int p, string RFCEmisor, string NomDenRazSocE, string CURPE); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_SetReceptor(int p, string Nacionalidad); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_SetNacional(int p, string RFCRecep, string NomDenRazSocR, string CURPR); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_SetExtranjero(int p, string NumRegIdTrib, string NomDenRazSocR); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_SetPeriodo(int p, string MesIni, string MesFin, string Ejerc); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_SetTotales(int p, string montoTotOperacion, string montoTotGrav, string montoTotExent, string montoTotRet); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_AddImpRetenidos(int p, string BaseRet, string Impuesto, string montoRet, string TipoPagoRet); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_retenciones10_Free(int p); #endregion #region wrappers Enajenacion de Acciones [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern int EasyOne_enajenaciondeacciones10_Create(); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_enajenaciondeacciones10_SetEnajenaciondeAcciones(int p, string ContratoIntermediacion, string Ganancia, string Perdida); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_enajenaciondeacciones10_Free(int p); #endregion static void Main(string[] args) { try { GeneraCFDI32(); } catch (Exception ex) { Console.WriteLine(ex); } } public static void GeneraCFDI32() { //Iniciamos creando el objeto retenciones10 e indicamos el nombre del archivo de salida "Ejemplo.xml" int p = EasyOne_retenciones10_Create("Ejemplo.xml"); //Llenamos la sección del comprobante EasyOne_retenciones10_SetRetenciones(p, "FolioInt0", "2017-05-04T18:13:51-06:00", "01", "DescRetenc0"); //Llenamos la sección del emisor EasyOne_retenciones10_SetEmisor(p, "AAA010101AAA", "NomDenRazSocE0", "CURP890101HCSRRV08"); //Llenamos la sección del receptor EasyOne_retenciones10_SetReceptor(p, "Nacional"); //Llenamos la sección del extranjero EasyOne_retenciones10_SetExtranjero(p, "NumRegIdTrib0", "NomDenRazSocR0"); //Llenamos la sección del periodo EasyOne_retenciones10_SetPeriodo(p, "6", "6", "2014"); //Llenamos la sección de totales EasyOne_retenciones10_SetTotales(p, "0.000000", "0.000000", "0.000000", "0.000000"); EasyOne_retenciones10_AddImpRetenidos(p, "0.000000", "01", "0.000000", "Pago definitivo"); EasyOne_retenciones10_AddImpRetenidos(p, "0.000000", "01", "0.000000", "Pago definitivo"); //Complemento Enajenacion de Acciones //Iniciamos creando el objeto enajenaciondeacciones10 int ea = EasyOne_enajenaciondeacciones10_Create(); EasyOne_enajenaciondeacciones10_SetEnajenaciondeAcciones(ea, "ContratoIntermediacion0", "0.000000", "0.000000"); EasyOne_AddComplemento(p, ea); //Enviamos el CFDI al metodo de PRUEBAS //En la siguiente línea es necesario incluir la Clave de Integración que se proporciona en la Guía de Implementación (Menú "Ayuda" de su Oficina Virtual). EasyOne_SetInvoiceOneFachadaInfoPrueba(p, "USAR_CLAVE_DE_INTEGRACION", "USAR_CLAVE_DE_INTEGRACION"); //Para enviar el CFDI a PRODUCCION se debe quitar la linea de arriba y usar la siguiente linea descomentada. //En la siguiente línea es necesario incluir la Clave de Integración que se proporciona en la Guía de Implementación (Menú "Ayuda" de su Oficina Virtual). //EasyOne_SetInvoiceOneFachadaInfo(p, "USAR_CLAVE_DE_INTEGRACION", "USAR_CLAVE_DE_INTEGRACION"); //En la siguiente línea se deben colocar los nombres de los archivos de certificado de sellos del Emisor. //Para fines de esta prueba se usarán los certificados de sellos del Emisor AAA010101AAA. //Favor de colocar estos archivos (.CER y .KEY) en la misma carpeta donde se encuentra la aplicación. int i = EasyOne_FirmaComprobante(p, "CSD01_AAA010101AAA.cer", "CSD01_AAA010101AAA.key", "12345678a"); //Si el resultado es 0 = El CFDI se procesó correctamente if (i == 0) { string resultadoXML = String.Empty; //Obtenemos el XML completo y timbrado Console.WriteLine(resultadoXML = EasyOne_LeeResultado(p, 8)); } else { //En caso de error mostrar el detalle. Console.WriteLine(EasyOne_LeeResultado(p, 11)); } Console.ReadLine(); } } }