Stored Procedures [dbo].[GetCustomerCreditInfo_Legacy]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@inCustomerNumbervarchar(15)15
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/**
*
*    Returns the customer credit limit info for a specific customer number.  This is used by the
*    AR Credit and Collections module.
*
*    Do NOT call this SP directly.  Instead, call GetCustomerCreditInfo_Synonym and then that
*    synonym knows to call this SP or another one based upon that system's active accounting
*    system type.
*/

create procedure [dbo].[GetCustomerCreditInfo_Legacy]
    @inCustomerNumber varchar(15)
as
begin
    set nocount on

    select
        CustomerNumber = RM00101.CUSTNMBR,
        CreditLimit = RM00101.CRLMTAMT,
        AccountingCustomerCreditLimitTypeFid = isnull( AccountingCustomerCreditLimitType.AccountingCustomerCreditLimitTypeId,
            NoCreditCreditLimitType.AccountingCustomerCreditLimitTypeId )
    from RM00101_Synonym as RM00101
    left outer join AccountingCustomerCreditLimitType on AccountingCustomerCreditLimitType.GPCreditLimitTypeCode = RM00101.CRLMTTYP
    left outer join AccountingCustomerCreditLimitType as NoCreditCreditLimitType on NoCreditCreditLimitType.TypeName = 'No Credit'
    where RM00101.CUSTNMBR = @inCustomerNumber
end
GO
GRANT EXECUTE ON  [dbo].[GetCustomerCreditInfo_Legacy] TO [MssExec]
GO
Uses
Used By