Skip to content

Commit

Permalink
Merge pull request #108 from AndresRamos/agrega-ejemplo-de-como-relac…
Browse files Browse the repository at this point in the history
…ionar-documentos-cfdi

docs: Agrega ejemplo de como relacionar documentos cfdi
  • Loading branch information
AndresRamos authored Dec 16, 2023
2 parents f185d9c + 38e8488 commit 6978ddd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/Sdk.Extras.ConsoleApp/DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static IServiceCollection AddEjemplos(this IServiceCollection serviceColl
serviceCollection.AddTransient<DesbloquearDocumento>();
serviceCollection.AddTransient<EliminarDocumento>();
serviceCollection.AddTransient<GenerarDocumentoDigitalDocumento>();
serviceCollection.AddTransient<RelacionarDocumento>();
serviceCollection.AddTransient<SaldarDocumento>();
serviceCollection.AddTransient<TimbrarDocumento>();

Expand Down
29 changes: 29 additions & 0 deletions samples/Sdk.Extras.ConsoleApp/Documentos/RelacionarDocumento.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using ARSoftware.Contpaqi.Comercial.Sdk.DatosAbstractos;
using ARSoftware.Contpaqi.Comercial.Sdk.Extras.Interfaces;

namespace Sdk.Extras.ConsoleApp;

public sealed class RelacionarDocumento
{
private readonly IDocumentoService _documentoService;

public RelacionarDocumento(IDocumentoService documentoService)
{
_documentoService = documentoService;
}

public void RelacionPorLlave()
{
var documento = new tLlaveDoc { aCodConcepto = "PRUEBAFACTURA", aSerie = "PRUEBA", aFolio = 1 };
var documentoARelacionar = new tLlaveDoc { aCodConcepto = "PRUEBAFACTURA", aSerie = "PRUEBA", aFolio = 2 };

_documentoService.RelacionarDocumentos(documento, "01", documentoARelacionar);
}

public void RelacionPorUuid()
{
var documento = new tLlaveDoc { aCodConcepto = "PRUEBAFACTURA", aSerie = "PRUEBA", aFolio = 1 };

_documentoService.RelacionarDocumentos(documento, "03", "51F58A42-3827-49A3-A1E5-54CADF80F9C6");
}
}

0 comments on commit 6978ddd

Please sign in to comment.