project QadFinancials > class BPaymentSelection > method ExportBEAbroadPreselect


Parameters


ocCredBusRelationCodeoutputcharacter
ocCredAddressStreet1outputcharacter
ocCredAddressZipoutputcharacter
ocCredAddressCityoutputcharacter
ocCredAddressCountryoutputcharacter
olCredIsIndividualPaymentoutputlogical
ocCredCountryDescriptionoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BPaymentSelection.ExportBEAbroad


program code (program1/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-13 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-14'Supplier ($1) is not defined in the system.':80(2960)t-14# (icMessage), 
           input  tPaySelLine.tcCreditorCode (icArguments), 
           input  '':U (icFieldName), 
           input  tPaySelLine.tcCreditorCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-1223':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.
        return.
    end.

    /* Get the business relation 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-15'No address ($1) is defined for the supplier ($2).':80(2961)t-15# (icMessage), 
           input  tqCreditorByPaysel.tcBusinessRelationCode + chr(2) + tqCreditorByPaysel.tcCreditorCode (icArguments), 
           input  '':U (icFieldName), 
           input  tqCreditorByPaysel.tcBusinessRelationCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  '':U (icRowid), 
           input  'QADFIN-1224':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>             
        assign oiReturnStatus = -1.        
        return.
    end.
    
    assign ocCredBusRelationCode     = tqCreditorByPaysel.tcBusinessRelationCode
           ocCredAddressStreet1      = tqAddressByAddressBusRelType.tcAddressStreet1
           ocCredAddressZip          = tqAddressByAddressBusRelType.tcAddressZip
           ocCredAddressCity         = tqAddressByAddressBusRelType.tcAddressCity
           ocCredAddressCountry      = tqAddressByAddressBusRelType.tcCountryCode
           olCredIsIndividualPayment = tqCreditorByPaysel.tlCreditorIsIndividualPaymnt. 
           
    /* Get the Country of the Creditor's business relation code */
    <Q-5 run CountryPrim (all) (Read) (NoCache)
          (input tqAddressByAddressBusRelType.tiCountry_ID, (CountryId)
           input tqAddressByAddressBusRelType.tcCountryCode, (CountryCode)
           output dataset tqCountryPrim) in BCountry >
    find first tqCountryPrim no-error.
    if not available tqCountryPrim
    then do:
        <M-6 run SetMessage
          (input  #T-16'Country ($1) is not defined in the system.':80(2962)t-16# (icMessage), 
           input  tqAddressByAddressBusRelType.tcCountryCode (icArguments), 
           input  '':U (icFieldName), 
           input  tqAddressByAddressBusRelType.tcCountryCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-1225':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.        
        return.
    end.
    
    assign ocCredCountryDescription = tqCountryPrim.tcCountryDescription.
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-17'Customer ($1) is not defined in the system.':80(2963)t-17# (icMessage), 
           input  tPaySelLine.tcCreditorCode (icArguments), 
           input  '':U (icFieldName), 
           input  tPaySelLine.tcCreditorCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-1226':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-18'No address ($1) was defined for customer ($2).':80(2964)t-18# (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-1221':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.        
        return.
    end.

    assign ocCredBusRelationCode     = tqDebtorByDebtor.tcBusinessRelationCode
           ocCredAddressStreet1      = tqAddressByAddressBusRelType.tcAddressStreet1
           ocCredAddressZip          = tqAddressByAddressBusRelType.tcAddressZip
           ocCredAddressCity         = tqAddressByAddressBusRelType.tcAddressCity
           ocCredAddressCountry      = tqAddressByAddressBusRelType.tcCountryCode
           olCredIsIndividualPayment = true. 
           
    /* Get the Country of the Debtor's business relation code */
    <Q-11 run CountryPrim (all) (Read) (NoCache)
          (input tqAddressByAddressBusRelType.tiCountry_ID, (CountryId)
           input tqAddressByAddressBusRelType.tcCountryCode, (CountryCode)
           output dataset tqCountryPrim) in BCountry >
    find first tqCountryPrim no-error.
    if not available tqCountryPrim
    then do:
        <M-12 run SetMessage
          (input  #T-19'Country ($1) is not defined in the system.':80(2962)t-19# (icMessage), 
           input  tqAddressByAddressBusRelType.tcCountryCode (icArguments), 
           input  '':U (icFieldName), 
           input  tqAddressByAddressBusRelType.tcCountryCode (icFieldValue), 
           input  'D':U (icType), 
           input  3 (iiSeverity), 
           input  ? (icRowid), 
           input  'QADFIN-1222':U (icFcMsgNumber), 
           input  '' (icFcExplanation), 
           input  '' (icFcIdentification), 
           input  '' (icFcContext), 
           output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
        assign oiReturnStatus = -1.        
        return.
    end.
    
    assign ocCredCountryDescription = tqCountryPrim.tcCountryDescription.
end.