Functional Description
Purpose
The purpose of Get Default Customer From Site is to get the customer number using site number and related address book fields.
Setup Notes and Prerequisites
Special Logic
The math_numeric value of site will have to be resolved before calling this business function.  The function will return a math_numeric value of 
customer number which will have to be resolved for display to the screen.  The site number must be set up in the customer master for this functionality to 
work.
These fields are reserved for future use: cmode_EV01, szErrorID_DTAI, cSuppressError_EV01, cErrorCode_ERRC.
Technical Specification
0001 // ===============================================================
0002 //              R E V I S I O N S           L O G
0003 // ===============================================================
0004 // DATE                NAME                  SAR             DESCRIPTION
0005 // ===============================================================
0006 // 07/19/2002      EN6859932       6058078 - Created
0007 // ===============================================================
0008 // Note:  This BSFN will return a default 'Customer' based on related address
0009 // book fields with the 'Site' Record.
0010 //
0011 // Variables:
0012 // mnRelAddressNumber_N8RE1 - Used to tell which address number will be related
0013 // based on F0301.
0014 //
0015 // mnRelAddress1Number_AN81  Thru mnRelAdressNumber6_AN86 will be numbers to use
0016 // that correlate with the appropriate N8RE1 field.
0017 //
0018 // cMode_EV01, szErrorID_DTAI, cSuppressError_EV01, and cErrorCode_ERRC are
0019 // reserved for future use.  They are not used.  If additional functionality is
0020 // required of this BSFN, it will be easier to incorporate.
0021 // ===============================================================
0022 //
0023 //    Get RelAddressNumber_N8RE1
0024 //
0025 F0301 Get Ship To Billing Instructions
        BF mnSiteNumber -> mnShipToAddress
        "1" -> cSuppressErrorMsg
        UNDEFINED X  cErrorCode
        UNDEFINED X  szTaxArea
        UNDEFINED X  szTaxExplainationCode
        UNDEFINED X  cApplyFreight
        UNDEFINED X  mnCarrierCode
        UNDEFINED X  szFreightHandlingCode
        UNDEFINED X  szRouteCode
        UNDEFINED X  szStopCode
        UNDEFINED X  szZoneNumber
        UNDEFINED X  szUOMWeight
        UNDEFINED X  szUOMVolume
        UNDEFINED X  mnCommissionCode1
        UNDEFINED X  mnCommissionCode2
        UNDEFINED X  mnCommissionRate1
        UNDEFINED X  mnCommissionRate2
        UNDEFINED X  szDeliveryInstr1
        UNDEFINED X  szDeliveryInstr2
        UNDEFINED X  cSubstitutesAllowed
        VA evt_mnRelAddressNumber_N8RE1 <- mnRelatedAddressNum
        UNDEFINED X  cBillingaddresstype
        UNDEFINED X  cPartialShipAllowed
        UNDEFINED X  cItemRestrictions
        UNDEFINED X  szCompany
        UNDEFINED X  szShipToCustomerPriceGp
        UNDEFINED X  mnMinimumOrderValue
        UNDEFINED X  mnMaximumOrderValue
        UNDEFINED X  szPrintMessage
        UNDEFINED X  szOrderTemplate
        UNDEFINED X  cCreditCheckLevel
        UNDEFINED X  mnDiscountTrade
        UNDEFINED X  cCustomerPORequiredYN
        UNDEFINED X  cExemptCreditHold
        UNDEFINED X  cDeliveryNote
        UNDEFINED X  cInvoiceConsolidation
        UNDEFINED X  cBackordersAllowedYN
        UNDEFINED X  cPartialOrderShipmentsAllowed
        UNDEFINED X  cPricePickListYN
        UNDEFINED X  cCertificateofAnalysis
        UNDEFINED X  mnInvoiceCopies
        UNDEFINED X  szHoldOrdersCode
        UNDEFINED X  cPriorityProcessingCode
        UNDEFINED X  szPaymentTermsAR
        UNDEFINED X  cPaymentInstrumentA
        UNDEFINED X  mnAltPayor
        UNDEFINED X  mnAddressNumberParent
        UNDEFINED X  szCurrencyCode
        UNDEFINED X  szABAmountCode
        UNDEFINED X  cHoldInvoices
        UNDEFINED X  cSendInvoiceToCP
        UNDEFINED X  mnAmountCreditLimit
        UNDEFINED X  szCreditManager
        UNDEFINED X  szCreditMessage
        UNDEFINED X  szTempCreditMessage
        UNDEFINED X  cPersonCorporationCode
        UNDEFINED X  szTaxId
        UNDEFINED X  szGLClass
        UNDEFINED X  szAccountNumber
        UNDEFINED X  szAddlTaxID
