Good morning,
This code example I'm putting in is to settle documents:
Private Sub liquidaDocumento(sTipoDoc As String, sSerie As String, lNumDoc As Long)
Dim liq As GcpBE900.GcpBEDocumentoLiq
Dim linha As GcpBE900.GcpBELinhaLiq
Dim aux As Object
Dim trans As Boolean
Dim Diario As String
Dim NumDiario As Long
Dim DocLiquidacao As String
Dim DataLiquidacao As Date
trans = False
DocLiquidacao = "TFI"
DataLiquidacao = Me.DocumentoCompra.DataDoc
On Error GoTo sair
Set liq = New GcpBE900.GcpBEDocumentoLiq
liq.Tipodoc = DocLiquidacao
liq.Serie = BSO.Comercial.Series.DaSerieDefeito("M", DocLiquidacao, DataLiquidacao)
liq.DataIntroducao = Date
liq.DataDoc = DataLiquidacao
liq.TipoEntidade = Me.DocumentoCompra.TipoEntidade
liq.Entidade = Me.DocumentoCompra.CamposUtil("CDU_Investigador").valor
liq.TipoConta = "C"
liq.CambioMAlt = 1
liq.CambioMBase = 1
liq.Moeda = Me.DocumentoCompra.Moeda
liq.Cambio = 1
liq.NumDoc = BSO.Comercial.Series.Edita("M", liq.Tipodoc, liq.Serie).Numerador + 1
liq.EstadoBE = "PEN"
liq.ContaBancaria = Conta
liq.Utilizador = BSO.Contexto.UtilizadorActual
BSO.Comercial.Liquidacoes.PreencheDadosRelacionados liq
liq.DataIntroducao = DataLiquidacao 'Date
liq.DataDoc = DataLiquidacao
Dim valor As Double
valor = (-1) * BSO.Comercial.Pendentes.Edita(Me.DocumentoCompra.Filial, "C", Me.DocumentoCompra.Tipodoc, Me.DocumentoCompra.Serie, Me.DocumentoCompra.NumDoc).ValorPendente
BSO.Comercial.Liquidacoes.AdicionaLinha liq, "000", "C", sTipoDoc, sSerie, lNumDoc, 1, "APR", 0, valor, 0
liq.LinhasLiquidacao(liq.LinhasLiquidacao.NumItens).DataDoc = liq.DataDoc
liq.DataDoc = DataLiquidacao
BSO.IniciaTransaccao
trans = True
BSO.Comercial.Liquidacoes.Actualiza liq
If trans = True Then
BSO.TerminaTransaccao
trans = False
End If
MsgBox "LiquidaÁ„o gerada automaticamente." & vbCrLf & liq.Tipodoc & " " & liq.NumDoc & "/" & liq.Serie
Set liq = Nothing
Set linha = Nothing
Set aux = Nothing
Exit Sub
sair:
If trans = True Then
BSO.DesfazTransaccao
trans = False
End If
MsgBox "Erro a criar liquidaÁ„o" & vbCrLf & Err.Description, vbInformation
Set liq = Nothing
Set linha = Nothing
Set aux = Nothing
End Sub
What is intended is to change the entity, because the document that is used in the current accounts, is configured to generate a new pending, in this case it will go from the APR state - In approval to the PEN state - Pending. p>
Can anyone help me?
Thank you for your attention.
Good afternoon, It will be easier to explain the functional process.
The process is as follows:
To perform pending downloads (Account, Status, Entities, or any combination thereof) perform the following steps:
Access the "Current Account Operations" option in, Treasury | Payments and Receipts | Current Account Operations;
On the "General" tab select a document of type Account Transfer / Status;
Select the type of entity and its entity (this step is optional);
Select the pendants you wish to transfer;
Confirm;
In the next window confirm / change transfer data.
Running the functional process in the spring current accounts, we can see that a document is created in the cabliq and rows tables. I would like to know which part of the engines does this, if necessary I can put a prints.