diff --git a/src/SW-Tools-Net/Resources/Xslt/Cfdi40/CartaPorte31.xslt b/src/SW-Tools-Net/Resources/Xslt/Cfdi40/CartaPorte31.xslt new file mode 100644 index 0000000..51a15a7 --- /dev/null +++ b/src/SW-Tools-Net/Resources/Xslt/Cfdi40/CartaPorte31.xslt @@ -0,0 +1,762 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/SW-Tools-Net/Resources/Xslt/Cfdi40/cfdi40.xslt b/src/SW-Tools-Net/Resources/Xslt/Cfdi40/cfdi40.xslt index 6ee318c..07cba80 100644 --- a/src/SW-Tools-Net/Resources/Xslt/Cfdi40/cfdi40.xslt +++ b/src/SW-Tools-Net/Resources/Xslt/Cfdi40/cfdi40.xslt @@ -1,5 +1,5 @@ - + @@ -41,6 +41,7 @@ + ||| diff --git a/src/SW-Tools-Net/SW.Tools.csproj b/src/SW-Tools-Net/SW.Tools.csproj index e23b8f2..a859eb9 100644 --- a/src/SW-Tools-Net/SW.Tools.csproj +++ b/src/SW-Tools-Net/SW.Tools.csproj @@ -3,7 +3,7 @@ net6.0;net7.0 SW.Tools enable - 0.0.7.1 + 0.0.8.1 SW.Tools.NET SW Sapien SW_Aeyrton @@ -12,6 +12,7 @@ + @@ -60,6 +61,7 @@ + diff --git a/test/SW-Tools-Net-UnitTest/Resources/Xml/ut_cp31.xml b/test/SW-Tools-Net-UnitTest/Resources/Xml/ut_cp31.xml new file mode 100644 index 0000000..73b3078 --- /dev/null +++ b/test/SW-Tools-Net-UnitTest/Resources/Xml/ut_cp31.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/SW-Tools-Net-UnitTest/SW.Tools.UnitTest.csproj b/test/SW-Tools-Net-UnitTest/SW.Tools.UnitTest.csproj index eadcbfe..b267534 100644 --- a/test/SW-Tools-Net-UnitTest/SW.Tools.UnitTest.csproj +++ b/test/SW-Tools-Net-UnitTest/SW.Tools.UnitTest.csproj @@ -1,4 +1,4 @@ - + net6.0;net7.0 @@ -62,6 +62,9 @@ Always + + Always + Always diff --git a/test/SW-Tools-Net-UnitTest/SignTest.cs b/test/SW-Tools-Net-UnitTest/SignTest.cs index 058db5a..90672fe 100644 --- a/test/SW-Tools-Net-UnitTest/SignTest.cs +++ b/test/SW-Tools-Net-UnitTest/SignTest.cs @@ -23,16 +23,27 @@ public void Sign_Cfdi40_Success() CustomAssert.ResultIsSuccess(result); Assert.True(!String.IsNullOrEmpty(result.Data.Xml)); CustomAssert.StampIsSuccess(_stamp, result.Data.Xml); - } + } + [Fact(Skip = "Carta Porte 3.0 no vigente")] + public void Sign_Cfdi40WithComplement_Success_Old() + { + var result = _sign.SignCfdi(ResourceHelper.GetInvoice("cp30.xml"), + ResourceHelper.GetCertResource("pfx_h&e951128469.pfx"), _password); + CustomAssert.ResultIsSuccess(result); + Assert.True(!String.IsNullOrEmpty(result.Data.Xml)); + CustomAssert.StampIsSuccess(_stamp, result.Data.Xml); + } + [Fact] public void Sign_Cfdi40WithComplement_Success() { - var result = _sign.SignCfdi(ResourceHelper.GetInvoice("cp30.xml"), + var result = _sign.SignCfdi(ResourceHelper.GetInvoice("cp31.xml"), ResourceHelper.GetCertResource("pfx_h&e951128469.pfx"), _password); CustomAssert.ResultIsSuccess(result); Assert.True(!String.IsNullOrEmpty(result.Data.Xml)); CustomAssert.StampIsSuccess(_stamp, result.Data.Xml); } + [Fact] public void Sign_Retention20_Success() { @@ -77,7 +88,7 @@ public void Sign_InvalidPassword_Error() ResourceHelper.GetCertResource("pfx_h&e951128469.pfx"), "password"); CustomAssert.ResultIsError(result); } - [Fact(Skip = "TipoCambioUSD changes every day")] + [Fact(Skip = "TipoCambioUSD cambia todos los dias")] public void Sign_Cfdi40WithComplementCCE20_Success() { var result = _sign.SignCfdi(ResourceHelper.GetInvoice("cce20.xml"),