project QadFinancials > class BDDocument > method DefaultValuesBankNumber


Parameters


icBankNumberinputcharacter
bcGLCodeinput-outputcharacter
biBankPayFormatIDinput-outputinteger
oiGLIDoutputinteger
oiBankNumberIDoutputinteger
ocPaymentInstrumentoutputcharacter
ocPayFormatTypeCodeoutputcharacterPayment Format Type Code
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program3/bddocument.p)

/* =================================================================================================== */
/* Method      : DefaultValuesBankNumber                                                               */
/* Desc        : This method retrieves default values for a bank number                                */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (I)  BankNumber           Bank number                                                      */
/*          (B)  GLCode               G/L code for the Bank Number                                     */
/*          (O)  GLID                 GL ID of default value for BankNumber                            */
/*          (O)  BankNumberID         Default value for BankNumber_ID                                  */
/*          (O)  BankPayFormatID      BankPayFormat ID of default value for BankNumber                 */
/*          (O)  PaymentInstrument    new payment instrument                                           */
/*          (O)  BankPayFormatID      new bank payment format                                          */
/* =================================================================================================== */

assign oiReturnStatus = -98.

if icBankNumber = "":U or icBankNumber = ?
then do:
    assign vcMsg          = #T-2'The Bank Number field cannot be blank.':255(70237)t-2#
           oiReturnStatus = -1.
    <M-3 run SetMessage
       (input  vcMsg (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'QadFin-8293':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BDDocument>
    return.
end. /* if icBankNumber = "" or icBankNumber = ? */

if bcGLCode = "":U then assign bcGLCode = ?.

/* Look for default values for the input bank number */
<Q-1 run BankNumberForOwnBankNumber (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input icBankNumber, (OwnBankNumber)
    input ?, (OwnGLCode)
    input ?, (PayFormatTypeCode)
    output dataset tqBankNumberForOwnBankNumber) in BBankNumber >

find first tqBankNumberForOwnBankNumber where
           tqBankNumberForOwnBankNumber.tcOwnBankNumber    = icBankNumber and
           tqBankNumberForOwnBankNumber.tcOwnGLCode        = bcGLCode     and
           tqBankNumberForOwnBankNumber.tiCompany_ID       = viCompanyId  and
           tqBankNumberForOwnBankNumber.tiBankPayFormat_ID = biBankPayFormatID no-error.
if available tqBankNumberForOwnBankNumber
then do:
    assign bcGLCode          = tqBankNumberForOwnBankNumber.tcOwnGLCode
           oiGLID            = tqBankNumberForOwnBankNumber.tiGL_ID
           oiBankNumberID    = tqBankNumberForOwnBankNumber.tiBankNumber_ID
           biBankPayFormatID = tqBankNumberForOwnBankNumber.tiBankPayFormat_ID.
end. /* if available tqBankNumberForOwnBankNumber */
else do:
    find first tqBankNumberForOwnBankNumber where
               tqBankNumberForOwnBankNumber.tcOwnBankNumber = icBankNumber and
               tqBankNumberForOwnBankNumber.tiCompany_ID    = viCompanyId no-error.
    if available tqBankNumberForOwnBankNumber
    then do:
        assign bcGLCode          = tqBankNumberForOwnBankNumber.tcOwnGLCode
               oiGLID            = tqBankNumberForOwnBankNumber.tiGL_ID
               oiBankNumberID    = tqBankNumberForOwnBankNumber.tiBankNumber_ID
               biBankPayFormatID = tqBankNumberForOwnBankNumber.tiBankPayFormat_ID.
    end. /* if available tqBankNumberForOwnBankNumber */
    else do:
        assign vcMsg          = #T-5'Invalid bank payment format link provided.':255(71085)T-5#
               bcGLCode       = "":U.
               oiReturnStatus = -1.
        <M-4 run SetMessage
           (input  vcMsg (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-8294':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BDDocument>
        return.
    end. /* else do: */
end. /* else do: */

<Q-6 run BankPayFormatByID (all) (Read) (NoCache)
   (input biBankPayFormatID, (BankPayFormatId)
    input viCompanyId, (CompanyId)
    output dataset tqBankPayFormatByID) in BBankPayFormat >
find first tqBankPayFormatByID where
           tqBankPayFormatByID.tiBankPayFormat_ID = biBankPayFormatID and
           tqBankPayFormatByID.tiCompany_ID       = viCompanyId 
           no-error.
if available tqBankPayFormatByID
then assign ocPaymentInstrument = tqBankPayFormatByID.tcPayFormatTypePayInstrument
            ocPayFormatTypeCode = tqBankPayFormatByID.tcPayFormatTypeCode.

if oiReturnStatus = -98 then assign oiReturnStatus = 0.