project QadFinancials > class BDPaymentSelection > method GetHeaderPayCodeEnabled

Description

Using the passed in payment format type code, check to see if it has any header payment attributes, return true if so. If it has header attributes, return a table with the fields.


Parameters


icPayFormatTypeCodeinputcharacterPayment Format Type Code
icParentRowIDinputcharacter
tDPaySelPayCodeRefoutputtemp-tableList of header payment attributes
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bdpaymentselection.p)

empty temp-table tDPaySelPayCodeRef.

/* Check if this is request for existing data or not - only for modify 
if icParentRowID <> '':U and 
   icParentRowID <> ?    and
   can-find(tDPaySel where
            tDPaySel.tc_Rowid            = icParentRowID and
            tDPaySel.tcPayFormatTypeCode = icPayFormatTypeCode)
then do:
    for each tDPaySelPayCode where
             tDPaySelPayCode.tc_ParentRowid = icParentRowID:
        create tDPaySelPayCodeRef.
        buffer-copy tDPaySelPayCode to tDPaySelPayCodeRef.
    end.
end.   
/* this is newly selected payment format */
else do:*/
assign viSequence = -1.

<Q-89 run PayFormatCodeByDefault (all) (Read) (NoCache)
   (input icPayFormatTypeCode, (PayFormatTypeCode)
    input ?, (PayFormatGroupSequence)
    input true, (PayFormatGroupIsActive)
    input true, (PayFormatCodeIsActive)
    input true, (PayFormatCodeIsDefault)
    output dataset tqPayFormatCodeByDefault) in BPaymentFormat>

for each tqPayFormatCodeByDefault where
         tqPayFormatCodeByDefault.tcPayFormatGroupLevel = {&PAYFORMATGROUPLEVEL-HEADER}:

    create tDPaySelPayCodeRef.
    assign tDPaySelPayCodeRef.PayFormatGroup_ID           = tqPayFormatCodeByDefault.tiPayFormatGroup_ID
           tDPaySelPayCodeRef.PayFormatCode_ID            = tqPayFormatCodeByDefault.tiPayFormatCode_ID
           tDPaySelPayCodeRef.tcPayFormatGroupCode        = tqPayFormatCodeByDefault.tcPayFormatGroupCode
           tDPaySelPayCodeRef.tcPayFormatGroupDescription = tqPayFormatCodeByDefault.tcPayFormatGroupDescription
           tDPaySelPayCodeRef.tcPayFormatCode             = tqPayFormatCodeByDefault.tcPayFormatCode    
           tDPaySelPayCodeRef.tcPayFormatCodeDescription  = tqPayFormatCodeByDefault.tcPayFormatCodeDescription
           tDPaySelPayCodeRef.tcPayFormatGroupDataType    = tqPayFormatCodeByDefault.tcPayFormatGroupDataType   
           tDPaySelPayCodeRef.tcPayFormatGroupInputOption = tqPayFormatCodeByDefault.tcPayFormatGroupInputOption
           tDPaySelPayCodeRef.tlPayFormatGroupIsMandatory = tqPayFormatCodeByDefault.tlPayFormatGroupIsMandatory
           tDPaySelPayCodeRef.tc_ParentRowid              = icParentRowID
           tDPaySelPayCodeRef.tc_Rowid                    = string(viSequence)
           tDPaySelPayCodeRef.tc_status                   = 'N':U
           viSequence                                     = viSequence - 1.
end.