How to Calculate Planned Purchase Order

How to Calculate Planned Purchase Order


class SMCPlannedPOCalc
{       

    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        ReqTrans reqTrans;//reftype,refdate,itemid
        ItemId   _itemId = "Test-SMK1010";
        TransDate _date = str2Date("10/1/2019",213);
        real qty;

        select sum(qty),count(RecId) from reqTrans
            where reqTrans.ItemId == _itemId
            && reqTrans.RefType == ReqRefType::ItemPlannedOrder
            && reqTrans.ReqDate == _date;
        {
            info(strFmt("%1",reqTrans.Qty));
            info(strFmt("%1",reqTrans.RecId));
        }
    }

}



Comments

Popular posts from this blog

How to calculate On Hand Inventory Per Day

How to Calculate Purch Totals in purchase order's Totals Form