Views [dbo].[vCustomerInformation_XLedger]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created3:09:14 PM Tuesday, June 24, 2025
Last Modified3:09:14 PM Tuesday, June 24, 2025
Columns
Name
CustomerNumber
CustomerName
OnHold
NoCreditFlag
CreditLimit
Inactive
CustomerClass
Address
City
State
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
/**
* Don't use this view directly but instead use the synonym vCustomerInformation.
* vCustomerInformation will either point to this view or to
* vCustomerInformation_Legacy if that is active.
*
* IMPORTANT -- READ ON
* ====================
* The vCustomerInformation view is used in many ProServ custom reports. Don't
* remove/rename any columns from this view without confirmation from ProServ.
* Additionally, this view MUST return the same named columns and in the same
* order as the vCustomerInformation_Legacy view, which is why they can be hot
* swapped when XLedger is activated/deactivated.
*/

create view [dbo].[vCustomerInformation_XLedger]
(
    CustomerNumber,
    CustomerName,
    OnHold,
    NoCreditFlag,
    CreditLimit,
    Inactive,
    CustomerClass,
    [Address],
    City,
    [State]
)
as
select
    CustomerNumber = AccountingCustomer.CustomerNumber,
    CustomerName = AccountingCustomer.[Name],
    OnHold = case
        when AccountingCustomer.OnHold = 1 and AccountingCustomer.Hidden = 1 then 'On Hold, Inactive'
        when AccountingCustomer.OnHold = 1 then 'On Hold'
        when AccountingCustomer.Hidden = 1 then 'Inactive'
        else ''
    end,
    NoCreditFlag = AccountingCustomer.NoCreditFlag,
    CreditLimit = AccountingCustomer.CreditLimit,
    Inactive = AccountingCustomer.Hidden,
    CustomerClass = AccountingCustomerClass.ClassCode,
    [Address] = AccountingCustomerAddress.[Address1],
    City = AccountingCustomerAddress.City,
    [State] = AccountingCustomerAddress.[State]
from AccountingCustomer
inner join AccountingCustomerAddressType on AccountingCustomerAddressType.TypeName = dbo.GetDefaultAccountingCustomerAddressTypeName()
left outer join AccountingCustomerAddress on AccountingCustomerAddress.AccountingCustomerFid = AccountingCustomer.AccountingCustomerId and
    AccountingCustomerAddress.AccountingCustomerAddressTypeFid = AccountingCustomerAddressType.AccountingCustomerAddressTypeId
left outer join AccountingCustomerClass on AccountingCustomerClass.AccountingCustomerClassId = AccountingCustomer.AccountingCustomerClassFid
GO
GRANT SELECT ON  [dbo].[vCustomerInformation_XLedger] TO [MssExec]
GRANT INSERT ON  [dbo].[vCustomerInformation_XLedger] TO [MssExec]
GRANT DELETE ON  [dbo].[vCustomerInformation_XLedger] TO [MssExec]
GRANT UPDATE ON  [dbo].[vCustomerInformation_XLedger] TO [MssExec]
GO
Uses