iVend 6.6 (Actual functionality of Ivend for all version)
(INC0010921) special price of product would be changed as per Discount if AutoUpdt field is updated as False.
While creating a special price for a product, we used to add the product info, its price, discount (if any) with type, UOM details if any and date duration of Special price applicable.
This all info used to store in database table “PrcSpecialPriceListDate” with a column named “AutoUpdt” as 1 by default.
While performing any transaction over the product it used to fetch the price detail from this table using SP “uspGetItemSpecialPrice” and special price would be applied if used in between the mentioned duration of date.
This “AutoUpdt” column used to get updated by Customer manually from SAP to Zero (0) as per their requirement and then a special calculation would go for getting the selling price of the product, mentioned below:
If Discount Type is 2 (indicates percentage discount) then selling price of product would be specially calculated as Price = (Price *100) / (100 – Discount%)
If Discount Type is 1 (indicates Amount discount) then selling price of product would be specially calculated as Price = Price + Discount amount
Formula in SP - uspGetItemSpecialPrice
if (@pDiscountType = 2) --indicates percentage discount
BEGIN
set @pItemPrice = (@pItemPrice *100 ) / (100 - @pDiscount)
END
if (@pDiscountType = 1) --indicates AMOUNT discount
BEGIN
set @pItemPrice = @pItemPrice + @pDiscount
END
end
This “AutoUpdt” column used to get control by ERP as per requirement and that makes an auto calculation over the price on product sell transaction.