UFN_GLDISTRIBUTION_ACCOUNTEXISTS
Checks accountnumber in distribution for existence.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@DISTRIBUTION | xml | IN |
Definition
Copy
CREATE function dbo.UFN_GLDISTRIBUTION_ACCOUNTEXISTS
(
@DISTRIBUTION xml
)
returns bit
with execute as caller
as
begin
declare @retval bit = 1
if dbo.UFN_GLACCOUNT_EXISTS() != 0
begin
if exists(select ACCOUNT from UFN_REVENUE_GETGLDISTRIBUTION_FROMITEMLISTXML(@DISTRIBUTION) where ACCOUNT not in (select accountnumber from GLACCOUNT where PDACCOUNTSYSTEMID= '4B121C2C-CCE6-440D-894C-EA0DEF80D50B'))
set @retval = 0
end
else
set @retval = 1
return @retval
end