
[dbo].[MssWebGetAccountingVendorLookupItems]
create procedure dbo.MssWebGetAccountingVendorLookupItems
@inQuery varchar(128) = null,
@inPageNumber int,
@inPageSize int
as
begin
set nocount on;
declare @offset int = @inPageNumber * @inPageSize;
select
Id = AccountingVendor.AccountingVendorId,
VendorName = AccountingVendor.Name,
VendorNumber = AccountingVendor.VendorNumber,
City = AccountingVendorAddress.City,
State = AccountingVendorAddress.State,
OnHold = AccountingVendor.OnHold
from AccountingVendor
left outer join AccountingVendorAddressType on
AccountingVendorAddressType.TypeName = dbo.GetDefaultAccountingVendorAddressTypeName()
left outer join AccountingVendorAddress
on AccountingVendorAddress.AccountingVendorFid = AccountingVendor.AccountingVendorId
and AccountingVendorAddress.AccountingVendorAddressTypeFid = AccountingVendorAddressType.AccountingVendorAddressTypeId
where
@inQuery is null or
AccountingVendor.Name like @inQuery + '%' or
AccountingVendor.VendorNumber like @inQuery + '%'
order by
AccountingVendor.Name asc,
AccountingVendor.VendorNumber asc
offset @offset rows
fetch next @inPageSize rows only;
end
GO
GRANT EXECUTE ON [dbo].[MssWebGetAccountingVendorLookupItems] TO [MssExec]
GO