Tuesday, 22 March 2016

Display Methods

Item Name:

 display ItemNameDisplay itemName(Common _common = null)
{
    return InventTable::find(this.ItemId).itemName();

}

ItemGroup:

 display ItemGroupId ItemGroup(Common _common = null)
{
    return InventTable::find(this.ItemId).itemGroupId();
}


CallupQty:

display real callupQty()
{

    //salesline.clear();
    InventTrans     inventTrans;
    SalesLine       salesLine;
    InventTransOrigin inventTransOrigin;


     select sum(Qty) from inventTrans
        where     inventTrans.ItemId == this.ItemId
        join inventTransOrigin
        where inventTransOrigin.RecId == inventTrans.InventTransOrigin
        join   salesLine
        where salesLine.InventTransId == inventTransOrigin.InventTransId
        &&    salesLine.PlanDate >= DateStartMth(this.PlanDate)
        &&    salesLine.PlanDate <= endmth(this.PlanDate);

    return -inventTrans.Qty;

}

LineNumber:

public void insert()
{

    ItemReference       itemReferenceLoc;

    select count(RecId) from itemReferenceLoc;

    this.LineNum = itemReferenceLoc.RecId + 1;

    super();

}


No comments:

Post a Comment