UFN_PDACCOUNTCODEMAPPING_GETOFFICE

Returns office guid for transaction being generated.

Return

Return Type
uniqueidentifier

Parameters

Parameter Parameter Type Mode Description
@REVENUESPLITID uniqueidentifier IN
@REVENUETRANSACTIONTYPECODE tinyint IN
@REVENUESPLITTYPECODE tinyint IN
@APPLICATIONCODE tinyint IN
@PAYMENTMETHODCODE tinyint IN
@DESIGNATIONID uniqueidentifier IN
@OfficeNumber int IN

Definition

Copy


CREATE function dbo.UFN_PDACCOUNTCODEMAPPING_GETOFFICE
                (
                    @REVENUESPLITID as uniqueidentifier,
                    @REVENUETRANSACTIONTYPECODE tinyint,
                    @REVENUESPLITTYPECODE tinyint,
                    @APPLICATIONCODE tinyint,
                    @PAYMENTMETHODCODE tinyint,
                    @DESIGNATIONID uniqueidentifier,
                    @OfficeNumber integer
                )
returns uniqueidentifier
with execute as caller
as begin
    declare @OfficeID uniqueidentifier
    set @OfficeID = '1A692E94-3214-44B8-A658-F2927230BC25' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 3 : Development - Payments



    if @OfficeNumber = 1  
        begin
            set  @OfficeID = '71F4373E-C817-448B-853C-9E48CE6B6F56' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 1 : Ticketing - Orders

            return  @OfficeID
        end     
    if @OfficeNumber = 2  
        begin
            set  @OfficeID = '081380FF-9639-42B2-A804-6307BF487AFB' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 2    : Ticketing - Payments    

            return  @OfficeID
        end     
    if @OfficeNumber = 3  
        begin
        set @OfficeID = '1A692E94-3214-44B8-A658-F2927230BC25' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 3 : Development - Payments

            return  @OfficeID
        end     
    if @OfficeNumber = 4  
        begin
            set  @OfficeID = '4C565937-8A30-42D0-A0FC-64D269DBC898' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 4 : Development - Pledges

            return  @OfficeID
        end     
    if @OfficeNumber = 5  
        begin
            set  @OfficeID = '31E50EE1-4029-40E4-999D-499375B2AB99' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 5 : Development - Benefits

            return  @OfficeID
        end 
    if @OfficeNumber = 6      
        begin
            set  @OfficeID = '40797EBA-446F-4C83-9907-D65FC38410E0' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 6    : Development - Planned Gifts

            return  @OfficeID
        end 
    if @OfficeNumber = 7      
        begin
            set  @OfficeID = 'CE11F6CF-AE6F-4263-84C4-D268C938FCEB' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 7    : Treasury-Miscellaneous payments 

            return  @OfficeID
        end 
    if @OfficeNumber = 8      
        begin
            set  @OfficeID = '0074260A-6756-44c2-8570-D44778956B1D' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 8    : Treasury-Adjustments

            return  @OfficeID
        end 
    if @OfficeNumber = 9      
        begin
            set  @OfficeID = '7FDFF48B-4A32-439F-805A-8981AF064A6E' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 9    : Fixed Assets

            return  @OfficeID
        end         
    if @OfficeNumber = 11 
        begin
            set  @OfficeID = '1E5CE175-CF60-4FED-985C-46F0F5D4D909' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 11 : Development - Grant Awards

            return  @OfficeID
        end     
  if @OfficeNumber = 12
        begin
            set  @OfficeID = '46920386-2344-42c9-9572-192FBBF06E91' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 12 : Development - Gift Aid

            return  @OfficeID
        end     
    if @OfficeNumber = 13
        begin
            set @OfficeID = 'EA277BDE-867E-4198-A38E-6FB2F972FD32' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 13 : Development - Auction Donations

        end    
    if @OfficeNumber = 14
        begin
            set @OfficeID = 'C4021214-DBB2-4FED-9CB0-6286C0A2DCAC'  --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 13 : Development - Auction Purchase Gain\Loss

        end
    if @OfficeNumber = 15
        begin
            set @OfficeID = '2DBCE41F-9A2C-4FED-9513-BC09CDE4496C' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 13 : Development - Gift Fees

        end
    if @OfficeNumber = 17
        begin
            set @OfficeID = 'C256C03B-8FD7-4D16-B6C3-5C2C05D7FA92' --ID from dbo.PDACCOUNTCODEMAPOFFICE where officeid = 17 : Development - Currency

        end
    return  @OfficeID
end