project QadFinancials > class BPaymentSelection > method ExportNLInlandPreselect


Parameters


ocCredBusRelationCodeoutputcharacter
olCredIsIndividualPaymentoutputlogical
ocCredAddressLanguageoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BPaymentSelection.ExportNLInland


program code (program7/bpaymentselection.p)

if tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-INVOICE}    or
   tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-INVOICECORR} or
   tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-CREDITNOTE} or
   tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-CREDITNOTECORR} or
   tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENTINV} or
   tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-ADJUSTMENT}
then do:
    <Q-1 run CreditorByPaysel (all) (Read) (NoCache)
          (input viCompanyId, (CompanyId)
           input ?, (Creditor_ID)
           input tPaySelLine.tcCreditorCode, (CreditorCode)
           input ?, (Employee_ID)
           output dataset tqCreditorByPaysel) in BCreditor >
    find first tqCreditorByPaysel no-error.
    if not available tqCreditorByPaysel
    then do:
        <M-2 run SetMessage
          (input  #T-13'Supplier ($1) is not defined in the system.':80(2960)t-13# (icMessage), 
           input  tPaySelLine.tcCreditorCode (icArguments), 
           input  '':U (icFieldName), 
           input  tPaySelLine.tcCreditorCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-3164':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.
        return.
    end.  
    
    /* Get the Address of the Creditor */
    <Q-3 run AddressByAddressBusRelType (all) (Read) (NoCache)
          (input ?, (AddressTypeId)
           input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressTypeCode)
           input tqCreditorByPaySel.tiBusinessRelation_ID, (BusinessRelationId)
           input tqCreditorByPaySel.tcBusinessRelationCode, (BusinessRelationCode)
           input ?, (AddressId)
           output dataset tqAddressByAddressBusRelType) in BBusinessRelation >
    find first tqAddressByAddressBusRelType no-error.
    if not available tqAddressByAddressBusRelType
    then do:
        <M-4 run SetMessage
          (input  #T-14'No address ($1) is defined for the supplier ($2).':80(2961)t-14# (icMessage), 
           input  tqCreditorByPaySel.tcBusinessRelationCode + chr(2) + tqCreditorByPaySel.tcCreditorCode (icArguments), 
           input  '':U (icFieldName), 
           input  tqCreditorByPaySel.tcBusinessRelationCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-3165':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.
        return.
    end.
    
    /* Get the language of the businessrelation */
    <Q-5 run LanguageByCodeID (all) (Read) (NoCache)
          (input '':U, (LngCode)
           input tqAddressByAddressBusRelType.tiLng_ID, (LngID)
           input ?, (Installed)
           output dataset tqLanguageByCodeID) in BLanguage >
    find first tqLanguageByCodeID no-error.
    if not available tqLanguageByCodeID
    then do:
        
        assign oiReturnStatus = -1.
        return.
    end.
    
    assign ocCredBusRelationCode     = tqCreditorByPaySel.tcBusinessRelationCode
           olCredIsIndividualPayment = tqCreditorByPaySel.tlCreditorIsIndividualPaymnt
           ocCredAddressLanguage     = tqLanguageByCodeID.tcLngCode. 
end.
else do:
    <Q-7 run DebtorByDebtor (all) (Read) (NoCache)
       (input viCompanyId, (CompanyId)
        input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressType)
        input ?, (DebtorId)
        input tPaySelLine.tcCreditorCode, (DebtorCode)
        output dataset tqDebtorByDebtor) in BDebtor>
    find first tqDebtorByDebtor no-error.
    if not available tqDebtorByDebtor
    then do:
        <M-8 run SetMessage
          (input  #T-16'Customer ($1) is not defined in the system.':80(2963)t-16# (icMessage), 
           input  tPaySelLine.tcCreditorCode (icArguments), 
           input  '':U (icFieldName), 
           input  tPaySelLine.tcCreditorCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-3167':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.        
        return.
    end.

    /* Get the Address of the Debtor */
    <Q-9 run AddressByAddressBusRelType (all) (Read) (NoCache)
          (input ?, (AddressTypeId)
           input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressTypeCode)
           input tqDebtorByDebtor.tiBusinessRelation_ID, (BusinessRelationId)
           input tqDebtorByDebtor.tcBusinessRelationCode, (BusinessRelationCode)
           input ?, (AddressId)
           output dataset tqAddressByAddressBusRelType) in BBusinessRelation >
    find first tqAddressByAddressBusRelType no-error.
    if not available tqAddressByAddressBusRelType
    then do:
        <M-10 run SetMessage
          (input  #T-17'No address ($1) was defined for customer ($2).':80(2964)t-17# (icMessage), 
           input  tqDebtorByDebtor.tcBusinessRelationCode + chr(2) + tqDebtorByDebtor.tcDebtorCode (icArguments), 
           input  '':U (icFieldName), 
           input  tqDebtorByDebtor.tcBusinessRelationCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-3168':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.        
        return.
    end.
    
    <Q-11 run LanguageByCodeID (all) (Read) (NoCache)
          (input '':U, (LngCode)
           input tqAddressByAddressBusRelType.tiLng_ID, (LngID)
           input ?, (Installed)
           output dataset tqLanguageByCodeID) in BLanguage >
    find first tqLanguageByCodeID no-error.
    if not available tqLanguageByCodeID
    then do:
        
        assign oiReturnStatus = -1.        
        return.
    end.
    
    assign ocCredBusRelationCode     = tqDebtorByDebtor.tcBusinessRelationCode
           olCredIsIndividualPayment = true
           ocCredAddressLanguage     = tqLanguageByCodeID.tcLngCode. 
end.