Dear All,
In this post, we'll get the Item price from the Trade Agreement irrespective of Purchase or Sales Request forms.
Static method you can write in the Table or in the Extensions classes the syntax may differ if your using extension classes.
public static Amount findSalesItemPrice(ItemId _itemId, CustAccount _custAccount, InventDimId _inventDimId, Qty _qty)
{
PriceDisc priceDisc;
InventTable inventTable = InventTable::find(_itemId);
CustTable custTable = CustTable::find(_custAccount);
InventDim inventDimItem = InventDim::find(_inventDimId);
UnitOfMeasureSymbol unitId = inventTable.inventTableModuleInvent().UnitId;
Amount retPrice;
priceDisc = new PriceDisc(ModuleInventPurchSales::Sales, _itemId, inventDimItem, unitId, systemDateGet(), _qty , _custAccount);
if (priceDisc.findPrice(custTable.PriceGroup))
retPrice = priceDisc.price();
else if (priceDisc.findItemPrice())
retPrice = priceDisc.price();
return retPrice;
}
you can Change the Customer Details to Vendor in case if your in plan to get the Item price for Puchase request forms.
Thank you
Keep Daxing:)
No comments:
Post a Comment