}       //	reverseAccrualIt

        /// <summary>
        ///	Reverse Accrual.	Flip Dr/Cr - Use Today's date
        /// </summary>
        /// <param name="GL_JournalBatch_ID">reversal batch</param>
        /// <returns> journal or null </returns>
        public MJournal ReverseAccrualIt(int GL_JournalBatch_ID)
        {
            log.Info(ToString());
            //	Journal
            MJournal reverse = new MJournal(this);

            reverse.SetGL_JournalBatch_ID(GL_JournalBatch_ID);
            reverse.SetDateDoc(DateTime.Now);
            reverse.Set_ValueNoCheck("C_Period_ID", null);              //	reset
            reverse.SetDateAcct(reverse.GetDateDoc());
            //	Reverse indicator
            String description = reverse.GetDescription();

            if (description == null)
            {
                description = "** " + GetDocumentNo() + " **";
            }
            else
            {
                description += " ** " + GetDocumentNo() + " **";
            }
            reverse.SetDescription(description);
            if (!reverse.Save())
            {
                return(null);
            }

            //	Lines
            reverse.CopyLinesFrom(this, reverse.GetDateAcct(), 'R');
            //
            SetProcessed(true);
            SetDocAction(DOCACTION_None);
            return(reverse);
        }       //	reverseAccrualIt
예제 #2
0
        } //	MJournalLine

        /// <summary>
        /// Parent Constructor
        /// </summary>
        /// <param name="parent">journal</param>
        public MJournalLine(MJournal parent) : this(parent.GetCtx(), 0, parent.Get_TrxName())
        {
            //this (parent.getCtx(), 0, parent.get_TrxName());
            SetClientOrg(parent);
            SetGL_Journal_ID(parent.GetGL_Journal_ID());
            SetC_Currency_ID(parent.GetC_Currency_ID());
            SetC_ConversionType_ID(parent.GetC_ConversionType_ID());
            SetDateAcct(parent.GetDateAcct());
        } //	MJournalLine