Good afternoon,
Once again I ask you to help. I would like to know how I can do the transformation of Documents, in the case of Transforming a Supplier Order Note into Invoice to Supplier using the PRIMAVERA APIs.
I have already referenced here how to copy, but I would like to make the Transformation of the Documents so that they remain with the identification of the Document that created its origin.
Dim objCopia As GcpBEDocumentoCompra
Dim objOrig As GcpBEDocumentoCompra
Set objOrig = Aplicacao.BSO.Comercial.Compras.Edita("000", "FPD", "2018", "8")
'Clona o objeto de origem
Set objCopia = PSO.FuncoesGlobais.ClonaObjecto(objOrig)
With objCopia
.TipoDoc = "FD"
.EmModoEdicao = False
.Id = PSO.FuncoesGlobais.CriaGuid(True)
End With
For Each objLinha In objCopia.Linhas
objLinha.IDLinha = PSO.FuncoesGlobais.CriaGuid(True)
Next
BSO.Comercial.Compras.Actualiza objCopia
Set objCopia = Nothing
Set objOrig = Nothing
João Diniz