Friday, 23 June 2017

Get on - hand

static void OnhandbySite(Args _args)
{
    PurchTable  purchtbl;
    PurchLine   purchline;
    InventDim   inventdim,inventdimsite;
    InventDimParm inventDimParm;
   InventOnhand inventonhand;

    purchtbl=   PurchTable::find("PO-000011",false);
     select purchline
        join inventdim
        where purchtbl.PurchId == purchline.PurchId
        && purchline.InventDimId    ==  inventdim.inventDimId;
 
     inventdimsite.inventsiteid = "SGI";
         inventDimParm.initFromInventDim(inventdimsite);
    inventonhand    =   InventOnhand::newParameters(purchline.itemid,inventdimsite,inventDimParm);
    info(strFmt("%1",inventonhand.availphysical()));
}
================================================================

static void OnhandbyInventDimId(Args _args)
{
    PurchTable  purchtbl;
    PurchLine   purchline;
    InventDim   inventdim,inventdimsite;
    InventDimParm inventDimParm;
   InventOnhand inventonhand;

    purchtbl=   PurchTable::find("PO-000011",false);
    while select purchline
        join inventdim
        where purchtbl.PurchId == purchline.PurchId
        && purchline.InventDimId    ==  inventdim.inventDimId
    {
      select inventdimsite where inventdimsite.InventSiteId ==  inventdim.InventSiteId;
         inventDimParm.initFromInventDim(inventdimsite);
    inventonhand    =   InventOnhand::newParameters(purchline.itemid,inventdimsite,inventDimParm);
    info(strFmt("%1",inventonhand.availphysical()));

    }

}



No comments:

Post a Comment