zoukankan      html  css  js  c++  java
  • AX 2012 Creating, Confirming, Invoicing Purchase Order

    static void Esh_CreatePO(Args _args)
    {

    PurchTable purchTable;
    PurchLine purchLine;
    VendTable vendTable = VendTable::find("US_TX_001"); //Specify Vendor Account which is nothing but selecting a Purchase Order
    AxPurchTable axPurchTable;
    AxPurchLine axPurchLine;
    PurchFormLetter purchFormLetter;
    ;

    //Create Purchase order
    purchTable.initFromVendTable(vendTable);

    axPurchTable = axPurchTable::newPurchTable(purchTable);
    axPurchTable.parmPurchaseType(PurchaseType::Purch);
    axPurchTable.parmDocumentStatus(DocumentStatus::PurchaseOrder);


    axPurchTable.parmDeliveryDate(str2date("08/18/2014",213)); // Important because system check the transaction date.
    axPurchTable.parmAccountingDate(str2date("08/18/2014",213));
    axPurchTable.parmPurchStatus(PurchStatus::Backorder);

    axPurchTable.doSave();


    purchLine.initFromPurchTable(purchTable);

    axPurchLine = AxPurchLine::newPurchLine(purchLine);
    axpurchLine.parmItemId("A0001");
    axpurchLine.parmInventDimId('000458');//important because Wherhouse, dimension location, dimension inventory status must be specified.
    axPurchLine.parmPurchQty(10);
    axPurchLine.parmPurchPrice(100);
    axPurchLine.doSave();

    //PO confirmation 
    purchTable = axPurchTable.purchTable();
    purchFormLetter = PurchFormLetter::construct(DocumentStatus::PurchaseOrder);
    purchFormLetter.update(purchTable, strFmt("Inv_%1", purchTable.PurchId));

    // PO invoicing
    purchFormLetter = PurchFormLetter::construct(DocumentStatus::Invoice);
    purchFormLetter.update(purchTable, strFmt("Inv_%1", purchTable.PurchId));
    info(strFmt("purchase order %1 invoiced",purchTable.PurchId));

    }

  • 相关阅读:
    int 类型 占多少字节是由什么决定的
    layer.js漂亮的弹出框
    jquery分页点击后页面置顶
    动态请求页面生成静态页
    弹出ifame页面(jquery.reveal.js)
    Request.QueryString["id"] 、Request.Params["id"] 的强大
    为什么现在改用int.TryParse了
    时间格式(例如:2015-11-09)
    返回前一页
    sql获得某个时间段的数据
  • 原文地址:https://www.cnblogs.com/fogfog/p/6070537.html
Copyright © 2011-2022 走看看