Nebim v3 – ProductValidPrices Fonskiyonu ile Tüm Raporlarınıza Fiyat Grubu Ekleme
Nebim V3 ERP de bulunan standart olarak gelen ProductValidPrices fonksiyonu ürün için tanımlanan satış fiyatlarını en güncel tarihe göre listeyen fonksiyondur.
SELECT TOP 1 Price FROM ProductValidPrices (GETDATE(), GETDATE())
şeklince çağırabilirsiniz.
Raporlarda örnek kullanımı aşağıdaki gibidir.
, [SATIŞ FİYAT GRUBU] = ISNULL((SELECT *
FROM ProductValidPrices (GETDATE(), GETDATE())
WHERE ProductValidPrices.PriceGroupCode = 'SatisFiyatGrubuAdi'
AND ProductValidPrices.ItemTypeCode = Tabloadi.ItemTypeCode
AND ProductValidPrices.ItemCode = Tabloadi.ItemCode
AND ProductValidPrices.ColorCode =Tabloadi.Colorcode
AND ProductValidPrices.ItemDim1Code= Tabloadi.Itemdim1Code
ORDER BY ProductValidPrices.ColorCode DESC, ProductValidPrices.PriceListDate DESC),0)
FROM ProductValidPrices (GETDATE(), GETDATE())
WHERE ProductValidPrices.PriceGroupCode = 'SatisFiyatGrubuAdi'
AND ProductValidPrices.ItemTypeCode = Tabloadi.ItemTypeCode
AND ProductValidPrices.ItemCode = Tabloadi.ItemCode
AND ProductValidPrices.ColorCode =Tabloadi.Colorcode
AND ProductValidPrices.ItemDim1Code= Tabloadi.Itemdim1Code
ORDER BY ProductValidPrices.ColorCode DESC, ProductValidPrices.PriceListDate DESC),0)