project QadFinancials > class BJournalEntry > method GetPostingInfoByPostingLineID

Description

GetPostingInfoByPostingLineID; this method will look in the instance tables for a posting of the posting-line and return its posting-date and some other header-iinfo.
Note that the instance-data should already be laoded as this method onlt checks the instance-data and not the db


Parameters


iiPostingLineIDinputintegerPostingLineId
otPostingDateoutputdateThe postingdate of the posting
oiPeriodIDoutputintegerPeriod ID
oiPostingYearPeriodoutputintegerPosting Year Period
ocJournalCodeoutputcharacterThe journal of the posting
ocJournalTypeCodeoutputcharacterThe type of the journal of the posting
ocLayerTypeCodeoutputcharacterThis is the type of the layer that is linked to the journal that is specified on the posting-header
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.ReplaceCInvoicePosting
method BCInvoice.ReverseCInvoicePosting
method BDInvoice.CreateDInvoiceMovementsCrossCyVal


program code (program6/bjournalentry.p)

    
    /* Get the posting-line */
    find tPostingLine where 
         tPostingLine.PostingLine_ID = iiPostingLineID
         no-lock no-error.
    if not available tPostingLine
    then return.
    
    /* Get the posting */
    find tPosting where 
         tPosting.tc_Rowid = tPostingLine.tc_ParentRowid
         no-lock no-error.
    if not available tPosting
    then return.
    
    /* Set the output parameter PostingDate, PeriodID and YearPeriod */
    assign otPostingDate       = tPosting.PostingDate
           oiPostingYearPeriod = tPosting.PostingYear * 100 + tPosting.PostingPeriod.
    if tPosting.PostingYear   <> 0 and 
       tPosting.PostingYear   <> ? and 
       tPosting.PostingPeriod <> 0 and 
       tPosting.PostingPeriod <> ?
    then do :
        <Q-4 run PeriodPrim (all) (Read) (NoCache)
           (input tPosting.Company_ID, (CompanyId)
            input ?, (PeriodId)
            input tPosting.PostingYear, (PeriodYear)
            input tPosting.PostingPeriod, (PeriodPeriod)
            output dataset tqPeriodPrim) in BPeriod >
        find first tqPeriodPrim no-error.
        if available tqPeriodPrim
        then assign oiPeriodId = tqPeriodPrim.tiPeriod_ID. 
    end. /* if tPosting.PostingYear   <> 0 and */
        
    /* Set the output parameter JournalCode and JournalTypeCode */
    assign ocJournalCode     = tPosting.tcJournalCode
           ocLayerTypeCode   = tPosting.tcLayerTypeCode.
    if tPosting.tcJournalCode <> "":U and 
       tPosting.tcJournalCode <> ?
    then do :
        <Q-3 run JournalByJournalIDCodeType (all) (Read) (NoCache)
           (input tPosting.Company_ID, (CompanyId)
            input ?, (JournalID)
            input tPosting.tcJournalCode, (JournalCode)
            input ?, (JournalTypeCode)
            output dataset tqJournalByJournalIDCodeType) in BJournal >
        Find first tqJournalByJournalIDCodeType no-lock no-error.
        if available tqJournalByJournalIDCodeType
        then assign ocJournalTypeCode = tqJournalByJournalIDCodeType.tcJournalTypeCode.
    end. /* if tPosting.tcJournalCode <> "":U and */