project QadFinancials > class BDDocument > method DefaultValuesGLCode


Parameters


icGLCodeinputcharacter
ocAccountNumberoutputcharacter
ocCurrencyCodeoutputcharacter
oiBankPayFormat_IDoutputinteger
ocPayFormatTypeCodeoutputcharacter
ocPayFormatTypePayInstrumentoutputcharacter
ocOwnBankNumberoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program6/bddocument.p)

    
    if icGLCode = ?
    then assign icGLCode = "":U.
    
    if icGLCode = "":U
    then return.
    
    /* We only get the Payformat of AR module */
    <Q-66 run GLForBankFormat (first) (Read) (NoCache)
       (input viCompanyId, (CompanyId)
        input icGLCode, (GLCode)
        input {&PAYFORMATMODULE-AR}, (PayFormatTypeModule)
        input ?, (GLID)
        input true, (BankPayFormatIsActive)
        input true, (PayFormatTypeIsActive)
        output dataset tqGLForBankFormat) in BGL>
    find first tqGLForBankFormat where 
               tqGLForBankFormat.tlBankPayFormatIsActive and
               tqGLForBankFormat.tlPayFormatTypeIsActive 
               no-error.
    if available tqGLForBankFormat
    then do:
        assign oiBankPayFormat_ID           = tqGLForBankFormat.tiBankPayFormat_ID
               ocAccountNumber              = tqGLForBankFormat.tcBankNumber
               ocPayFormatTypeCode          = tqGLForBankFormat.tcPayFormatTypeCode
               ocPayFormatTypePayInstrument = tqGLForBankFormat.tcPayFormatTypePayInstrument
               ocCurrencyCode               = if tqGLForBankFormat.tlGLIsLocalCurrency
                                              then vcCompanyLC
                                              else tqGLForBankFormat.tcCurrencyCode.
        <Q-6 run BankNumberOwnBankGLByID (all) (Read) (Cache)
           (input tqGLForBankFormat.tiBankNumber_ID, (BankNumber_ID)
            input ?, (CompanyId)
            output dataset tqBankNumberOwnBankGLByID) in BBankNumber>
        find first tqBankNumberOwnBankGLByID where
                   tqBankNumberOwnBankGLByID.tiBankNumber_ID = tqGLForBankFormat.tiBankNumber_ID
                   no-error.
        if available tqBankNumberOwnBankGLByID
        then assign ocOwnBankNumber = tqBankNumberOwnBankGLByID.tcOwnBankNumber.
    end. /* if available tqGLForBankFormat */