PdcPuchaseInvoiceLineList.AddExtraLine
Jump to navigation
Jump to search
Declaration
AddExtraLine(intExCostID as integer, strExCostDescr, intLinkToPos as Integer) as PdcPurchaseInvoiceLine. Enter the ID of the extra costs line in the FCKOST table, or its description. In case the line needs to be linked to another line in the same invoice, enter the ID.
Description
The method adds a purchase invoice line for extra costs, optionally linked to another invoice line.
Notes
When the line that the extra line is to be linked to, is also created in your script, save the invoice first to obtain the ID of the line.
Code example
dim objPI
dim objPIList
dim objPIL
dim objPILLink
set objPI = pdc.Logistics.PurchaseInvoices.Active
if IsValid(objPI) then
set objPIList = objPI.PurchaseInvoiceLineList
if IsValid(objPIList) then
objPI.Save
set objPILLink = objPIList.GetLineByPos("001")
if IsValid(objPILLink) then
set objPIL = objPIList.AddExtraLine(edt_Extra.Hint, "" , objPILLink.ID)
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(objPILLink)
end if 'IsValid(objPIList)
else
msgbox "No purchase invoice found."
end if 'IsValid(objPI)
Availability
Available since July 2015 (Version 5.1 onwards)