project QadFinancials > class BDPaymentSelection > method DefaultValuesGLCode

Description

Returns default values based on input GL Code


Parameters


icGLCodeinputcharacterGL Code
ocAccountNumberoutputcharacterAccount Number
ocCurrencyCodeoutputcharacterCurrency Code
ocOwnBankNumberoutputcharacterOwn Bank Number
ocPayFormatTypeCodeoutputcharacterPayment Format Type
ocPayFormatTypePayInstrumentoutputcharacterPayment format type Payment Instrument
oiBankPayFormat_IDoutputintegerBank Payment Format ID
oiBankNumber_IDoutputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program6/bdpaymentselection.p)

    
    if icGLCode = ? or icGLCode = "":U
    then return.
    
    /* We only get the Payformat of AR module */
    <Q-27 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
               oiBankNumber_ID              = tqGLForBankFormat.tiBankNumber_ID
               ocAccountNumber              = tqGLForBankFormat.tcBankNumber
               ocPayFormatTypeCode          = tqGLForBankFormat.tcPayFormatTypeCode
               ocPayFormatTypePayInstrument = tqGLForBankFormat.tcPayFormatTypePayInstrument
               ocCurrencyCode               = if tqGLForBankFormat.tlGLIsLocalCurrency
                                              then vcCompanyLC
                                              else tqGLForBankFormat.tcCurrencyCode.
        <Q-69 run BankNumberOwnBankGLByID (all) (Read) (NoCache)
           (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 */