Stored Procedures [dbo].[GetCustomerCreditInfo_XLedger]
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_XLedger]
    @inCustomerNumber varchar(15)
as
begin
    set nocount on

    select
        CustomerNumber = AccountingCustomer.CustomerNumber,
        CreditLimit = AccountingCustomer.CreditLimit,
        AccountingCustomerCreditLimitTypeFid = isnull( AccountingCustomer.AccountingCustomerCreditLimitTypeFid,
            NoCreditCreditLimitType.AccountingCustomerCreditLimitTypeId )
    from AccountingCustomer
    left outer join AccountingCustomerCreditLimitType as NoCreditCreditLimitType on NoCreditCreditLimitType.TypeName = 'No Credit'
    where AccountingCustomer.CustomerNumber = @inCustomerNumber
end
GO
GRANT EXECUTE ON  [dbo].[GetCustomerCreditInfo_XLedger] TO [MssExec]
GO
Uses