How to know the status of a document pending settlement in the api?

1

I needed to know, what is the status of a pending API document. We imagine that I am making a settlement of an invoice that is pending, and this invoice could be for example in the state "PEN" (Pending) or in the State "PR" (Interim), I to make the settlement in the API precise to know the state , how can I get the state of this invoice in the API (in this case if it would be "PEN" or "PR")?

    
asked by anonymous 18.05.2018 / 18:39

3 answers

1

What you want to do is have a listing of documents that are in the "PEN" state, and then settle. For this you can execute a query on the database.

SELECT TipoEntidade, Entidade,TipoDoc, NumDoc, NumDocInt FROM Pendentes
WHERE Modulo ='V' AND tipoconta ='CCC' AND Estado ='PEN'
    
18.05.2018 / 19:01
0

Another alternative is to use the System API, although it is more complex.

Private Sub DaLiquidacao()

Dim objParam As New GcpBEParamsCCTListaPendentes
Dim objCE As New GcpBEContaEstDoc

objParam.TipoDocLiq = "RE"
objParam.TipoEntidade = "C"
objParam.MoedaLiq = "EUR"
objParam.ExcluirEstornados = False
objParam.DataDocInicial = "01-01-2107"
objParam.DataDocFinal = "01-07-2018"
objParam.DataDocLiq = "01-05-2018"

objCE.Conta = "CCC"
objCE.Estado = "PEN"
objCE.Modulo = "V"
objCE.TipoDoc = "FA"


objParam.ContaEstados.Insere objCE

Set olist = BSO.Comercial.Liquidacoes.ListaPendentes(objParam)

End Sub
    
18.05.2018 / 19:31
0

I was able to solve the problem, here I leave the solution if someone has the same problem:

Interop.GcpBE900.GcpBEPendente pend = null;
pend = PrimaveraApp.Comercial.Pendentes.Edita(ref Filial, ref Modulo, ref TipoDocOrig, ref SerieDocOrig, ref NumDocOrig);
Estado = pend.get_Estado();
NumTransferencia = pend.get_NumTransferencia();
NumPrestacao = pend.get_NumPrestacao();

Thanks for the help, because it helped me to figure out what to do.

    
04.06.2018 / 18:13