project QadFinancials > class BDDocument > method CreateHeaderPayCodeForSel

Description

This method create a header pay code for a specific payment selection code.


Parameters


icPaymentSelectionCodeinputcharacterPayment Selection Code
icPayFormatTypeCodeinputcharacterPayment Format Code
olhasHeadersoutputlogicalTrue if it has headers
tDPaySelPayCodeRefDDocoutputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bddocument.p)

empty temp-table tDPaySelPayCodeRefDDoc.
assign olHasHeaders = false.
if icPaymentSelectionCode = "":U or
   icPaymentSelectionCode = ?
then do:
    <M-42 run SetMessage
       (input  trim(#T-60'You must enter the customer payment selection code.':250(57366)T-60#) (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-361461':U (icFcMsgNumber), 
        input  '' (icFcExplanation), 
        input  '' (icFcIdentification), 
        input  '' (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BDDocument>

    assign oiReturnStatus = -1.
    return.
end. /* if icPaymentSelectionCode */

assign viSequence = -1.

<Q-45 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 tDPaySelPayCodeRefDDoc.
    assign tDPaySelPayCodeRefDDoc.PayFormatGroup_ID           = tqPayFormatCodeByDefault.tiPayFormatGroup_ID
           tDPaySelPayCodeRefDDoc.PayFormatCode_ID            = tqPayFormatCodeByDefault.tiPayFormatCode_ID
           tDPaySelPayCodeRefDDoc.tcPayFormatGroupCode        = tqPayFormatCodeByDefault.tcPayFormatGroupCode
           tDPaySelPayCodeRefDDoc.tcPayFormatGroupDescription = tqPayFormatCodeByDefault.tcPayFormatGroupDescription
           tDPaySelPayCodeRefDDoc.tcPayFormatCode             = tqPayFormatCodeByDefault.tcPayFormatCode    
           tDPaySelPayCodeRefDDoc.tcPayFormatCodeDescription  = tqPayFormatCodeByDefault.tcPayFormatCodeDescription
           tDPaySelPayCodeRefDDoc.tcPayFormatGroupDataType    = tqPayFormatCodeByDefault.tcPayFormatGroupDataType   
           tDPaySelPayCodeRefDDoc.tcPayFormatGroupInputOption = tqPayFormatCodeByDefault.tcPayFormatGroupInputOption
           tDPaySelPayCodeRefDDoc.tlPayFormatGroupIsMandatory = tqPayFormatCodeByDefault.tlPayFormatGroupIsMandatory
           tDPaySelPayCodeRefDDoc.tc_ParentRowid              = icPaymentSelectionCode /* this will be set to tDPaySelRefDDoc.tc_Rowid when saving CPMC */
           tDPaySelPayCodeRefDDoc.tc_Rowid                    = icPaymentSelectionCode + string(viSequence)
           tDPaySelPayCodeRefDDoc.tc_status                   = 'N':U
           viSequence                                         = viSequence - 1.
    assign olHasHeaders = true.           
end.