USP_SIMPLEDATALIST_PDACCOUNTSYSTEM_BYUSER
Returns a list of accounting systems for a given user.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@SECURITYFEATUREID | uniqueidentifier | IN | |
@SECURITYFEATURETYPE | tinyint | IN |
Definition
Copy
CREATE procedure dbo.USP_SIMPLEDATALIST_PDACCOUNTSYSTEM_BYUSER
(
@CURRENTAPPUSERID uniqueidentifier,
@SECURITYFEATUREID uniqueidentifier = null,
@SECURITYFEATURETYPE tinyint = null
)
as
select
PDACCOUNTSYSTEM.ID as VALUE,
PDACCOUNTSYSTEM.NAME as LABEL
from dbo.PDACCOUNTSYSTEM
left join dbo.PDACCOUNTSYSTEMSITE on PDACCOUNTSYSTEM.ID = PDACCOUNTSYSTEMSITE.PDACCOUNTSYSTEMID
where PDACCOUNTSYSTEM.ISBASICGL = 1
and (dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID) = 1 or exists (select 1 from dbo.UFN_SITESFORUSERONFEATURE(@CURRENTAPPUSERID,@SECURITYFEATUREID,@SECURITYFEATURETYPE) where SITEID=[PDACCOUNTSYSTEMSITE].[SITEID] or (SITEID is null and [PDACCOUNTSYSTEMSITE].[SITEID] is null)))
union
select
ID as VALUE,
NAME as LABEL
from dbo.PDACCOUNTSYSTEM
where ISBASICGL = 1 and ISDEFAULT = 1 and exists (select 1 from dbo.UFN_SITESFORUSERONFEATURE(@CURRENTAPPUSERID, @SECURITYFEATUREID, @SECURITYFEATURETYPE) where SITEID is null)
union
select
ID as VALUE,
NAME as LABEL
from dbo.PDACCOUNTSYSTEM
where ISBASICGL = 0 and dbo.UFN_INSTALLEDPRODUCTS_PRODUCTIS('F5138EB6-6666-497A-8FB2-BAE24389AAE4') = 1
order by NAME