static void inventTransPick(Args _args)
{
    ProdJournalBOM          prodJournalBOM;
    Query                   baseQueryInventTrans;
    InventTransWMS_Pick     inventTransWMS_Pick;
    TmpInventTransWMS       tmpInventTransWMS;
    QueryBuildDataSource    qbdsInventTrans;
    InventTransOriginId     inventTransOriginId;
    InventTrans             inventTransLocal;
    QueryRun                queryRun;
    
    prodJournalBOM = ProdJournalBOM::findRecId(35637162651);

    inventTransOriginId = InventTransOrigin::findByInventTransId(prodJournalBOM.InventTransId).RecId;

    baseQueryInventTrans = new Query();
    qbdsInventTrans = baseQueryInventTrans.addDataSource(tableNum(InventTrans));
    qbdsInventTrans.clearDynalinks();
    qbdsInventTrans.clearRanges();

    qbdsInventTrans.addRange(fieldNum(InventTrans,StatusReceipt)).value(SysQuery::value(StatusReceipt::None));
    qbdsInventTrans.addRange(fieldNum(InventTrans,StatusIssue)).value(SysQuery::range(StatusIssue::Picked,StatusIssue::OnOrder));
    qbdsInventTrans.addRange(fieldNum(InventTrans, InventTransOrigin)).value(SysQuery::value(inventTransOriginId));

    inventTransWMS_Pick = InventTransWMS_Pick::newStandard(tmpInventTransWMS, baseQueryInventTrans);

    queryRun = new QueryRun(baseQueryInventTrans);

    while(queryRun.next())
    {
        inventTransLocal = queryRun.get(tableNum(InventTrans));
        inventTransWMS_Pick.createFromInventTrans(inventTransLocal);

        inventTransWMS_Pick.updateInvent();
    }
}

 

posted on 2020-07-23 16:20  Sunny_Li  阅读(273)  评论(0编辑  收藏  举报