View: dbo.Etl_Helper_Ledger_Entry_Ap_Payment_Application_Payment_Distribution_Cr_View
View definition
`CREATE VIEW dbo.Etl_Helper_Ledger_Entry_Ap_Payment_Application_Payment_Distribution_Cr_View AS SELECT -- Unique key ppa.gl_transaction_KEY, ledger_entry_type_KEY = 16 /*AP Payment Application Payment Distribution Cr*/, ppapd.payable_payment_application_payment_distribution_KEY, -- Ledger entry payload ppa.client_KEY, ppa.journal_KEY, ppa.gl_period_KEY, btd.gl_account_KEY, gl_accounting_method_KEY = NULL /*ACCRUAL AND CASH BASIS*/, gl_balance_effect_KEY = 2 /*Credit*/, gl_transaction_type_KEY = 401 /*PayablePaymentApplication*/, transaction_status_KEY = 1 /*Live*/, gl_transaction_date = ppa.application_date, gl_transaction_amount = ppapd.distributed__paid_amount, gl_transaction_description = ppa.description, gl_transaction_detail_description = ppa.description, gl_transaction_reference_number = ppa.reference_number, gl_transaction_reference_number_sortable = ppa.reference_number_sortable, -- Standard supplemental information gl_transaction_source_expression_KEY = CAST(4 AS TINYINT), -- GLTransactionSourceExpression.PayablePaymentApplication gl_transaction_source_KEY = 5 /*PayablePaymentApplication*/, is_activity_journal_entry = CAST(0 AS BIT), journal_entry_type_KEY = 101 /*Journal entry*/, source_was_a_distribution = CAST(0 AS BIT), sequence_number = 0, workpaper_reference = N'' COLLATE Latin1_General_CI_AS, distribution_workpaper_reference = N'' COLLATE Latin1_General_CI_AS, -- Custom supplemental information pt.vendor_KEY, ppa.payable_transaction_KEY, ppa.payment__gl_transaction_KEY FROM dbo.Payable_Payment_Application_Full_View AS ppa INNER JOIN dbo.Payable_Transaction AS pt ON pt.payable_transaction_KEY = ppa.payable_transaction_KEY INNER JOIN dbo.Payable_Payment_Application_Payment_Distribution AS ppapd ON ppapd.gl_transaction_KEY = ppa.gl_transaction_KEY INNER JOIN dbo.Bank_Transaction_Distribution AS btd ON btd.bank_transaction_distribution_KEY = ppapd.bank_transaction_distribution_KEY ;`