USP_DATAFORMTEMPLATE_VIEW_FINANCIALTRANSACTIONJOURNALENTRY

The load procedure used by the view dataform template "Financial Transaction Journal Entry View Form"

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter used to load the fields defined on the form.
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.
@GLACCOUNTSTRUCTURE xml INOUT Accounting Elements
@GLENTRIES xml INOUT Journal entries

Definition

Copy

CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_FINANCIALTRANSACTIONJOURNALENTRY
(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @GLACCOUNTSTRUCTURE xml = null output,
    @GLENTRIES xml = null output
)
as
    set nocount on;

    set @DATALOADED = 1;
    set @GLACCOUNTSTRUCTURE = (
                                select
                                    E.ID as ID
                                    ,E.DESCRIPTION as COLUMNHEADER
                                    ,case when E.ELEMENTTYPECODE = 1 then 1 else 0 end as ISACCOUNTSEGMENT
                                    ,E.SEGMENTSEQUENCE
                  ,E.ELEMENTDEFINITIONCODE
                  ,E.SEQUENCE
                  ,E.LENGTH as FIELDLENGTH
                  ,E.SEGMENTCOLUMN
                                from
                                    dbo.PDACCOUNTSTRUCTURE E
                                    inner join dbo.FINANCIALTRANSACTION FT on E.PDACCOUNTSYSTEMID = FT.PDACCOUNTSYSTEMID and FT.ID = @ID
                                order by
                                    E.SEQUENCE
                                for xml raw('ITEM'),type,elements,root('GLACCOUNTSTRUCTURE'),binary base64
                    )
    set @GLENTRIES = dbo.UFN_FINANCIALTRANSACTIONJOURNALENTRIES_TOITEMLISTXML(@ID)

    return 0;