StockVal
This method returns a product value according to some valorization methods passed as parameters (LIFO, FIFO, HIFO, AVG).
Body - raw:
{
"Method": "StockVal",
"Parameters": [
<nArticle>[,
<nMethode>][,
<bForceVal>][,
<dDate>][,
<nDocType>]
]
}
Parameters | Description |
---|---|
nArticle |
Item Id (ar_numero). |
nMethod |
Valuation method. This parameter is optional. If it is not defined, the parameter defined in the Item is used by default. The possible values for this parameter are: 1: purchases weighted average; 2: LIFO Last In First Out; 3: FIFO First In First Out; 4: HIFO Highest In First Out; 5: valuation according to the starting balance. |
bForceVal | Allows to force the value returned to zero if the method returns a null. |
dDate | Only the transactions up to this date are considered in the valuation. This parameter is optional. If the parameter is not defined, the today's date is used by default. |
nDocType | Document type. This parameter is optional. If the parameter is not defined the Creditor Invoice (44) will be used by default. |
Examples:
*/ Return the valuation according to the weighted average for item with ar_numero = 1523.
{
"Method": "StockVal",
"Parameters": [
1523,
1
]
}
*/ Return the valuation according to the LIFO method for the item with ar_numero = 1523. The method can return NULL.
{
"Method": "StockVal",
"Parameters": [
1523,
1,
true
]
}
*/ Return the valuation according to the FIFO method for the item with ar_numero = 1523 and for the purchases up to the 31.08.2017.
{
"Method": "StockVal",
"Parameters": [
1523,
1,
false,
"31.08.2017"
]
}
*/ Return the valuation according to the FIFO method for the item with ar_numero = 1523, for the purchases up to the 31.08.2017. The valuation is based on the Receptions of Goods (type 42).
{
"Method": "StockVal",
"Parameters": [
1523,
1,
false,
"31.08.2017",
42
]
}