Syntax
| SQL.CreateOrder(KlantNr, Code, Quantity, TextLines, Price, Discount _
[, ProjectRef][, BezorgType][, NoPackingList,][ NoUpdateStatus])
| ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| Generates a new order in the specified project, performing credit verification and applying debtor and/or project-specific pricing agreements.
When the function completes successfully, it also executes the SQL Server stored procedure
'sp_genereerPaklijst' is executed, which automatically updates the inventory. This also sets the packing list status to '5' so that the order can also be invoiced directly.
Returns the newly created order number on success, otherwise 0 (zero).
NOTE: The stored procedure only works with the default warehouse code.
| ||||||||||||||||||||||
See Also
| |||||||||||||||||||||||
Example
| Sub Main() Dim MyCode(5) As Long Dim MyQnty(5) As Single Dim MyText(5) As String Dim MyPric(5) As Currency Dim MyDisc(5) As Single Dim MyProject As String MyCode(1) = 703763 MyQnty(1) = 3 MyText(1) = "Weegschaal 30 kg" MyPric(1) = 35.75 MyDisc(1) = 0 MyCode(2) = 504554 MyQnty(2) = 1.5 MyText(2) = "Waspoeder Bont" MyPric(2) = 12.79 MyDisc(2) = 0.15 ' 15 procent MyCode(3) = 440078 MyQnty(3) = 15 MyText(3) = "Weegschaal 30 kg" MyPric(3) = 35.75 MyDisc(3) = 0.20 ' 20% MyProject = InputBox$("Project?") Debug.Print SQL.CreateOrder("BL4998", MyCode(), MyQnty(), MyText(), _ MyPric(), MyDisc(), MyProject, 0) End Sub | ||||||||||||||||||||||