Stored Procedures [dbo].[ARCGetCustomerClasses]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
/**
*  Returns the Customer Classes from either:
*        AccountingCustomerClass if XLedger
*        RM00201 in Great Plains (if it exists)
*        RM00201 from the MoversSuite2 table.
*
*    
*/

CREATE PROCEDURE [dbo].[ARCGetCustomerClasses]
as
set nocount on

declare @theAccountingSystemType varchar(50) = dbo.GetAccountingSystemType()

if( @theAccountingSystemType = 'XL' )
begin
    select
        ClassID = ClassCode,
        ClassDescription = ClassDescription
    from AccountingCustomerClass
    order by ClassDescription
end
else -- All other known accounting systems.
begin
    select
        ClassID = rtrim( CLASSID ),
        ClassDescription = rtrim( CLASDSCR )
    from RM00201_Synonym
    order by ClassDescription
end
GO
GRANT EXECUTE ON  [dbo].[ARCGetCustomerClasses] TO [MssExec]
GO
Uses