gtSOSalesOrder
This function records the header data needed for a Sales Order. Each Sales Order is uploaded to Greentree Desktop as a complete transaction set. The Sales Order document either uploads in its entirety or nothing of the document is loaded into Greentree Desktop.
The unique identifier returned by the function call is structured as SOORD-nnn if nnn is a sequential number that is unique for the current Excel session. This number links the gtSOSalesOrderGLLine, gtSOSalesOrderNSLine, gtSOSalesOrderINLine and gtSOSalesOrderAddress functions with the sales order header. This number is not updated to or passed through to Greentree.
Company
The company code that the order is created in.
Customer
The customer's code in Greentree Desktop.
Reference
A user defined reference to this order.
Branch
Branch code for this sales order header.
DocumentDate
The document date for the order.
DeliveryDate
The delivery date for this sales order header.
SalesPerson
A valid sales person code must be supplied.
CustOrderNo
The customer's order number. May be required.
DiscountPercentage
The discount percentage for this sales order header.
Location
The sales order header location.
OrderType
The order type for this sales order header.
CurrencyRate
The exchange rate for foreign currency transactions. Defaults to 1.00.
IsCurrencyRateMultiply
Defaults to True. If true the currency rate above is a multiply rate rather than a divide rate.
CurrencyCode
The currency code. Only required for foreign currency transactions.
StandardText
Narration for the sales order header.
IsForwardOrder
Defaults to False. If true then this is a forward order.
DropSequence
The drop sequence for this sales order header.
RunNo
The run number for this order.
LinesEnteredBy
This determines in the order in which Sales Order lines are imported into Greentree Desktop. It is assumed that the lines items have been entered in the Excel Worksheet in the sequence of the code selected, starting with the lowest column. Valid codes are:
- Column - the lines are sorted by column before being imported into Greentree
- Row - the lines are sorted by row before being imported into Greentree
If this is left unspecified, the lines are imported in the sequence set by Excel.
Returns
- Unique identifier - to be used to link the document header with its inventory lines
- Error - if an error is encountered
Example
gtSOSalesOrder(01,100010,500044,01,20/03/00,,AB,54554,,A01,,,,)
Errors Returned
- Must have a Company Identifier
- Must have a Customer Code
- Must have a Reference
- Must have a Branch Identifier
- Must have a Document Date
- Invalid currency rate, must be a number or omitted
- Invalid discount percentage, must be a number or omitted
- Invalid IsForwardOrder, must be True, False or omitted
- Invalid IsCurrencyRateMultiply, must be True, False or omitted
- Invalid LinesEnteredBy, must be Row, Column or omitted