UFN_REVENUE_GENERATEGLACCOUNT_SUPPORTSINFORMATIONSOURCE

Determines if the GL mapping functions support a given information source. Can be called by anyone that wants to know if their information source is supported.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@INFORMATIONSOURCECODE tinyint IN

Definition

Copy


            create function dbo.UFN_REVENUE_GENERATEGLACCOUNT_SUPPORTSINFORMATIONSOURCE
            (
                @INFORMATIONSOURCECODE tinyint -- 0 revenue tables, 1 revenue batch tables

            )
            returns bit
            with execute as caller
            as begin
                -- Assume support exists

                declare @RETVAL bit= 1;

                -- We do not check anything around information source = 1 as this is ALWAYS supported


                if (@INFORMATIONSOURCECODE = 1) -- Revenue batch tables

                begin
                    -- By default custom segments are NOT handled for batch validation.

                    -- However if support is added for a given custom segment in batch validation (code added to UFN_PDACCOUNT_GETCUSTOMTABLESFORSEGMENT_2)

                    --   then the client should also edit UFN_PDACCOUNT_CUSTOMSEGEMENTTABLESUPPORTSREVENUEBATCH to show the segment is supported.

                    -- Note that is any ONE segment does not support an information source then all of GL mapping does not support that information source.


                    if (exists (select 1 
                                from dbo.PDACCOUNTTABLESAVAILABLEFORSEGMENT 
                                where (SEGMENTTYPECODE = 2) and
                                        (dbo.UFN_PDACCOUNT_CUSTOMSEGEMENTTABLESUPPORTSREVENUEBATCH(PDACCOUNTTABLESAVAILABLEFORSEGMENT.TABLEID) = 0)))
                        set @RETVAL = 0;

                end

                return @RETVAL;
            end