gtARInvoice
This function supplies the information needed to create an Accounts Receivable Invoice header.
Each Accounts Receivable Invoice is uploaded to Greentree Desktop as a complete transaction set. The Invoice 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 ARINV-nnn if nnn is a sequential number that is unique for the current Excel session. This number links the AR Invoice line item function calls with its header call. This number is not updated to or in anyway passed to Greentree.
Company
The company code that the invoice is to be created in.
Batch
The batch number the invoice is to be posted in. A new batch is created if it does not exist and a Batch Description is entered.
BatchDesc
The batch description if a new batch is created. This is ignored if the batch already exists. If the batch description is null and the batch does not exit an error is returned.
Branch
The branch code that the invoice belongs to.
Reference
The customer's invoice number. An invoice with this number cannot already exist for the customer or an error is returned.
This reference updates to the Last invoice number field on the Accounts Receivable Module Control form under the condition that it is numeric, and is greater than the current last invoice number.
Customer
The customer's account number in Greentree Desktop.
DocumentDate
The document date for the invoice.
PostingDate
The posting date for the transactions. This determines the financial period the transactions post to.
PaymentTerms
The payment terms for the transaction. If this is left empty or omitted, the AR invoice is generated using the payment terms for the customer.
PaymentDate
The payment date for the transaction. If the above payment terms allows date change on transactions, the date entered becomes the payment date.
If the payment terms do not allow date change on transactions, any date entered is ignored and the date is calculated from the payment terms.
If this field is left empty or omitted, the date is calculated from the payment terms.
SalesPerson
The salesperson for the transaction. If this is left empty or omitted, the AR invoice is generated using the salesperson code from the customer.
HoldCode
If the invoice is to be put on hold then this is the hold code. If omitted, it defaults to None.
Narration
The narration for the invoice header.
CurrencyRate
The exchange rate if this is a foreign currency transaction.
MultiplyRate
Valid codes are True or False If true the rate above is a multiply rate rather than a divide rate. If left empty, the default is True.
CustomerOrderNo.
The customer's order number. If more than 30 characters are entered, the AR invoice is updated with the first 30 characters.
Returns
Unique identifier.
Example
gtARInvoice(01,03,Desc 3,02,Ref33,100001,17/11/03,30/11/03,CASH,17/11/03,BOB,None,,0.8803,True,Order33)
Errors Returned
- Must have a Company Identifier
- Must have a Batch Identifier
- Must have a Branch Identifier
- Must have an Invoice Reference
- Must have a Customer Identifier
- Must have a Document Date
- Must have a Posting Date
- Invalid Posting Date
- Invalid Payment Terms
- Invalid Sales Person
- Invalid Narration, must be a string or omitted
- Invalid Hold Code
- Invalid Currency Rate
- Invalid Multiply Rate flag