• AX2012 Purchase 的 register功能 (Table:SNY_HachuTable)


    public void registerLines()
    {
        InventTransWMS_Register inventTransWMS_Register;
        TmpInventTransWMS       tmpInventTransWMS;
        InventTrans             inventTrans;
        PurchLine               purchLineLocal;
        InventTransOrigin       inventTransOrigin;
        inventDim               inventDimLocal;

        SNY_HachuTable          hachuTable;
        PurchLine               purchLine;


        hachuTable = SNY_HachuTable::find(this.Z_HachuId);
        select firstOnly purchLine where purchLine.PurchId == hachuTable.Z_PurchId;

        purchLineLocal = purchLine;

        inventTransWMS_Register = InventTransWMS_Register::newStandard(tmpInventTransWMS);
        inventTransOrigin = InventTransOrigin::findByInventTransId(purchLineLocal.InventTransId);
        inventTrans = inventTrans::findByInventTransOrigin(inventTransOrigin.RecId);
        inventTransWMS_Register.createFromInventTrans(inventTrans, inventTrans.inventDim());

        select forUpdate tmpInventTransWMS where tmpInventTransWMS.InventDimId == inventTrans.inventDimId;

        if(this.Z_ReceiveQty)
        {
            TmpInventTransWMS.InventQty = real2int(this.Z_ReceiveQty);

            inventDimLocal = InventDim::find(tmpInventTransWMS.InventDimId);
            inventDimLocal.InventLocationId = this.Z_InventLocationId;
            inventDimLocal.inventBatchId = this.Z_InventBatchId;
            inventDimLocal = InventDim::findOrCreate(inventDimLocal);
        }

        tmpInventTransWMS.InventDimId = inventDimLocal.inventDimId;
        tmpInventTransWMS.update();

        inventTransWMS_Register.parmTmpInventTransWMS(tmpInventTransWMS);
        inventTransWMS_Register.updateInvent(purchLineLocal);

    }

  • 相关阅读:
    023_带标签的break和continue
    5.利用for循环打印九九乘法表
    4.用while和for循环输出1到100之间能被5整除的数,且每行输出3个。
    Python字典由value查key
    python保存字典到文件
    python查找列表中某个元素所有下标的两个方法
    聚类算法评估指标:IoU, mPA, MoF
    二分图与匈牙利算法,Python实现
    行为检测和识别领域的一些研究人员的主页及文章代码的链接
    python 计时
  • 原文地址:https://www.cnblogs.com/fogfog/p/6068542.html
Copyright © 2020-2023  润新知