![]() | decreto10 (Clase) |
Espacio de nombres: EasyOne.Comprobante.Complemento
public class decreto10
El tipo decreto10 expone a los siguientes miembros.
Nombre | Descripción | |
---|---|---|
![]() ![]() | EasyOne_decreto10_AddVehiculosUsadosEnajenadoPermAlFab |
Datos del vehículo o vehículos usados que enajena el permisionario a cuenta del precio del vehículo nuevo o seminuevo (pueden enajenarse 1 o más vehículos, por lo que de ser 2 o más se deberán llenar tantos elementos como vehículos usados se enajenen).
|
![]() ![]() | EasyOne_decreto10_Create |
Construye el objeto decreto10
|
![]() ![]() | EasyOne_decreto10_Free |
Libera los recursos usados por este objeto
|
![]() ![]() | EasyOne_decreto10_SetDecretoRenovVehicular |
Nodo opcional para expresar los datos aplicables al estimulo por la aplicación del Decreto por el que se fomenta la renovación del parque vehicular del autotransporte.
|
![]() ![]() | EasyOne_decreto10_SetDecretoSustitVehicular |
Nodo opcional para expresar los datos aplicables al estimulo por la aplicación del Decreto por el que se otorgan medidas para la sustitución de vehículos de autotransporte de pasaje y carga.
|
![]() ![]() | EasyOne_decreto10_SetDecretoSustitVehicularVehiculoNuvoSemEnajenadoFabAlPerm |
Datos del vehículo nuevo o seminuevo que enajena el fabricante, ensamblador o distribuidor autorizado al permisionario.
|
![]() ![]() | EasyOne_decreto10_Setrenovacionysustitucionvehiculos |
Complemento para incorporar la información relativa a los estímulos por la renovación del parque vehicular del autotransporte y por el que se otorgan medidas para la sustitución de vehículos de autotransporte de pasaje y carga.
|
![]() ![]() | EasyOne_decreto10_SetVehiculoNuvoSemEnajenadoFabAlPerm |
Datos del vehículo nuevo o seminuevo que enajena el fabricante, ensamblador o distribuidor autorizado al permisionario.
|
![]() ![]() | EasyOne_decreto10_SetVehiculoUsadoEnajenadoPermAlFab |
Datos del vehículo usado que enajena el permisionario a cuenta del precio del vehículo nuevo o seminuevo.
|
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 cfd32 [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 int EasyOne_cfdi32_Create(string outFile); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetComprobante(int p, string serie, string folio, string fecha, string formaDePago, string condicionesDePago, string subTotal, string descuento, string motivoDescuento, string TipoCambio, string Moneda, string total, string tipoDeComprobante, string metodoDePago, string LugarExpedicion, string NumCtaPago, string FolioFiscalOrig, string SerieFolioFiscalOrig, string FechaFolioFiscalOrig, string MontoFolioFiscalOrig); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetEmisor(int p, string rfc, string nombre); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetEmisorDomicilioFiscal(int p, string calle, string noExterior, string noInterior, string colonia, string localidad, string referencia, string municipio, string estado, string pais, string codigoPostal); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetEmisorExpedidoEn(int p, string calle, string noExterior, string noInterior, string colonia, string localidad, string referencia, string municipio, string estado, string pais, string codigoPostal); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_AddRegimenFiscal(int p, string Regimen); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetReceptor(int p, string rfc, string nombre); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetReceptorDomicilio(int p, string calle, string noExterior, string noInterior, string colonia, string localidad, string referencia, string municipio, string estado, string pais, string codigoPostal); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_AddConcepto(int p, string cantidad, string unidad, string noIdentificacion, string descripcion, string valorUnitario, string importe); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_AddInformacionAduanera(int p, string numero, string fecha, string aduana); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetCuentaPredial(int p, string numero); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_AddParte(int p, string cantidad, string unidad, string noIdentificacion, string descripcion, string valorUnitario, string importe); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_AddParteInformacionAduanera(int p, string numero, string fecha, string aduana); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_SetImpuestos(int p, string totalImpuestosRetenidos, string totalImpuestosTrasladados); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_AddRetencion(int p, string impuesto, string importe); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_AddTraslado(int p, string impuesto, string tasa, string importe); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_cfdi32_Free(int p); [DllImport(@"EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_AddComplemento(int p, int pComp); #endregion #region wrappers renovacionysustitucionvehiculos [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern int EasyOne_decreto10_Create(); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_Setrenovacionysustitucionvehiculos(int p, string TipoDeDecreto); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_SetDecretoRenovVehicular(int p, string VehEnaj); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_AddVehiculosUsadosEnajenadoPermAlFab(int p, string PrecioVehUsado, string TipoVeh, string Marca, string TipooClase, string Año, string Modelo, string NIV, string NumSerie, string NumPlacas, string NumMotor, string NumFolTarjCir, string NumPedIm, string Aduana, string FechaRegulVeh, string Foliofiscal); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_SetVehiculoNuvoSemEnajenadoFabAlPerm(int p, string Año, string Modelo, string NumPlacas, string RFC); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_SetDecretoSustitVehicular(int p, string VehEnaj); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_SetVehiculoUsadoEnajenadoPermAlFab(int p, string PrecioVehUsado, string TipoVeh, string Marca, string TipooClase, string Año, string Modelo, string NIV, string NumSerie, string NumPlacas, string NumMotor, string NumFolTarjCir, string NumFolAvisoint, string NumPedIm, string Aduana, string FechaRegulVeh, string Foliofiscal); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_SetDecretoSustitVehicularVehiculoNuvoSemEnajenadoFabAlPerm(int p, string Año, string Modelo, string NumPlacas, string RFC); [DllImport("EasyOne.DLL", CallingConvention = CallingConvention.Cdecl)] static public extern void EasyOne_decreto10_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 cfdi3.2 e indicamos el nombre del archivo de salida "Ejemplo.xml" int p = EasyOne_cfdi32_Create("Ejemplo.xml"); //Llenamos la sección del comprobante EasyOne_cfdi32_SetComprobante(p, "serie0", "folio0", "2017-01-27T10:13:51", "formaDePago0", "condicionesDePago0", "0.000000", "0.000000", "motivoDescuento0", "TipoCambio0", "Moneda0", "0.000000", "ingreso", "metodoDePago0", "LugarExpedicion0", "NumCtaPago0", "FolioFiscalOrig0", "SerieFolioFiscalOrig0", "2006-05-04T18:13:51.0", "0.000000"); //Llenamos la sección del Emisor EasyOne_cfdi32_SetEmisor(p, "AAA010101AAA", "nombre0"); //Llenamos la sección del Domicilio Fiscal del Emisor EasyOne_cfdi32_SetEmisorDomicilioFiscal(p, "calle0", "noExterior0", "noInterior0", "colonia0", "localidad0", "referencia0", "municipio0", "estado0", "pais0", "codig"); //Llenamos la sección del Expedido en del Emisor EasyOne_cfdi32_SetEmisorExpedidoEn(p, "calle1", "noExterior1", "noInterior1", "colonia1", "localidad1", "referencia1", "municipio1", "estado1", "pais1", "codigoPostal2"); //Agregamos un Regimen fiscal del Emisor EasyOne_cfdi32_AddRegimenFiscal(p, "Regimen0"); //Llenamos la sección del Receptor EasyOne_cfdi32_SetReceptor(p, "AAA010101AAA", "nombre1"); //Llenamos la sección del domicilio fiscal del Receptor EasyOne_cfdi32_SetReceptorDomicilio(p, "calle2", "noExterior2", "noInterior2", "colonia2", "localidad2", "referencia2", "municipio2", "estado2", "pais2", "codigoPostal3"); //Agregamos los concepto EasyOne_cfdi32_AddConcepto(p, "0", "unidad0", "noIdentificacion0", "descripcion0", "0.000000", "0.000000"); EasyOne_cfdi32_SetCuentaPredial(p, "numero0"); //Agregamos los Impuestos EasyOne_cfdi32_SetImpuestos(p, "0.000000", "0.000000"); EasyOne_cfdi32_AddRetencion(p, "ISR", "0.000000"); EasyOne_cfdi32_AddTraslado(p, "IVA", "0.000000", "0.000000"); //Creamos el objeto del Complemento RenovacionYSustitucionVehiculos int dec = EasyOne_decreto10_Create(); //Llenamos la seccion renovacionysustitucionvehiculos EasyOne_decreto10_Setrenovacionysustitucionvehiculos(dec, "01"); //Llenamos la seccion DecretoRenovVehicular EasyOne_decreto10_SetDecretoRenovVehicular(dec, "01"); EasyOne_decreto10_AddVehiculosUsadosEnajenadoPermAlFab(dec, "0.000000", "01", "Marca0", "TipooClase0", "2016", "Modelo0", "NIV0", "NumSerie0", "NumPlacas0", "NumMotor0", "NumFolTarjCir0", "NumPedIm0", "Aduana0", "2006-05-04", "Foliofiscal0"); EasyOne_decreto10_SetVehiculoNuvoSemEnajenadoFabAlPerm(dec, "2016", "Modelo1", "NumPlacas1", "AAA010101AAA"); //Llenamos la seccion DecretoSustitVehicular EasyOne_decreto10_SetDecretoSustitVehicular(dec, "01"); EasyOne_decreto10_SetVehiculoUsadoEnajenadoPermAlFab(dec, "0.000000", "01", "Marca1", "TipooClase1", "2016", "Modelo2", "NIV1", "NumSerie1", "NumPlacas2", "NumMotor1", "NumFolTarjCir1", "NumFolAvisoint0", "NumPedIm1", "Aduana1", "2006-05-04", "Foliofiscal1"); EasyOne_decreto10_SetDecretoSustitVehicularVehiculoNuvoSemEnajenadoFabAlPerm(dec, "2016", "Modelo3", "NumPlacas3", "AAA010101AAA"); //Añadimos Complemento al CFDI EasyOne_AddComplemento(p, dec); //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(); } } }