gtAPInvoiceINLine
This function supplies the information to add Inventory line items to Accounts Payable Invoice headers. The InvoiceReference parameter must be the unique ID returned by the gtAPInvoice function call.
Each Accounts Payable Invoice is uploaded to Greentree Desktop as a complete transaction set. The AP invoice either uploads in its entirety or nothing of the document is loaded into Greentree Desktop.
If the Inventory line being added is for a serial or lot item then the serial or lot numbers can be entered for the line using the gtINSerialLotLine function.
InvoiceReference
This must be the unique identifier generated by the gtAPInvoice function call. It has the format APINV-nnn. This ensures the lines are of the correct invoice header details and it ensures Excel creates the header information before attempting to calculate and create the invoice line item details.
TransType
The inventory transaction type.
StockItem
The inventory item code for the transaction.
Amount
The net amount of the line.
Tax
The amount of tax for this line.
Narration
Narration for the line item.
TaxType
Valid tax types are Inclusive or Exclusive.
UOM
Unit of measure for this inventory item.
Location
The full location path for the inventory item.
HoldAmount
The amount to be put on hold for this line.
DiscAmount
The amount of discount given on this line.
Quantity
The number of units relevant for this line. Defaults to 0.
UnitPrice
Price per unit of quantity above. Defaults to 0.
TaxPerc
Percentage of tax for this line item.
DiscPerc
Percentage discount given, defaults to 0.
TaxCode
The code that determines the tax rate and type for the transaction. If not entered and Greentree Desktop cannot find a valid default, then an error is returned and the user must enter a valid code.
TransCode
The transaction codes for the line item, if applicable.
Returns
- Ok (Unique Identifier) - If there are no errors. The unique identifier, in the format APINV-nnn-nn, allows serial and lot number information to be attached to an inventory line using the function gtINSerialLotLine
- Error - If an error is encountered
Errors Returned
- Invalid Invoice header reference. Should be APINV-nnn
- Must have an Inventory Transaction Type
- Must have an Stock Item number
- Invalid Quantity. Must be number or omitted
- Invalid Hold Amount, must be a number or omitted
- Invalid Unit Price, must be a number or omitted
- Invalid Tax Percentage, must be a number or omitted
- Invalid Discount Amount. Must be number or omitted
- Invalid Discount Percentage. Must be number or omitted