PdcPuchaseInvoiceLineList.AddLineWithPO: Difference between revisions
Jump to navigation
Jump to search
Created page with "== Declaration == AddLineWithPO(PONumber, POPosition as String, DeliveryID as Integer) as PdcProjectLine Either enter PONumber and POPositions or enter DeliveryID. == Des..." |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Declaration == | == Declaration == | ||
AddLineWithPO(PONumber, POPosition as String, DeliveryID as Integer) as [[ | AddLineWithPO(PONumber, POPosition as String, DeliveryID as Integer) as [[PdcPurchaseInvoiceLine]] | ||
Either enter PONumber and POPositions or enter DeliveryID. | Either enter PONumber and POPositions or enter DeliveryID. | ||
Line 7: | Line 7: | ||
== Notes == | == Notes == | ||
NB!! In case of setting "book purchase invoice based on goods receipt" the deliverylineID should be provided. The setting is in section LOGISTIEK, setting INKOOPFACTUURBASIS (1 = order, 2 = goods receipt). The method does NOT check this, you need to supply the ING_ID of the delivery line. Report an error in your script in case of no or more than one receipt. | |||
== Code example == | == Code example == | ||
<source lang="vb"> | <source lang="vb"> | ||
dim objPI | |||
dim objPIList | |||
dim objPIL | |||
dim strPONr | |||
dim strPos | |||
set objPI = pdc.Logistics.PurchaseInvoices.Active | |||
if IsValid(objPI) then | |||
set objPIList = objPI.PurchaseInvoiceLineList | |||
if IsValid(objPIList) then | |||
strPONr = GetAnyField("TOTINKOOP", "IN_ID", edt_IN.Text, "IN_NR") | |||
strPos = GetAnyField("TOTINKOOP", "IN_ID", edt_IN.Text, "IN_BPOS") | |||
set objPIL = objPIList.AddLineWithPO(strPONr, strPos, 0) | |||
if IsValid(objPIL) then | |||
mmo_Log.Lines.Add "Line" & objPIL.Pos & " added(" & objPIL.ID & ")" & " CostKind = " & objPIL.CostKind | |||
else | |||
mmo_Log.Lines.Add pdc.LastError | |||
end if 'IsValid(objPIL) | |||
end if 'IsValid(objPIList) | |||
else | |||
msgbox "No purchase invoice found." | |||
end if 'IsValid(objPI) | |||
</source> | </source> | ||
== Availability == | == Availability == | ||
Available since | Available since July 2015 (Version 5.1 onwards) |
Latest revision as of 08:35, 28 January 2016
Declaration
AddLineWithPO(PONumber, POPosition as String, DeliveryID as Integer) as PdcPurchaseInvoiceLine Either enter PONumber and POPositions or enter DeliveryID.
Description
The method adds a purchase invoice line linked to a purchase order line or a delivery line.
Notes
NB!! In case of setting "book purchase invoice based on goods receipt" the deliverylineID should be provided. The setting is in section LOGISTIEK, setting INKOOPFACTUURBASIS (1 = order, 2 = goods receipt). The method does NOT check this, you need to supply the ING_ID of the delivery line. Report an error in your script in case of no or more than one receipt.
Code example
dim objPI
dim objPIList
dim objPIL
dim strPONr
dim strPos
set objPI = pdc.Logistics.PurchaseInvoices.Active
if IsValid(objPI) then
set objPIList = objPI.PurchaseInvoiceLineList
if IsValid(objPIList) then
strPONr = GetAnyField("TOTINKOOP", "IN_ID", edt_IN.Text, "IN_NR")
strPos = GetAnyField("TOTINKOOP", "IN_ID", edt_IN.Text, "IN_BPOS")
set objPIL = objPIList.AddLineWithPO(strPONr, strPos, 0)
if IsValid(objPIL) then
mmo_Log.Lines.Add "Line" & objPIL.Pos & " added(" & objPIL.ID & ")" & " CostKind = " & objPIL.CostKind
else
mmo_Log.Lines.Add pdc.LastError
end if 'IsValid(objPIL)
end if 'IsValid(objPIList)
else
msgbox "No purchase invoice found."
end if 'IsValid(objPI)
Availability
Available since July 2015 (Version 5.1 onwards)