project QadFinancials > class BVATPeriod > method SetPeriodMarkIDSequence1

Description

PeriodMarkIDSequence1


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BVATPeriod.DataLoadByInput
method BVATPeriod.InitialValues


program code (program2/bvatperiod.p)

/* ========================================================================= */
    /* In case field viPeriodMarkIDSequence1 is not yet assigned then do it here */
    /* ========================================================================= */
    if viPeriodMarkID = 0 or 
       viPeriodMarkID = ?
    then do :
        <Q-1 run PeriodMarkByCompSeqCodeAct (all) (Read) (NoCache)
          (input viCompanyId, (CompanyId)
           input ?, (PeriodMarkId)
           input ?, (PeriodMarkCode)
           input 1, (PeriodMarkSequence)
           input ?, (PeriodMarkIsActive)
           output dataset tqPeriodMarkByCompSeqCodeAct) in BPeriodMark >
        find first tqPeriodMarkByCompSeqCodeAct where 
                   tqPeriodMarkByCompSeqCodeAct.tiCompany_ID         = viCompanyId and 
                   tqPeriodMarkByCompSeqCodeAct.tiPeriodMarkSequence = 1
                   no-lock no-error.
        if available tqPeriodMarkByCompSeqCodeAct
        then assign viPeriodMarkID   = tqPeriodMarkByCompSeqCodeAct.tiPeriodMark_ID
                    vcPeriodMarkCode = tqPeriodMarkByCompSeqCodeAct.tcPeriodMarkCode.
    end. /* if viPeriodMarkIDSequence1 = 0 */