project QadFinancials > class BBankEntry > method ValidateCCProjDivForControlGL

Description

method that validates the analytical info for the prepayment control gl account


Parameters


iiPrePayControlGLProfileIdinputintegerPrepayment control gl account profile ID
icCostCentreCodeinputcharacterCost Centre
icProjectCodeinputcharacterProject
icDivisionCodeinputcharacterDivision
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankEntry.CreateDeduction
method BBankEntry.CreatePrepayment


program code (program3/bbankentry.p)

if iiPrePayControlGLProfileId = ? or iiPrePayControlGLProfileId = 0
then return.
   <Q-8 run ProfileLinkByGL (all) (Read) (NoCache)
      (input iiPrePayControlGLProfileId, (GlProfileId)
       input viCompanyId, (CompanyId)
       output dataset tqProfileLinkByGL) in BProfile >

for first tqProfileLinkByGL where
           tqProfileLinkByGL.tiProfile_ID = iiPrePayControlGLProfileId:

    <Q-1 run GLById (all) (Read) (NoCache)
       (input viCompanyId, (CompanyId)
        input tqProfileLinkByGL.tiGL_ID, (GLId)
        output dataset tqGLById) in BGL >

    for first tqGLById where
              tqGLById.tiGL_ID = tqProfileLinkByGL.tiGL_ID:

        if tqGLById.tlGLIsCostCentreAccount and icCostCentreCode = "":U
        then do:
            assign vcMessage      = trim(substitute(#T-2'You must specify a cost center for the control account &1.':150(64889)t-2#,tqGLById.tcGLCode))
                   oiReturnStatus = -1.

            <M-3 run SetMessage
               (input  vcMessage (icMessage), 
                input  '':U (icArguments), 
                input  'BankStateAlloc.tcDocCostCentreCode':U (icFieldName), 
                input  '':U (icFieldValue), 
                input  'E':U (icType), 
                input  3 (iiSeverity), 
                input  '':U (icRowid), 
                input  'QadFin-6820':U (icFcMsgNumber), 
                input  '':U (icFcExplanation), 
                input  '':U (icFcIdentification), 
                input  '':U (icFcContext), 
                output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
        end.

        if tqGLById.tlGLIsProjectAccount and icProjectCode = "":U
        then do:
            assign vcMessage      = trim(substitute(#T-4'You must specify a project for the control account &1.':150(64890)t-4#,tqGLById.tcGLCode))
                   oiReturnStatus = -1.

            <M-5 run SetMessage
               (input  vcMessage (icMessage), 
                input  '':U (icArguments), 
                input  'BankStateAlloc.tcDocProjectCode':U (icFieldName), 
                input  '':U (icFieldValue), 
                input  'E':U (icType), 
                input  3 (iiSeverity), 
                input  '':U (icRowid), 
                input  'QadFin-6821':U (icFcMsgNumber), 
                input  '':U (icFcExplanation), 
                input  '':U (icFcIdentification), 
                input  '':U (icFcContext), 
                output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
        end.

        if tqGLById.tlGLIsDivisionAccount and icDivisionCode = "":U
        then do:
            assign vcMessage      = trim(substitute(#T-6'You must specify a sub-account for the control account &1.':150(64891)t-6#,tqGLById.tcGLCode))
                   oiReturnStatus = -1.

            <M-7 run SetMessage
               (input  vcMessage (icMessage), 
                input  '':U (icArguments), 
                input  'BankStateAlloc.tcDocDivisionCode':U (icFieldName), 
                input  '':U (icFieldValue), 
                input  'E':U (icType), 
                input  3 (iiSeverity), 
                input  '':U (icRowid), 
                input  'QadFin-6822':U (icFcMsgNumber), 
                input  '':U (icFcExplanation), 
                input  '':U (icFcIdentification), 
                input  '':U (icFcContext), 
                output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
        end.
    end.  /* for first tqGLById */
end.  /* for first tqProfileLinkByGL */