class BOMExplode
{
date _date = mkDate(22,09,2019);
void itemExplode(ItemId _ItemId, int _level = 0, BOMQty _bomQty = 1)
{
BOM bomTable;
BOMVersion bomVersion;
boolean enable;
InventTestVariableId cvQualityGroupId;
Level level = _level;
while select bomVersion
where bomVersion.ItemId == _itemid
&& bomVersion.Active
&& bomVersion.FromDate <= _date//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone())
&& (!bomVersion.ToDate || bomVersion.ToDate >= _date)//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()))
{
if (bomVersion.RecId)
{
While select bomTable
where bomTable.BOMId == bomVersion.BOMId
{
Info(strFmt("Parent Item: %1 Part Number: %2 Quantity: %3, Level: %4 ",bomVersion.ItemId,bomTable.ItemId, bomTable.bomQty,level));
if (this.hasChild(bomTable.ItemId))
{
this.itemExplode(bomTable.ItemId, level + 1, bomTable.BOMQty);
}
}
}
}
}
boolean hasChild(ItemId _itemId)
{
BOMVersion bomVersion;
boolean ret = false;
select firstonly bomVersion
where bomVersion.ItemId == _itemid
&& bomVersion.Active
&& bomVersion.FromDate <= _date//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone())
&& (!bomVersion.ToDate || bomVersion.ToDate >= _date);//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()));
if (bomVersion.RecId)
{
ret = true ;
}
return ret;
}
public static void Main(Args args)
{
BOMExplode bomExplode = new BOMExplode();
bomExplode.itemExplode("A20HBA06B7");
}
}
{
date _date = mkDate(22,09,2019);
void itemExplode(ItemId _ItemId, int _level = 0, BOMQty _bomQty = 1)
{
BOM bomTable;
BOMVersion bomVersion;
boolean enable;
InventTestVariableId cvQualityGroupId;
Level level = _level;
while select bomVersion
where bomVersion.ItemId == _itemid
&& bomVersion.Active
&& bomVersion.FromDate <= _date//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone())
&& (!bomVersion.ToDate || bomVersion.ToDate >= _date)//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()))
{
if (bomVersion.RecId)
{
While select bomTable
where bomTable.BOMId == bomVersion.BOMId
{
Info(strFmt("Parent Item: %1 Part Number: %2 Quantity: %3, Level: %4 ",bomVersion.ItemId,bomTable.ItemId, bomTable.bomQty,level));
if (this.hasChild(bomTable.ItemId))
{
this.itemExplode(bomTable.ItemId, level + 1, bomTable.BOMQty);
}
}
}
}
}
boolean hasChild(ItemId _itemId)
{
BOMVersion bomVersion;
boolean ret = false;
select firstonly bomVersion
where bomVersion.ItemId == _itemid
&& bomVersion.Active
&& bomVersion.FromDate <= _date//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone())
&& (!bomVersion.ToDate || bomVersion.ToDate >= _date);//DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()));
if (bomVersion.RecId)
{
ret = true ;
}
return ret;
}
public static void Main(Args args)
{
BOMExplode bomExplode = new BOMExplode();
bomExplode.itemExplode("A20HBA06B7");
}
}
Water Hack Burns 2lb of Fat OVERNIGHT
ReplyDeleteMore than 160 000 men and women are losing weight with a simple and secret "water hack" to drop 2 lbs each night while they sleep.
It's simple and works on everybody.
This is how you can do it yourself:
1) Go grab a glass and fill it half full
2) Proceed to learn this awesome hack
so you'll be 2 lbs skinnier as soon as tomorrow!