EULANDA® ERP System Head Start thru Technology
The procedure determines the selling price, related to an article and a specific customer. Here the different discount and relays systems are considered:
The parameter article ID, address ID, quantity, currency and grossFlg serves the determination with as initial parameters and supplies as result the new price, a discount and the source.
PROC cn_Preis_GetVk
@ad_Id int,
@ar_Id int,
@Quantity numeric(18,4),
@Currency char(3),
@GrossFlg bit,
@SellingPrice numeric(18,2),
@Discount numeric(18,2),
@Source varchar(20)
@ad_Id
The argument @ad_id is the ID of the type Integer of an existing customer, thus an address.
@ar_id
The argument @ar_id is the ID of the type Integer of an existing article.
@Quantity
The argument @Quantity gives the number of the article. This number is needed if prices are deposit.
@Currency
Over the argument @Currency if necessary a conversation of the price is made into a goal currency. For the EURO zone 'EUR' is indicated here.
@GrossFlg
Over the argument @GrossFlg it is indicated whether the Selling price should be inclusive steering wheel or not. With GrossFlg=0 the result price is a net price, with GrossFlg=1 is it a price the inclusive VAT.
@SellingPrice
[OUT]
The argument @SellingPrice is the pulled price, which results due to the article and the customer and/or the quantity. Depending upon setting of the GrossFlg is it net or contains the valid control item.
@Discount
The argument @Discount is a result, which due to the article and customer are taken out of the groups of discounts and customer group matrix.
@Source
The argument @Source indicates, from which range the conditions was determined. The following returns are possible:
- No
- Article
- Price list
- Offer
- Order
The moreover one a return value of the form is "FEHLER: xx" possible. In this case the pricing failed. In addition for the specific of the arisen error a run time error is produced through RAISERROR.
Far return values are if necessary in newer API present.
DECLARE@e int, @SellingPrice numeric(18,2), @Discount numeric(18,2), @Source varchar(20)EXEC@e = cn_Preis_GetSellingPrice @Ad_Id=50, @Ar_Id=10, @Quantity=1, @Currency='EUR', @GrossFlg=0, @SellingPrice=@SellingPrice OUT, @Discount=@Discount OUT, @Source=@Source OUTSELECT@e [Exec], @SellingPrice [SellingPrice], @Discount [Discount], @Source [Source]
In this example the SellingPrice is determined to the article with the ID "10" and an address with the ID "50". The price enquiry is based on the quantity of "1". The result is to be spent in the currency "EUR" and without tax. Additionally still the value discount is returned and contains a line discount, if to the indicated article and the address a group of discounts as well as customer group exist, which are linked with a line discount. The value source contain the value "article", if the price were loaded from the master data, otherwise the value "price list", if this were loaded from the price list.