UFN_GLACCOUNT_SETUP

Checks segments and category definitions for accounts.

Return

Return Type
bit

Definition

Copy


CREATE function dbo.UFN_GLACCOUNT_SETUP()
returns bit
with execute as caller
as begin
      declare @OK bit 

    if exists (select  ID from    dbo.PDACCOUNTSTRUCTURE where PDACCOUNTSYSTEMID = '4B121C2C-CCE6-440D-894C-EA0DEF80D50B' and SEGMENTTYPE = 2 and length = 0 )
        set @OK = 0
    else
        if exists (select ID from    dbo.PDACCOUNTSTRUCTURE where PDACCOUNTSYSTEMID = '4B121C2C-CCE6-440D-894C-EA0DEF80D50B' and SEGMENTTYPE = 1 and length =  0 )
            set @OK = 0
        else
            if exists (select ID from    dbo.PDCATEGORYDEFINITION where COALESCE([TOCODE],0)  > 0 and COALESCE([FROMCODE],0) > 0)
                set @OK = 1
            else
                set @OK = 0    
    return @OK
end