|
StockGetQuantity() 
Returns the quantity in stock of the selected
stock item.
Syntax
StockGetQuantity([<lFree>], [<nID>],
[<cAssignment>] ) --> nQuantity
Arguments
<lFree> --> If TRUE is passed to this
function the quantity of stock free (available for sale) is
returned. Otherwise the quantity physically in stock is returned.
If this parameter is not passed, the physical stock quantity is
returned by default.
<nID> --> If Stock Tracing is activated,
you can specify the Property ID as a number. The function will then
return the quantity in stock for the specified property. For
example, if the ID number refers to a batch, the function will
return the total quantity assigned to the selected batch.
<cAssignment> --> If Stock Tracing is
activated, you can specify the assignment to locate and return the
quantity in stock for that assignment only. If you specify the
assignment description you must also specify a property ID. For
example, if the 7th property is "Fabric" and you specify "Velvet",
this function will return the quantity in stock of Fabric of type
Velvet.
Returns
Returns the quantity in stock.
Description
Returns the physically allocated stock for the
currently selected stock item, or the free stock quantity. Free
stock is physical stock less any allocations in the system. You can
also use this function to return the quantity in stock of a
specific size, colour, style, fabric, batch, etc.
If the specified item is not found, zero is
returned.
For Portional Pricing specify the size or
length of the portion, not the description of the portion. For
example, if the portion is 5.5 and the description of the portion
is *5.50 metres, you must pass "5.5" and not "*5.50 metres" to this
function.
Example #1
* Return what is physically in
stock
Return StockGetQuantity()
Example #2
* Return the quantity in stock of the
property
* BLUE for property ID 9
(colour)
Return
StockGetQuantity(FALSE, 9, "Blue")
____________________________
Related Topics
Business
Function List
|