I am trying to add a purchase order via DIAPI in version 2005 and I've paste the code I had in version 2004. The purchase order is added correctly but there is a problem in the lines...
The data I introduce in the line is the same as when doing it manually, this is, ItemCode, quantity and price, but the problem is that it doesn't calculate the linetotal and neither the doctotal.
Why is this?
My code for the line data is the next :
Private Sub AddLine(ByVal ItemCode As String, ByVal Quantity As String, ByRef oPedidoLineas As Document_Lines, ByVal oCompany As SAPbobsCOM.Company, Optional ByVal Price As Double = -1)
oPedidoLineas.ItemCode = ItemCode
oPedidoLineas.Quantity = Quantity
If Price = -1 Then
oPedidoLineas.Price = SearchPrice(ItemCode, oCompany)
oPedidoLineas.Price = Price