zoukankan      html  css  js  c++  java
  • 创建采购订单

    经常要用代码创建采购和销售订单,需要弄清楚哪些字段是必输的,这段代码经常需要拷贝,放在这里做个备份。
    static void CreatePurchDirectly(Args _args)
    {
        PurchTable  purchTable;
        PurchLine   purchLine;
        InventDim   inventDim;
        ;
        ttsbegin;
        
    //PurchTable
            
    //PurchId
        purchTable.PurchId          =    NumberSeq::newGetNum(PurchParameters::numRefPurchId()).num();
          purchTble.PurchaseType   =    PurchaseType::Purch;
        purchTable.initValue();
        
    //Vend Account
        purchTable.initFromVendTable(VendTable::find('3000'));
        purchTable.insert();
        
    //PurchLine
        purchLine.initFromPurchTable(purchTable);
            
    //ItemId
        purchLine.ItemId                = 'B-pack1';
        purchLine.initFromInventTable(InventTable::find(
    'B-pack1'));
            
    //Qty
        purchLine.PurchQty              = 100;
        purchLine.QtyOrdered            
    = 100;
        purchLine.RemainInventPhysical  
    = 100;
        purchLine.RemainPurchPhysical   
    = 100;
            
    //InventDim     Maybe should add some other dimensions.
        inventDim.InventLocationId      = 'GW';
        purchLine.InventDimId           
    = InventDim::findOrCreate(inventDim).inventDimId;
        purchLine.insert();
        ttscommit;



    }

    static void CreatePurchTableThroughAxPurch(Args _args)
    {
        AxPurchTable            axPurchTable    
    = new AxPurchTable();
        AxPurchLine             axPurchLine     
    = new AxPurchLine();
        AxInventDim_PurchLine   axInventDim     
    = new AxInventDim_PurchLine();
        ;
        
    //PurchTable
            
    //Order Account
        axPurchTable.parmOrderAccount("3000");
        axPurchTable.save();

        
    //PurchLine
            
    //PurchId
        axPurchLine.axPurchTable(axPurchTable);
            
    //ItemId
        axPurchLine.parmItemId("B-pack1");
            
    //Qty
        axPurchLine.parmPurchQty(100);

            
    //InventDim  Maybe should add some other dimensions
        axInventDim.axPurchLine(axPurchLine);
        axInventDim.parmInventLocationId(
    'MW');
        axPurchLine.axInventDim(axInventDim);

        axPurchLine.save();

    }
  • 相关阅读:
    GhostBSD 3.0RC3,基于GNOME的FreeBSD
    Nagios 3.4.3 发布,企业级监控系统
    Jolokia 1.0.6 发布, JMX远程访问方法
    微软希望开发人员不要使 WebKit 成为新版 IE6
    Kwort Linux 3.5 正式版发布
    EJDB 1.0.24 发布,嵌入式 JSON 数据库引擎
    Pale Moon 15.3 Firefox“苍月”优化版发布
    Galera Load Balancer 0.8.1 发布
    SmartSVN V7.5 正式发布
    PostgresQL建立索引如何避免写数据锁定
  • 原文地址:https://www.cnblogs.com/Farseer1215/p/1141923.html
Copyright © 2011-2022 走看看