Show TOC

Object documentationTmxPurchaseOrder Interface

 

The following properties define the dynamic behavior of the TmxPurchaseOrder object:

Name

COM Type

Description

Potransnum

VARIANT

This is the new purchase order number generated by the system and it can be retrieved after the method InsertPurchaseOrder() is executed successfully.

LastErrorNumber

VARIANT

The error code returned if there is an error. For known ADO error, the return value is the value returned from ADO function. If it is unknown ADO error, the value is 0x8000FFAAL.

LastError

VARIANT

The message displayed if there is an error. If it is known ADO error, the description is return from ADO Error object. If it is unknown ADO error, the description specifies the method name where the error occurs.

Method

HRESULT ValidatePurchaseOrderNumber(VARIANT Potransnum)

This method is used to validate a purchase order number with pending transaction status in the purchase_order table.

When there is an error, two properties (LastErrorNumber and LastError) should be used to determine the code of the error and proper description. For LastErrorNumber, there are mainly two categories: known ADO error and unknown ADO error. For known ADO error, both LastErrorNumber and LastError are returned as the values returned from ADO. For unknown ADO error, the error code is 0x8000FFAAL and the description is based on which function causes the failure. The error code is 0x8000FFCC if the purchase order is not found.

Parameters

VARIANT Potransnum

Purchase order number to be validated.

Return

S_OK

If the purchase order number is successfully validated.

S_FALSE

If there is an error during the validation process or if the purchase order number is not found.

Method

HRESULT InsertPurchaseOrder(BSTR Txnstatus, VARIANT Txndate, VARIANT Orderdate, BSTR Note, BSTR Manual, BSTR Transmitted, VARIANT Modtime, BSTR Overflag, BSTR Origin, BSTR Plunum).

This method is used to insert a new purchase order into the purchase_order table. The new purchase order number will be generated by the system automatically and will be returned through the property Potransnum.

When there is an error, two properties (LastErrorNumber and LastError ) should be used to determine the code of the error and proper description. For LastErrorNumber, there are mainly two categories: known ADO error and unknown ADO error. For known ADO error, both LastErrorNumber and LastError are returned as the values returned from ADO. For unknown ADO error, the error code is 0x8000FFAAL and the description is based on which function causes the failure.

Parameters

BSTR Txnstatus

Purchase order transaction status.

VARIANT Txndate

Purchase order transaction date.

VARIANT Orderdate

Purchase order ordered date.

BSTR Note

General comment

BSTR Manual

Manual purchase order or catalogue purchase order.

BSTR Transmitted

Purchase order transmitted or not.

VARIANT Modtime

Purchase order modified time.

BSTR Overflag

BSTR Origin

BSTR Plunum

PLU number for this purchase order.

Return

S_OK

If the purchase order number is successfully validated.

S_FALSE

If there is an error during the insertion process.

Method

HRESULT UpdatePurchaseOrder(VARIANT Potransnum, BSTR Plunum, VARIANT Qty)

This method is used to update an existing purchase order for a PLU. If the PLU to be ordered is already in the purchase order, then the quantity will be added. Otherwise a new record will be created.

When there is an error, two properties (LastErrorNumber and LastError ) should be used to determine the code of the error and proper description. For LastErrorNumber, there are mainly two categories: known ADO error and unknown ADO error. For known ADO error, both LastErrorNumber and LastErrorare returned as the values returned from ADO. For unknown ADO error, the error code is 0x8000FFAAL and the description is based on which function causes the failure.

Parameters

VARIANT Potransnum

Valid purchase order number.

BSTR Plunum

PLU number to be added to the existing purchase order.

VARIANT Qty

Number of quantity to be ordered.

Return

S_OK

If the purchase order number is successfully validated.

S_FALSE

If there is an error during the update process.