|
StockMovement()
Returns information about a stock item's movement
history.
Syntax
StockMovement(<cProduct>, [<cLocation>],
<dDate1>, [<dDate2>]) --> aInfo
Arguments
<cProduct> --> The product code.
<cLocation> --> The product code's
location. This must be supplied if the company has multi-location
stock control activated.
<dDate1> --> The start date to report
on.
<dDate2> --> The end date to report on.
If this parameter is not supplied it is assumed that the end date
is the same as the start date.
Returns
Returns an array containing 12 elements. The
meaning of each element is listed in the following table:
|
Element
No.
|
Meaning
|
Type
|
|
1
|
The product code.
|
Character
|
|
2
|
The product description.
|
Character
|
|
3
|
The product location.
|
Character
|
|
4
|
The Stock ID.
|
Character
|
|
5
|
The opening stock quantity at the start date
specified.
|
Numeric
|
|
6
|
Total stock received from dDate1 to dDate2. (This
includes purchase orders, stock returns and receipts.)
|
Numeric
|
|
7
|
Total quantity sold or moved out from dDate1 to
dDate2.
|
Numeric
|
|
8
|
Quantity of miscellaneous adjustments from dDate1
to dDate2.
|
Numeric
|
|
9
|
Total closing stock quantity as at dDate2.
|
Numeric
|
|
10
|
Total quantity received from purchase orders
between dDate1 and dDate2.
|
Numeric
|
|
11
|
Total quantity received from stock receipts
between dDate1 and dDate2.
|
Numeric
|
|
12
|
Total quantity received from stock returns
between dDate1 and dDate2.
|
Numeric
|
If the stock item cannot be found, FALSE is
returned.
Description
This function returns stock item and movement
information on a specified stock item.
Notes
The table STOCK must be open before calling this
function. It is strongly recommended that the table AUDIT_1 also be
opened before calling this function. If it is not opened, the
StockMovement() function will open and close the table
automatically, each time it is called. This can significantly
degrade performance.
Example
* Return quantity dispatched or sold
between 01/01/03
* and 31/12/04 for product item
ABC
aInfo := StockMovement("ABC",,
CTOD("01/01/03"), CTOD("31/12/03"))
nSold := aInfo[7]
____________________________
Related Topics
Business
Function List
|