zoukankan      html  css  js  c++  java
  • AX 过账自由文本发票

    通过代码产生自由文本发票,并过账该文本发票。

    View Code
    static void FreeTextInvoicePost(CustAccount _custAccount, LedgerAccount _ledgerAccount)
    {
        CustInvoiceTable    custInvoiceTable;
        CustInvoiceLine     custInvoiceLine;
        CustTable           custTable;
        LedgerTable         ledgerTable;
        CustPostInvoice     custPostInvoice;
        LineNum             lineNum;
        int                 i;
        ;
    
        /// <summary>
        /// The <c>CustInvoiceTable</c> logic is implemented to create single <c>Header</c>.
        /// </summary>
        ttsbegin;
        custTable = CustTable::find(_custAccount);
        custInvoiceTable.initFromCustTable(custTable);
        custInvoiceTable.insert();
        ttscommit;
    
        /// <summary>
        /// The <c>CustInvoiceLine</c> logic is implemented to create multiple <c>Invoice Lines</c>.
        /// </summary>
        for (i = 1; i <= 100; i++)
        {
            ttsbegin;
            ledgerTable = LedgerTable::find(_ledgerAccount);
            custInvoiceLine.clear();
            custInvoiceLine.initValue();
            custInvoiceLine.LedgerAccount = ledgerTable.AccountNum;
            custInvoiceLine.initFromCustInvoiceTable(custInvoiceTable);
            custInvoiceLine.AmountCur = 10.00;
            custInvoiceLine.Description = "Free Text Invoice"+ int2str(i);
            custInvoiceLine.TaxItemGroup = "full";
            custInvoiceLine.ParentRecId = custInvoiceTable.RecId;
    
            //LINE NUM LOGIC.
            if(!lineNum)
            {
             lineNum = CustInvoiceLine::lastLineNum(custInvoiceLine.ParentRecId);
            }
    
            lineNum += 1;
            custInvoiceLine.LineNum = lineNum;
            custInvoiceLine.insert();
            ttscommit;
        }
    
        /// <summary>
        /// The <c>custPostInvoice</c> class is called for posting <c>Free-TextInvoice.</c> records.
        /// </summary>
        custPostInvoice = new CustPostInvoice(custInvoiceTable);
        custPostInvoice.run();
    }

    运行得到结果

  • 相关阅读:
    ASP.NET Core 进程内(InProcess)托管
    ASP.NET Core 中的 Main 方法
    ASP.NET Core Web 项目文件
    5)
    4)
    单词
    html5单词
    3)
    2)
    1)
  • 原文地址:https://www.cnblogs.com/dingkui/p/2687093.html
Copyright © 2011-2022 走看看