Stock
This method returns a piece of information about the stock quantities of an item.
Syntax:
oSession.Stock(<cMethod>, <nItem>[, <dDateEnd>][, <dDateStart>][, <nWarehouse>][, <dExpiryEnd>][, <dExpiryStart>])
Parameter |
Description |
cMethod |
Type of information that has to be returned. The possibles values are: available: stock physically available; suppliersorders: on suppliers orders or in production; customersorders: on customers orders confirmations (reserved); customersdeliveries: delivered to customers (delivery slips); customersworksheets: on customers worksheets; salesamount: total sales amount; salesquantity: total quantity sold; salesquantityreturned: total quantity returned (debtors credit notes); saleslastdate: date of the last sale. |
dDateEnd |
The transactions up to this date are selected. This parameter is not mandatory. If the parameter is not specified, all the transactions are considered. |
dDateStart |
The transactions starting from this date are selected. This parameter is not mandatory. If the parameter is not specified, all the transactions are considered. |
nWarehouse |
Warehouse ID. If this parameter is specified, only the transactions for this warehouse are selected. Otherwise all the transactions are considered. |
dExpiryEnd |
Only the transactions concerning line items with an expiry date before the date of the parameters are considered. If the parameter is not specified all the transactions are considered. |
dExpiryStart |
Only the transactions concerning line items with an expiry date after the date of the parameters are considered. If the parameter is not specified all the transactions are considered. |
Examples:
*/ Instantiate end set the database location.
oBiz = createobject("bizinfo.application")
oBiz.cDatabasePath = "C:\WinBIZ Data"
oBiz.nCompany = 1000
oBiz.nYear = 2017
*/ Show the quantity physically in stock for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("available", 100))
*/ Show the quantity physically in stock at the 31.03.2017 for the item with ID = 100 (ad_numero) in the Warehouse with ID = 3.
messagebox(oBiz.Stock("available", 100, {31.03.2017}, , 3))
*/ Show the quantity that will be physically in stock at the 31.03.2017 for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("available", 100, {31.03.2017}))
*/ Show the quantity already ordered at suppliers (or in production) for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("suppliersorders", 100))
*/ Show the quantity already ordered by customers for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("customersorders", 100))
*/ Show the quantity already delivered to customers for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("customersdeliveries", 100))
*/ Show the quantity already delivered to customers in the period of march 2017 for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("customersdeliveries", 100, {31.03.2017}, {01.03.2017}))
*/ Show the quantity on worksheets for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("customersworksheets", 100))
*/ Show the total sales amount for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("customersdeliveries", 100))
*/ Show the total sales amount for the period of march 2017 for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("customersdeliveries", 100, {31.03.2017}, {01.03.2017}))
*/ Show the total quantity sold for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("salesquantity", 100))
*/ Show the total quantity sold for the period of march 2014 for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("salesquantity", 100, {31.03.2017}, {01.03.2017}))
*/ Show the total quantity returned by customers for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("salesquantityreturned", 100))
*/ Show the total quantity returned by customers for the period of march 2017 for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("salesquantityreturned", 100, {31.03.2017}, {01.03.2017}))
*/ Show the last sale date for the item with ID = 100 (ad_numero).
messagebox(oBiz.Stock("saleslastdate", 100))