Inventory period open checking using X++
public boolean isInventPeriodOpen(TransDate testDate,
boolean onDateOk = false,
InventTransCurrency_RU _inventTransCurrency = InventTransCurrency_RU::PrimaryCur)
{
#ISOCountryRegionCodes
TransDate closingDate = InventClosing::closingDate(false, _inventTransCurrency);
if (!SysCountryRegionCode::isLegalEntityInCountryRegion([#isoRU]) || testDate)
{
if ((testDate <= closingDate && !onDateOk) ||
(testDate < closingDate && onDateOk))
{
return checkFailed(strFmt("Inventory is closed for physical and financial transactions until %1.",date2StrUsr( closingDate, DateFlags::FormatAll)));
}
}
return true;
}
Comments
Post a Comment