UFN_REVENUE_GETCREDITGLDISTRIBUTION
Gets a table of credit GL distribution (Actual or Projected).
Return
Return Type |
---|
table |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@REVENUEID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_REVENUE_GETCREDITGLDISTRIBUTION(@REVENUEID uniqueidentifier)
returns @CREDITGLDISTRIBUTION table
(
ID uniqueidentifier null,
TRANSACTIONTYPECODE tinyint not null,
DEBITCREDIT nvarchar(50) not null,
ACCOUNT nvarchar(100) not null,
AMOUNT money not null,
REFERENCE nvarchar(100) not null
)
as
begin
insert into @CREDITGLDISTRIBUTION
(ID, TRANSACTIONTYPECODE, DEBITCREDIT, ACCOUNT, AMOUNT, REFERENCE)
select
CREDITGLDISTRIBUTION.ID,
CREDITGLDISTRIBUTION.TRANSACTIONTYPECODE,
CREDITGLDISTRIBUTION.TRANSACTIONTYPE as DEBITCREDIT,
CREDITGLDISTRIBUTION.ACCOUNT,
CREDITGLDISTRIBUTION.AMOUNT,
CREDITGLDISTRIBUTION.REFERENCE
from
dbo.CREDITGLDISTRIBUTION
where
CREDITGLDISTRIBUTION.REVENUEID = @REVENUEID
and CREDITGLDISTRIBUTION.OUTDATED = 0;
return
end