on 04-08-2009 5:35 AM
Hi, every one:
I tried to update PriceAfVat in Document_lines of SaleOrder with B1WS. What's strange was that if the PriceAfVat was 0, I could update PriceAfVat with a new Price. But if the PriceAfVat was not 0, the resulting PriceAfVat was the price in PriceList set in corresponding BP master data (OCRD.ListNum).
here is my code:
Dim myOrderService As OrdersService.OrdersService = New OrdersService.OrdersService
Dim msgHeader As OrdersService.MsgHeader = New OrdersService.MsgHeader()
msgHeader.SessionID = SessionID
msgHeader.ServiceName = OrdersService.MsgHeaderServiceName.OrdersService
msgHeader.ServiceNameSpecified = True
myOrderService.MsgHeaderValue = msgHeader
Dim myOrderParams As OrdersService.DocumentParams = New OrdersService.DocumentParams
myOrderParams.DocEntry = DocEntry
myOrderParams.DocEntrySpecified = True
Dim myOrder As OrdersService.Document = New OrdersService.Document
myOrder = myOrderService.GetByParams(myOrderParams)
myOrder.DocTotalSpecified = False
myOrder.DocTotal = Nothing
myOrder.DocumentLines = New OrdersService.DocumentDocumentLine(RowCount) {}
For Count = 1 To RowCount
myOrder.DocumentLines(Count - 1) = New OrdersService.DocumentDocumentLine
...//these are codes that set ItemCode, Dscription, Quantity, VatGroup.
myOrder.DocumentLines(Count - 1).PriceAfterVAT = 650
myOrder.DocumentLines(Count - 1).PriceAfterVATSpecified = True
Next
myOrderService.Update(myOrder)
Can anybody help me?
Hi,
As it seems the actual order creating happens in your self made (?) objects (
myOrder.DocumentLines = New OrdersService.DocumentDocumentLine(RowCount)
) it is hard to tell from this code what is happening.
For example what does this do ? :
myOrder.DocumentLines(Count - 1).PriceAfterVATSpecified = True
If there is no reason to be found in the code, you could consider reverse calculating the price after vat, and adding the order lines using:
myOrder.DocumentLines(Count - 1).Price = ReverseCalculatedPriceWithoutVat
The
.Price
property should at least always override any prices determined in price lists and special prices.
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.