ABC
Stock Analysis Hook (R-STABC.MAC) ![]()
Enterprise & Corporate Edition Only
The script file must be located in your CAPITAL program directory and must have the file name R-STABC.MAC. It allows you to control the ranking process when the ABC Stock Analysis utility is executed.
Entry Values
|
Variable |
Purpose |
|
TotalCost |
This variable holds the total cost value of the stock item for the period of history examined. Taxes are excluded. |
|
TotalSales |
This variable holds the total sell value of the stock item for the period of history examined. Taxes are excluded. |
|
TotalProfit |
This variable holds the total profit value (sales minus costs) for the period of history examined. |
|
TotalTOver |
This variable holds the total number of units moved of the stock item, through the system, including sales and transfers, for the period of history examined. |
|
TotalCount |
This variable holds the total number of individual stock items found in the period of sales and movement history examined. |
|
Stock->X |
The fields of the table Stock will be available for inspection. |
|
Staux000->X |
The fields of the table Staux000 (user defined stock fields) will be available for inspection if the table exists. The table will not exist if no user defined fields have been defined for the currently active company. |
Return Values
|
Value |
Meaning |
|
0...100 |
Return a value between 0 and 100 to specify the ranking priority. 0 means no sales and 100 = top selling item (relative to all other items). |
|
ABC->Ranking |
Returns the default system ranking. |
|
-1 |
Do not assign any ranking code. The Class field is left blank. |
|
-2 |
The item is ranked as having no sales. If a ranking code for items without sales is defined, then the item will use this rank. |
Comments
This scripting hook allows you to control the calculation procedure for ranking your stock using the ABC Stock Analysis utility. By default the system will automatically assign a value between 0 (no or very low sales) and 100 (top performing) which you can control and override using this hook. The ABC Stock Analysis utility assigns a percentage value to each stock item found to exist in the period of sales and movement activity specified. The percentage value describes what percentage of total sale, cost, turnover or profit any particular stock item has contributed to total sales. These values always exclude tax.
After a value between 0 and 100 is assigned, the ABC Stock Analysis utility then determines how many stock items were in the period of history examined, and ranks items accordingly. For example, if your "A" class items present the top 10% of all sales, then a ranking of A will be issued to the 10% of items in the examined history, that have the highest percentage value assigned to them.
You may also return -1 to ensure that the item is not ranked. In this case the ranking code will be blank.
If you return a value of ABC->Ranking, the system will rank the item according to the default behaviour of the ABC Stock Analysis utility.
By assigning a higher or lower value, you can control if an item receives a higher or lower overall rank. However, you cannot directly assign a ranking code to a stock item using this hook.
Stock items that are to be ranked by the ABC Stock Analysis utility are not presented to the hook for ranking. For example, non-diminishing stock items and stock items on hold, will not be visible to the hook. Likewise, if a stock item has insufficient sales history and you have ticked Exclude Items With Insufficient Sales History, then the item also will not be presented to this hook for ranking.
Example
* In this scripting example if the user defined stock
* field is assigned the value of Y, then the stock
* item will always be ranked very highly. This will
* normally be rank 'A'
If Staux000->Toprank = "Y"
Return 100
Endif
Return ABC->Ranking
____________________________
Related Topics:
![]() |