Stored Procedures [dbo].[XLedgerGetEnqueuedAccountTransactions]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@queueIdint4
Permissions
TypeActionOwning Principal
GrantExecuteMssExec
SQL Script
CREATE procedure [dbo].[XLedgerGetEnqueuedAccountTransactions]
    @queueId 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.JournalDate, -- XLTD: Need to check with Joe E. on if this is this or document date or some other date.
        [Description] = coalesce( AcctTransactions.ItemDescription, AcctTransactions.ItemCodeDescription, '<no description>' ), -- XLTD:  Determine if we should refine this "description" behavior further.
        RequestGroupIdentifier = XLedgerJournalEntryBatchItem.RequestGroupIdentifier,
        BankAccountExternalDbId = XLedgerBankAccount.XLedgerDbId,
        BankAccountNumber = AccountingBankAccount.AccountNumber,
        PlaceOnHold = XLedgerJournalEntryBatchItem.PlaceOnHold
    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
    left outer join XLedgerBankAccount on
        XLedgerJournalEntryBatchItem.XLedgerBankAccountFid = XLedgerBankAccount.XLedgerBankAccountId
        and AcctTransactions.TransactionType = 'A/R Cash Receipt'
    left outer join AccountingBankAccount on XLedgerBankAccount.AccountingBankAccountFid = AccountingBankAccount.AccountingBankAccountId
    where XLedgerJournalEntryBatchQueueId = @queueId
end
GO
GRANT EXECUTE ON  [dbo].[XLedgerGetEnqueuedAccountTransactions] TO [MssExec]
GO
Uses