IsaRoGaMX.Cfdi
1.1.1
dotnet add package IsaRoGaMX.Cfdi --version 1.1.1
NuGet\Install-Package IsaRoGaMX.Cfdi -Version 1.1.1
<PackageReference Include="IsaRoGaMX.Cfdi" Version="1.1.1" />
paket add IsaRoGaMX.Cfdi --version 1.1.1
#r "nuget: IsaRoGaMX.Cfdi, 1.1.1"
// Install IsaRoGaMX.Cfdi as a Cake Addin #addin nuget:?package=IsaRoGaMX.Cfdi&version=1.1.1 // Install IsaRoGaMX.Cfdi as a Cake Tool #tool nuget:?package=IsaRoGaMX.Cfdi&version=1.1.1
IsaRoGaMX.Cfdi
Librería para generar Comprobante Fiscal Digital (CFDI) acorde a la especificación técnica del SAT
Versiones soportadas
- 3.3
- 4.0
Ejemplos
Instanciar Comprobante
CFDI v3.3
IsaRoGaMX.Cfdi.v33.Comprobante cfdi = new IsaRoGaMX.Cfdi.v33.Comprobante();
CFDI v4.0
IsaRoGaMX.Cfdi.v40.Comprobante cfdi = new IsaRoGaMX.Cfdi.v40.Comprobante();
Leer Certificado
CertificadoInfo cerInfo = CsdUtils.LeerCertificado(cerFile);
Sellar Comprobante
cfdi["Sello"] = Utils.GetSelloFiscalDigital(cadenaOriginal, keyFile, csdPassword);
Generar Cadena Original
string cadenaOriginal = XsltTransform.GeneraCadenaOriginal(cfdi.Documento, xsltFile);
Agregar complemento a un Concepto
cfdi.Conceptos[0].AgregaComplemento(institucionesEducativas);
Agrergar complemento al Comprobante
cfdi.AgregaComplemento(leyendaFiscal);
Ejemplo de Cfdi v3.3
// Se lee el certificado
var cerInfo = CsdUtils.LeerCertificado(cerFile);
// Se crea el comprobante
IsaRoGaMX.Cfdi.v33.Comprobante cfdi = new IsaRoGaMX.Cfdi.v33.Comprobante();
// CfdiRelacionados
cfdi.CfdiRelacionados["TipoRelacion"] = "01";
cfdi.CfdiRelacionados[0]["UUID"] = "9FB6ED1A-5F37-4FEF-980A-7F8C83B51894";
// Datos de la Factura
cfdi["Serie"] = "F";
cfdi["Folio"] = "123";
cfdi["Fecha"] = DateTime.Now.ToString("s");
cfdi["Certificado"] = cerInfo.Certificado;
cfdi["NoCertificado"] = cerInfo.NoCertificado;
cfdi["FormaPago"] = "01";
cfdi["CondicionesDePago"] = "En una sola exhibición";
cfdi["SubTotal"] = "123.45";
cfdi["Descuento"] = "0.00";
cfdi["Moneda"] = "MXN";
cfdi["TipoCambio"] = "1.00";
cfdi["Total"] = "123.45";
cfdi["TipoDeComprobante"] = "I";
cfdi["MetodoPago"] = "PUE";
cfdi["LugarExpedicion"] = "01000";
cfdi["Confirmacion"] = "12345";
// Emisor
cfdi.Emisor["Rfc"] = "AAA010101AAA";
cfdi.Emisor["Nombre"] = "ACCEM SERVICIOS EMPRESARIALES SC";
cfdi.Emisor["RegimenFiscal"] = "601";
// Receptor
cfdi.Receptor["Rfc"] = "XAXX010101000";
cfdi.Receptor["Nombre"] = "Público en General";
cfdi.Receptor["UsoCFDI"] = "G01";
// Concpetos con Impuestos
cfdi.Conceptos[1]["ClaveProdServ"] = "01010101";
cfdi.Conceptos[1]["NoIdentificacion"] = "COD02";
cfdi.Conceptos[1]["Cantidad"] = "1.00";
cfdi.Conceptos[1]["ClaveUnidad"] = "C81";
cfdi.Conceptos[1]["Unidad"] = "Pieza";
cfdi.Conceptos[1]["Descripcion"] = "Producto de prueba 2";
cfdi.Conceptos[1]["ValorUnitario"] = "100.00";
cfdi.Conceptos[1].Impuestos.Traslados[0]["Base"] = "1.00";
cfdi.Conceptos[1].Impuestos.Traslados[0]["Impuesto"] = "IVA";
cfdi.Conceptos[1].Impuestos.Traslados[0]["TipoFactor"] = "Tasa";
cfdi.Conceptos[1].Impuestos.Traslados[0]["TasaOCuota"] = "0.000000";
cfdi.Conceptos[1].Impuestos.Traslados[0]["Importe"] = "0.00";
// Impuestos
cfdi.Impuestos["TotalImpuestosRetenidos"] = "0.00";
cfdi.Impuestos["TotalImpuestosTrasladados"] = "16.00";
// Retenciones
cfdi.Impuestos.Retenciones[0]["Impuesto"] = "ISR";
cfdi.Impuestos.Retenciones[0]["Importe"] = "0.00";
// Traslados
cfdi.Impuestos.Traslados[0]["Impuesto"] = "001";
cfdi.Impuestos.Traslados[0]["Importe"] = "16.00";
cfdi.Impuestos.Traslados[0]["TasaOCuota"] = "0.160000";
cfdi.Impuestos.Traslados[0]["TipoFactor"] = "Tasa";
// Genera cadena original
string cadenaOriginal = XsltTransform.GeneraCadenaOriginal(cfdi.Documento, xsltFile);
// Genera sello
cfdi["Sello"] = Utils.GetSelloFiscalDigital(cadenaOriginal, keyFile, csdPassword);
// Se guarda el XML
cfdi.Documento.Save(xmlFile);
Ejemplo de Cfdi v4.0
// Se lee el Certificado
var cerInfo = CsdUtils.LeerCertificado(cerFile);
// Se crea el Comprobante
IsaRoGaMX.Cfdi.v40.Comprobante cfdi = new IsaRoGaMX.Cfdi.v40.Comprobante();
// Datos de la Factura
cfdi["Fecha"] = DateTime.Now.ToString("s");
cfdi["Serie"] = "F";
cfdi["Folio"] = "16";
cfdi["FormaPago"] = "01";
cfdi["SubTotal"] = "10500";
cfdi["Moneda"] = "MXN";
cfdi["Total"] = "123.45";
cfdi["TipoDeComprobante"] = "I";
cfdi["MetodoPago"] = "PUE";
cfdi["LugarExpedicion"] = "03000";
cfdi["Certificado"] = cerInfo.Certificado;
cfdi["NoCertificado"] = cerInfo.NoCertificado;
// Emisor
cfdi.Emisor["Rfc"] = "AAA010101AAA";
cfdi.Emisor["Nombre"] = "ACCEM SERVICIOS EMPRESARIALES";
cfdi.Emisor["RegimenFiscal"] = "601";
// Receptor
cfdi.Receptor["Rfc"] = "XAXX010101000";
cfdi.Receptor["Nombre"] = "Público en General";
cfdi.Receptor["DomicilioFiscalReceptor"] = "03000";
cfdi.Receptor["RegimenFiscalReceptor"] = "616";
cfdi.Receptor["UsoCFDI"] = "S01";
// Concepto con Impuestos
cfdi.Conceptos[0]["ClaveProdServ"] = "70141902";
cfdi.Conceptos[0]["NoIdentificacion"] = "400578";
cfdi.Conceptos[0]["Cantidad"] = "30.000000";
cfdi.Conceptos[0]["ClaveUnidad"] = "EA";
cfdi.Conceptos[0]["Unidad"] = "Caja";
cfdi.Conceptos[0]["Descripcion"] = "Compra de fresas";
cfdi.Conceptos[0]["ValorUnitario"] = "350.00";
cfdi.Conceptos[0]["Importe"] = "10500.00";
cfdi.Conceptos[0]["ObjetoImp"] = "02";
cfdi.Conceptos[0].Impuestos.Traslados[0]["Base"] = "10500.00";
cfdi.Conceptos[0].Impuestos.Traslados[0]["Impuesto"] = "002";
cfdi.Conceptos[0].Impuestos.Traslados[0]["TipoFactor"] = "Tasa";
cfdi.Conceptos[0].Impuestos.Traslados[0]["TasaOCuota"] = "0.160000";
cfdi.Conceptos[0].Impuestos.Traslados[0]["Importe"] = "1680.00";
// Impuestos
cfdi.Impuestos["TotalImpuestosTrasladados"] = "1680.00";
// Traslados
cfdi.Impuestos.Traslados[0]["Base"] = "10500.00";
cfdi.Impuestos.Traslados[0]["Impuesto"] = "002";
cfdi.Impuestos.Traslados[0]["TipoFactor"] = "Tasa";
cfdi.Impuestos.Traslados[0]["TasaOCuota"] = "0.160000";
cfdi.Impuestos.Traslados[0]["Importe"] = "1680.00";
// Genera cadena original
string cadenaOriginal = XsltTransform.GeneraCadenaOriginal(cfdi.Documento, xsltFile);
// Genera sello
cfdi["Sello"] = Utils.GetSelloFiscalDigital(cadenaOriginal, keyFile, csdPassword);
// Se guarda el XML
cfdi.Documento.Save(xmlFile);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net35 is compatible. net40 was computed. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 2.1
- No dependencies.
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 3.5
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on IsaRoGaMX.Cfdi:
Package | Downloads |
---|---|
IsaRoGaMX.Cfdi.LeyendasFiscales
Librería para generar el Complemento de Leyendas Fiscales |
|
IsaRoGaMX.Cfdi.Iedu
Librería para generar el Complemento Concepto Instituciones Educativas |
|
IsaRoGaMX.Cfdi.Aerolineas
Complemento al Comprobante Fiscal Digital a través de Internet (CFDI) para el manejo de datos de Aerolíneas para pasajeros. |
|
IsaRoGaMX.Cfdi.Pagos
Librería para generar el Complemento para Recepción de Pagos |
|
IsaRoGaMX.Cfdi.Nomina
Librería para generar el Complemento de Nómina |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.1 | 240 | 5/9/2024 |
1.1.0-beta2 | 838 | 6/12/2022 |
Se corrigió el error "De acuerdo con el DTD o con el esquema, el atributo 'schemaLocation' tiene un valor no válido"