/// <summary>
        /// Load Invoice Line
        /// </summary>
        /// <param name="journal"></param>
        /// <returns>DocLine Array</returns>
        private DocLine[] LoadLines(MJournal journal)
        {
            MAcctSchema    mSc  = new MAcctSchema(GetCtx(), _C_AcctSchema_ID, null);
            List <DocLine> list = new List <DocLine>();

            MJournalLine[] lines = journal.GetLines(false);
            record_Id = lines[0].GetGL_Journal_ID();

            for (int i = 0; i < lines.Length; i++)
            {
                MJournalLine line = lines[i];

                if (line.GetElementType() == null)
                {
                    DocLine docLine = new DocLine(line, this);
                    //  --  Source Amounts
                    docLine.SetAmount(line.GetAmtSourceDr(), line.GetAmtSourceCr());
                    docLine.SetC_Currency_ID(line.GetC_Currency_ID());
                    docLine.SetConversionRate(line.GetCurrencyRate() == 0 ? 1 : line.GetCurrencyRate());
                    //  --  Converted Amounts
                    // no need to update converted amount here
                    //docLine.SetConvertedAmt(_C_AcctSchema_ID, line.GetAmtAcctDr(), line.GetAmtAcctCr());
                    //  --  Account
                    MAccount account = line.GetAccount();
                    docLine.SetAccount(account);
                    //  -- Quantity
                    docLine.SetQty(line.GetQty(), false);
                    // -- Date
                    docLine.SetDateAcct(journal.GetDateAcct());
                    //	--	Organization of Line was set to Org of Account

                    // Set Description
                    docLine.SetDescription(line.GetDescription());
                    // set primary key value
                    docLine.SetPrimaryKeyValue(line.GetGL_JournalLine_ID());
                    // set GL journal line table ID
                    docLine.SetLineTable_ID(line.Get_Table_ID());

                    list.Add(docLine);
                }
                else
                {
                    string  sql = "SELECT * FROM GL_LineDimension WHERE GL_JournalLine_ID=" + line.Get_ID();
                    DataSet ds  = DB.ExecuteDataset(sql);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow            dr      = null;
                        X_GL_LineDimension lDim    = null;
                        DocLine            docLine = null;
                        MAccount           account = null;
                        for (int m = 0; m < ds.Tables[0].Rows.Count; m++)
                        {
                            dr   = ds.Tables[0].Rows[m];
                            lDim = new X_GL_LineDimension(GetCtx(), dr, null);

                            docLine = new DocLine(lDim, this);
                            //  --  Source Amounts


                            //decimal cRate = line.GetCurrencyRate();
                            //if (cRate == 0)
                            //{
                            //    cRate = 1;
                            //}
                            //decimal amtAcctCr = 0;
                            //decimal amtAcctDr = 0;

                            //MAcctSchema mSc = new MAcctSchema(GetCtx(), _C_AcctSchema_ID, null);


                            if (line.GetAmtSourceDr() != 0)
                            {
                                //amtAcctDr = lDim.GetAmount() * cRate;
                                docLine.SetAmount(lDim.GetAmount(), 0);
                                //amtAcctDr = Decimal.Round(amtAcctDr, mSc.GetStdPrecision());
                            }
                            else
                            {
                                //amtAcctCr = lDim.GetAmount() * cRate;
                                docLine.SetAmount(0, lDim.GetAmount());
                                //amtAcctCr = Decimal.Round(lDim.GetAmount(), mSc.GetStdPrecision());
                            }

                            docLine.SetC_Currency_ID(line.GetC_Currency_ID());
                            docLine.SetConversionRate(line.GetCurrencyRate() == 0 ? 1 : line.GetCurrencyRate());

                            //  --  Converted Amounts
                            // no need to update converted amount here
                            //docLine.SetConvertedAmt(_C_AcctSchema_ID, amtAcctDr, amtAcctCr);
                            //  --  Account
                            account = line.GetAccount();


                            docLine.SetAccount(account);
                            //  -- Quantity
                            docLine.SetQty(lDim.GetQty(), false);
                            // -- Date
                            docLine.SetDateAcct(journal.GetDateAcct());

                            // -- User Dimension
                            docLine = SetUserDimension(lDim, docLine);

                            // Set Description
                            docLine.SetDescription(line.GetDescription());
                            // set primary key value
                            docLine.SetPrimaryKeyValue(line.GetGL_JournalLine_ID());
                            // set GL journal line table ID
                            docLine.SetLineTable_ID(line.Get_Table_ID());

                            //	--	Organization of Line was set to Org of Account
                            list.Add(docLine);
                        }
                    }
                }
            }
            //	Return Array
            int size = list.Count;

            DocLine[] dls = new DocLine[size];
            dls = list.ToArray();
            return(dls);
        }