USP_DATALIST_REVENUETRANSACTION_SPLIT

This datalist returns a list of splits for a revenue detail within a revenue transaction context.

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN Input parameter indicating the context ID for the data list.

Definition

Copy


                CREATE procedure dbo.USP_DATALIST_REVENUETRANSACTION_SPLIT (@ID uniqueidentifier)
                as 
                    set nocount on;

                    select
                        [SPLITS].ID,
                        dbo.UFN_DESIGNATION_BUILDNAME([SPLITS].DESIGNATIONID) as 'Designation',
                        [SPLITS].TRANSACTIONAMOUNT,
                        [SPLITS].TRANSACTIONCURRENCYID
                    from dbo.REVENUESPLIT as [SPLITS] 
                    where [SPLITS].REVENUEID = @ID and [SPLITS].DESIGNATIONID is not null
                    /* 
                        JLM 12/15/2011
                        Ordering by ID returns these rows in a seemingly random order.
                        'Designation' seems like a more reasonable ordering criteria.
                        Using DATEADDED as a second ordering ensures order consistency
                        in the off case that 'Designation' is the same for two rows.

                        I can't imagine this breaking any code unless it was hard coding
                        the IDs to be in a successive order (which would be bad anyway).
                    */
                    --order by [SPLITS].ID;

                    order by Designation, [SPLITS].DATEADDED;