Good night everyone,
I'm trying to make the Transformation of Sales Documents, in the case a Pro-form in an Invoice, but it gives error because the origin does not have Warehouse in the Lines. How do I add the Warehouse I want?
I have the following code that works if you have Warehouse:
On Error GoTo Erro
Dim objDocOrigem As GcpBEDocumentoVenda
objDocOrigem = motor.Comercial.Vendas.Edita("000", cbOrigTipoDoc.Text, cbOrigSerie.Text, CInt(cbOrigDoc.Text))
Dim objDocDestino As GcpBEDocumentoVenda
objDocDestino = New GcpBEDocumentoVenda
objDocDestino.TipoEntidade = objDocOrigem.TipoEntidade
objDocDestino.Entidade = objDocOrigem.Entidade
objDocDestino.Tipodoc = cbDestTipoDoc.Text
objDocDestino.Serie = cbDestSerie.Text
objDocDestino.CondPag = objDocOrigem.CondPag
Dim Doc(0) As Object
Doc(0) = objDocOrigem
motor.Comercial.Vendas.TransformaDocumentoEX(Doc, objDocDestino, True)
GoTo Fim
Erro:
MsgBox(Err.Number & ": " & Err.Description)
Fim:
objDocOrigem = Nothing
objDocDestino = Nothing
LimpaTransCompras()
cbOrigTipoDoc.Focus()