public PriceDiscTable pricediscTable( ItemId ItemId )
{
PriceDiscTable _priceDiscTable;
select firstonly _priceDiscTable order by _priceDiscTable.FromDate desc
where _priceDiscTable.ItemRelation ==ItemId
&& _priceDiscTable.AccountCode == PriceDiscPartyCodeType::All
&& _priceDiscTable.ItemCode == 0
&& (_priceDiscTable.ToDate >= today() ||_priceDiscTable.ToDate == dateNull());
//&&_priceDiscTable.FromDate <= today();
return _priceDiscTable;
}