Venice
Artcl::SeekPriceAndDiscount
 
Seeks a commercial agreement price and/or discount for the Article.
 
VARIANT_BOOL SeekPriceAndDiscount (
    VARIANT_BOOL bSales,
    BSTR bsNumber,
    BSTR bsCurrency,
    BSTR bsDetRemark,
    DOUBLE dQuantity,
    DOUBLE dVatRate,
    DOUBLE dRate,
    BYTE byDecimals,
    DATE dDate,
    LONG lCstSupNum,
    LONG lCstSupSubNum,
    VARIANT* pvPrice,
    VARIANT* pvDiscount
)
 
Parameters
bSales
[in] True if you want to use commercial sales agreements to seek a price/discount, false for using commercial purchase agreements.
bsNumber
[in] The number of the article of which you want to know a price/discount or blank if you want to use the last known article number.
bsCurrency
[in] The currency in which you want the price/discount to be expressed.
bsDetRemark
[in] The remark of the detail line on which the article is used.
dQuantity
[in] The quantity for which you want to know the price/discount. This quantity should be expressed in sales units if the parameter bSales is true otherwise in purchase units.
dVatRate
[in] The VAT rate to which the article is submitted, 0.0 if you want to know the price/discount VAT exclusive.
dRate
[in] The rate of the given currency in relation to the dossier currency.
byDecimals
[in] The number of decimals that should be used to round the price/discount.
dDate
[in] The date on which the price/discount should be valid.
lCstSupNum
[in] If the parameter bSales is true the number of the customer, otherwise the number of the supplier for who you want to know the price/discount.
lCstSupSubNum
[in] If the parameter bSales is true the subnumber of the customer, otherwise the subnumber of the supplier for who you want to know the price/discount.
pvPrice
[out] Returns a VARIANT, subtype DOUBLE, containing the found price VAT inclusive.
pvDiscount
[out] Returns a VARIANT, subtype DOUBLE, containing the found discount.
 
Return value
True if a price and/or a discount were found, otherwise false.
 
See Also
CreateArtcl
 
Samples
 
C++
 
// Seek a price/discount (in Euro) for the article 'Art_001' for a quantity of 150.0, submitted to a VAT rate of 21.0%, for the customer with number 25/0.
VARIANT    vPrice, vDiscount;

if (pArtcl->SeekPriceAndDiscount (VARIANT_TRUE, "Art_001", "EUR", "", 150.0, 21.0, 1.0, 2, COleDateTime (0, 0, 0, 0, 0, 0).m_dt, 25, 0, &vPrice, &vDiscount))
{
    // Process price and/or discount
}

C#
 
// Seek a price/discount (in Euro) for the article 'Art_001' for a quantity of 150.0, submitted to a VAT rate of 21.0%, for the customer with number 25/0.
object oPrice, oDiscount;

if (oArtcl.SeekPriceAndDiscount (true, "Art_001", "EUR", "", 150.0, 21.0, 1.0, 2, new DateTime (), 25, 0, out oPrice, out oDiscount))
{
    // Process price and/or discount
}

VBS
 
' Seek a price/discount (in Euro) for the article 'Art_001' for a quantity of 150.0, submitted to a VAT rate of 21.0%, for the customer with number 25/0.
Dim oPrice, oDiscount
Dim dtDate

If oArtcl.SeekPriceAndDiscount(True, "Art_001", "EUR", "", 150.0, 21.0, 1.0, 2, dtDate, 25, 0, oPrice, oDiscount) Then
    ' Process price and/or discount
End If

VB.NET
 
' Seek a price/discount (in Euro) for the article 'Art_001' for a quantity of 150.0, submitted to a VAT rate of 21.0%, for the customer with number 25/0.
Dim oPrice, oDiscount As Object
Dim dtDate As Date

If oArtcl.SeekPriceAndDiscount(True, "Art_001", "EUR", "", 150.0, 21.0, 1.0, 2, dtDate, 25, 0, oPrice, oDiscount) Then
    ' Process price and/or discount
End If