zoukankan      html  css  js  c++  java
  • LedgerTransModule class

    How do I find Ledger Transaction Detail?

     

    below X++ Code

    wrote by Jimmy oct 25th 2010

     

    1) declaration

    public class ReportRun extends ObjectRun
    {
        TmpLedgerBase       TmpLedgerBase; //Jimmy 2010-05-27
        LedgerTransModule   LedgerTransModule; //Jimmy 2010-05-27
    }

     

    2) Calc

    public void executeSection() //Jimmy 2010-05-27 calc financial Amount
    {
        CustInvoiceJour     CustInvoiceJour;

    ;
        CustInvoiceJour   = CustInvoiceJour::findFromCustInvoiceTrans(CustInvoiceTrans_1.OrigSalesId,CustInvoiceTrans_1.InvoiceId,CustInvoiceTrans_1.InvoiceDate,CustInvoiceTrans_1.numberSequenceGroup);


        LedgerTransModule   = new LedgerTransModule(CustInvoiceJour.LedgerVoucher,CustInvoiceTrans_1.InvoiceDate);

        LedgerTransModule.createTransModule();
        TmpLedgerBase.setTmpData(LedgerTransModule.transModule());

        super();
    }

     

    3)get values from temp table

    display Amount Amount()

    {
    ;
        select firstonly TmpLedgerBase
            where TmpLedgerBase.id == CustInvoiceTrans_1.ItemId;
        return - TmpLedgerBase.Amount;
    }

    Example:

    For a Purchase Order transaction that is posted to the ledger, how can I find the vendor and the item that was purchased?  I am currently using LedgerTrans table and I am able to see the ledger transaction type (Purchase Order,Production, Inventory, Payment, etc.), but how do I get to the detail level for a purchase order transaction to determine what item was purchased and from whom?

    Jobs below as

    static void Jimmy_ledgerTransfromVoucher(Args _args)
    {
        LedgerTrans             ledgerTrans;
        LedgerTransModule       ledgerTransModule;
        TmpLedgerBase           tmpLedgerBase;
        ;
        while select Voucher,TransDate from ledgertrans
        where ledgertrans.TransType == ledgertransType::Purch
        {
            ledgerTransModule = new LedgerTransModule(ledgerTrans.Voucher,ledgertrans.TransDate);
            ledgerTransModule.createTransModule();
            tmpLedgerBase.setTmpData(ledgerTransModule.transModule());
    
            while select tmpLedgerBase
                where tmpLedgerBase.Module           == SysModule::Purch
                ||    tmpLedgerBase.Module           == SysModule::Invent
                ||    tmpLedgerBase.OriginalDocument == OriginalDocument::PurchaseInvoice
            {
                info(strfmt("Amoount = %1,id = %2,IdName = %3,Module = %4,OrgDocument = %5,voucher %6",
                            tmpLedgerBase.Amount,
                            tmpLedgerBase.id,
                            tmpLedgerBase.IdName,
                            tmpLedgerBase.Module,
                            tmpLedgerBase.OriginalDocument,
                            tmpLedgerBase.Voucher)
                    );
            }
            break;
        }
    
    }
    
  • 相关阅读:
    NXOpen测最最近距离和投影距离
    abp学习日志三(实体&聚合根)
    abp学习日志二(DDD)
    abp学习日记一(安装)
    abp学习日记 初记
    kubernetes学习——minikube入门
    windows10安装Kubernetes和MiniKube
    windows10安装docker desktop(非VMBox)
    Asp.netCore3.0 Docker 阿里云 部署 Demo
    小宝与老财
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1860518.html
Copyright © 2011-2022 走看看