Exemple #1
0
        private DocLine[] LoadLines(MProfitLoss pay)
        {
            List <DocLine> list = new List <DocLine>();

            MProfitLossLines[] lines = pay.GetLines(false);
            //C_AcctSchema = Util.GetValueOfInt(DB.ExecuteScalar("SELECT c_acctschema1_id FROM AD_ClientInfo WHERE AD_Client_ID=" + GetAD_Client_ID()));
            for (int i = 0; i < lines.Length; i++)
            {
                MProfitLossLines line    = lines[i];
                DocLine          docLine = new DocLine(line, this);
                docLine.SetAmount(line.GetC_ProfitAndLoss_ID() != 0 ? line.GetAccountDebit() : Math.Abs(line.GetAccountDebit()),
                                  line.GetC_ProfitAndLoss_ID() != 0 ? line.GetAccountCredit():Math.Abs(line.GetAccountCredit()));
                //docLine.SetConvertedAmt(line.GetC_AcctSchema_ID(), line.GetAccountDebit(), line.GetAccountCredit());

                // set primary key value
                docLine.SetPrimaryKeyValue(line.GetC_ProfitLossLines_ID());
                // set GL journal line table ID
                docLine.SetLineTable_ID(line.Get_Table_ID());
                //
                list.Add(docLine);
            }

            //	Return Array
            DocLine[] dls = new DocLine[list.Count];
            dls = list.ToArray();
            return(dls);
        }