UFN_REVENUE_ISUNREALIZEDGAINLOSSPOSTED
Returns whether or not the given revenue record has posted gain/loss distributions.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@REVENUEID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_REVENUE_ISUNREALIZEDGAINLOSSPOSTED
(
@REVENUEID uniqueidentifier
)
returns bit
with execute as caller
as begin
if not exists
(
select 1
from
dbo.UNREALIZEDGAINLOSSGLDISTRIBUTION
inner join dbo.GLTRANSACTION on UNREALIZEDGAINLOSSGLDISTRIBUTION.GLTRANSACTIONID = GLTRANSACTION.ID
where
UNREALIZEDGAINLOSSGLDISTRIBUTION.REVENUEID = @REVENUEID
and GLTRANSACTION.POSTSTATUSCODE = 0
)
return 0;
return 1;
end