SpecialPrice()


Calculates the customer specific sell price of a stock item by inspecting the Customer Special Price Table when applicable.

Syntax

SpecialPrice(<cAccount>, <cStockID>, <nQtyBreak>, <dDate>, <cDepartment>) --> nPrice

Arguments

<cAccount> --> Customer account code. If not specified, the one in the current customer record is used. Pass an empty string ( "") to return a value that is not account specific.

<cStockID> --> The stock ID number to base the sell price on. If not specified, the one in the current stock record is used.

<nQtyBreak> --> The price to return based on a quantity break purchase of this amount or more. If a value is not specified a quantity break of zero or more is assumed.

<dDate> -->The date for which any sale is said to occur. This would only apply if your pricing changed according to the date of the transaction, i.e., a one month special. If not specified the current system date is assumed.

<cDepartment> --> The department code. If not specified the department field is set to a blank code. This would only apply if your pricing varied according to the department that sold the goods.

Returns

Returns the sell price based on the current customer account and stock item being sold.

Description

This function returns the sell price of a stock item based on the rules specified in the Customer Special Price Table. If no rules apply, the default system sell price is returned.

If a customer account code or Stock ID is not specified, Visual Builder will return the price based on the currently selected customer record and/or stock record. If you do not want an account specific price to be returned, pass an empty string such as: ""

generate/mistake3.gif In order to use this function the form must open these databases in the appropriate body section that calls Specialprice():

1. Customer file (custrec or customer)

2. Stock file (stock)

3. Customer Special Price Table (matrix)

4. Stock Groups (type)

5. Invoicing (Invoice)

Unless all these files are opened, the return price will always be zero.

Example

// Returns the sell price of the currently selected stock

// item based on a quantity break purchase of 50 or more

// for customer account code ACME.

SpecialPrice("ACME",, 50)

// Returns the sell price for all customers

SpecialPrice("")

// Return the sell price for selected customer

Specialprice()

// Returns the sell price for all customers to 1st

// of January 2000

SpecialPrice("",,, CTOD("01/01/2000"))

Notes

See the documentation on Customer Special Pricing for information on how rule and price selection occurs under CAPITAL.

This function is only supported in CAPITAL 2.7 or CAPITAL Series 7 or higher. For earlier versions of CAPITAL this function always returns zero.

____________________________

Related Topics:

Business Function List

SpecialName()



CAPITAL VISUAL BUILDER