Stored Procedures [dbo].[XLedgerGetEnqueuedAccountTransactions]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@headerIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE procedure [dbo].[XLedgerGetEnqueuedAccountTransactions]
    @headerId int
as
begin

    set nocount on

    select
    
    XLedgerJournalEntryBatchItemId = XLedgerJournalEntryBatchItemId,
    Amount = AcctTransactions.TransactionAmount,
    XglExternalDbId = Xgl.XLedgerDbId,
    TransactionTypeString = AcctTransactions.TransactionType,
    CustomerExternalDbId = XLedgerJournalEntryBatchItem.XLedgerCustomerXLedgerDbId,
    VendorExternalDbId = XLedgerJournalEntryBatchItem.XLedgerSupplierXLedgerDbId,
    NominalGlAccountExternalDbId = NominalXLedgerAccount.ExternalDbId,
    NominalGlAccountBranchObjectValueExternalDbId = XledgerJournalEntryBatchItem.NominalBranchObjectValueXLedgerDbId,
    NominalGlAccountBranchCompanyExternalDbId = XledgerJournalEntryBatchItem.NominalXLedgerCompanyXLedgerDbId,
    OpposingGlAccountExternalDbId = OpposingXLedgerAccount.ExternalDbId,
    OpposingGlAccountBranchObjectValueExternalDbId = XledgerJournalEntryBatchItem.OpposingBranchObjectValueXLedgerDbId,
    OpposingGlAccountBranchCompanyExternalDbId = XledgerJournalEntryBatchItem.OpposingXLedgerCompanyXLedgerDbId,
    PostedDate = AcctTransactions.AccountingPostDate, -- XLTD: this appears nullable, which likely means we should be grabbing this from elsewhere
    [Description] = coalesce( AcctTransactions.ItemDescription, AcctTransactions.ItemCodeDescription, '<no description>' ), -- XLTD:  Determine if we should refine this "description" behavior further.
    RequestGroupIdentifier = XLedgerJournalEntryBatchItem.RequestGroupIdentifier
    from XLedgerJournalEntryBatchQueue
    inner join XLedgerJournalEntryBatch on
        XLedgerJournalEntryBatchQueue.XLedgerJournalEntryBatchFid = XLedgerJournalEntryBatch.XLedgerJournalEntryBatchId
    inner join XLedgerJournalEntryBatchItem on
        XLedgerJournalEntryBatch.XLedgerJournalEntryBatchId = XLedgerJournalEntryBatchItem.XLedgerJournalEntryBatchFid
    inner join AcctTransactions on XLedgerJournalEntryBatchItem.AcctTransactionFid = AcctTransactions.ATPriKey
    inner join Xgl on XLedgerJournalEntryBatchItem.XglFid = Xgl.XglId
    inner join XLedgerAccount NominalXLedgerAccount on XLedgerJournalEntryBatchItem.NominalAccountingAccountFid = NominalXLedgerAccount.AccountingAccountFid
    inner join XLedgerAccount OpposingXLedgerAccount on XLedgerJournalEntryBatchItem.OpposingAccountingAccountFid = OpposingXLedgerAccount.AccountingAccountFid
    where XLedgerJournalEntryBatchQueueId = @headerId
end
GO
GRANT EXECUTE ON  [dbo].[XLedgerGetEnqueuedAccountTransactions] TO [MssExec]
GO
Uses