public PriceCur currentPrice(ItemId itemId, real qty, AccountNum accountNum )
{
CustPriceGroup priceGroup;
InventDim inventDim;
InventTable inventTable;
PriceDisc priceDisc;
str unitId;
Price price;
;
itemId = this.itemNumber;
inventTable = InventTable::find(itemId);
if(!inventTable)
{
return 0;
}
inventDim.initFromInventTable(inventTable);
unitId = inventTable.salesUnitId();
priceGroup = CustTable::find(AccountNum).PriceGroup;
priceDisc = new PriceDisc(ModuleInventPurchSales::Sales,ItemId,inventDim,unitId,today(),qty,accountNum);
if (priceDisc.findPrice(priceGroup))
{
price = priceDisc.price();
}
else if (priceDisc.findItemPrice())
{
price = priceDisc.price();
}
return Price;
}
Or
priceDisc = new PriceDisc(ModuleInventPurchSales::Sales, itemId, InventDim::findOrCreateBlank(), prodBom.UnitId, systemdateget(), 1, custAccount, SalesTable.CurrencyCode);
if (priceDisc.findPrice(custTable.PriceGroup))
{
price = priceDisc.price();
}
else if (priceDisc.findItemPrice())
{
price = priceDisc.price();
}
salesPrice = priceDisc.price();
Or
priceDisc = new PriceDisc(ModuleInventPurchSales::Sales, itemId, InventDim::findOrCreateBlank(), prodBom.UnitId, systemdateget(), 1, custAccount, SalesTable.CurrencyCode);
if (priceDisc.findPrice(custTable.PriceGroup))
{
price = priceDisc.price();
}
else if (priceDisc.findItemPrice())
{
price = priceDisc.price();
}
salesPrice = priceDisc.price();
No comments:
Post a Comment