0026 //
0027 If VA evt_mnRelAddressNumber_N8RE1 is equal to "0,1"
0028    //
0029    //    Get Parent Address
0030    //
0031    F0150 Get Parent Address
           UNDEFINED X  szOrganizationTypeStructur
           BF mnCustomerNumber <- mnAddressNumberParent
           BF mnSiteNumber -> mnAddressNumber
0032 Else
0033    //
0034    //    Get Related Address Numbers 1 - 6
0035    //
0036    F0101 Get Address Information for OP
           BF mnSiteNumber -> mnAddressNumber
           UNDEFINED X  szAlphaName
           UNDEFINED X  jdAddressEffectiveDate
           UNDEFINED X  szTaxCertificate
           UNDEFINED X  szCreditMessage
           VA evt_mnRelAddressNumber1_AN81 <- mnRelatedAddress1
           VA evt_mnRelAddressNumber2_AN82 <- mnRelatedAddress2
           VA evt_mnRelAddressNumber3_AN83 <- mnRelatedAddress3
           VA evt_mnRelAddressNumber4_AN84 <- mnRelatedAddress4
           VA evt_mnRelAddressNumber5_AN85 <- mnRelatedAddress5
           VA evt_mnRelAddressNumber6_AN86 <- mnRelatedAddress6
           UNDEFINED X  szBranchPlant
           UNDEFINED X  szLanguagePreference
           UNDEFINED X  szErrorMessage
           UNDEFINED X  cSuppressError
           UNDEFINED X  szTaxID
           UNDEFINED X  cPersonCorporationCode
0037    //
0038    // ------------------------------------------------------------------------------
0039    //          DEFAULT APPROPRIATE RELATED ADDRESS NUMBER
0040    // ------------------------------------------------------------------------------
0041    If VA evt_mnRelAddressNumber_N8RE1 is equal to "2"
0042       BF mnCustomerNumber = VA evt_mnRelAddressNumber2_AN82
0043    Else
0044       If VA evt_mnRelAddressNumber_N8RE1 is equal to "3"
0045          BF mnCustomerNumber = VA evt_mnRelAddressNumber3_AN83
0046       Else
0047          If VA evt_mnRelAddressNumber_N8RE1 is equal to "4"
0048             BF mnCustomerNumber = VA evt_mnRelAddressNumber4_AN84
0049          Else
0050             If VA evt_mnRelAddressNumber_N8RE1 is equal to "5"
0051                BF mnCustomerNumber = VA evt_mnRelAddressNumber5_AN85
0052             Else
0053                If VA evt_mnRelAddressNumber_N8RE1 is equal to "6"
0054                   BF mnCustomerNumber = VA evt_mnRelAddressNumber6_AN86
0055                Else
0056                   If VA evt_mnRelAddressNumber_N8RE1 is equal to "7"
0057                      BF mnCustomerNumber = VA evt_mnRelAddressNumber1_AN81
0058                   End If
0059                End If
0060             End If
0061          End If
0062       End If
0063    End If
0064    // ------------------------------------------------------------------------------
0065 End If
0066 //
0067 //    If nothing is set up, default will be customer = site.
0068 //
0069 If BF mnCustomerNumber is equal to 
     Or BF mnCustomerNumber is equal to 
     Or BF mnCustomerNumber is equal to 
0070    BF mnCustomerNumber = BF mnSiteNumber
0071 End If
D1702810 - Get Default Customer From Site
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| mnSiteNumber_AN8 | AN8 | MATH_NUMERIC | OPT | NONE | 
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
  | ||||
| mnCustomerNumber_AN8 | AN8 | MATH_NUMERIC | OPT | NONE | 
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
  | ||||
| cMode_EV01 | EV01 | char | OPT | NONE | 
This is reserved for future use.  | ||||
| szErrorID_DTAI | DTAI | char | OPT | NONE | 
This is reserved for future use.  | ||||
| cSuppressError_EV01 | EV01 | char | OPT | NONE | 
This is reserved for future use.  | ||||
| cErrorCode_ERRC | ERRC | char | OPT | NONE | 
This is reserved for future use.  | ||||
| None | 
| None |