View: dbo.Etl_Helper_Ledger_Entry_Ap_Payment_Application_Ap_Dr_View
View definition
`CREATE VIEW dbo.Etl_Helper_Ledger_Entry_Ap_Payment_Application_Ap_Dr_View AS SELECT -- Unique key ppa.gl_transaction_KEY, ledger_entry_type_KEY = 14, /*AP Payment Application AP Dr*/ -- Ledger entry payload ppa.client_KEY, ppa.journal_KEY, ppa.gl_period_KEY, gl_account_KEY = pt.payable__gl_account_KEY, gl_accounting_method_KEY = 1, /*Accrual*/ gl_balance_effect_KEY = 1, /*Debit*/ gl_transaction_type_KEY = 401, /*PayablePaymentApplication*/ transaction_status_KEY = 1, /*Live*/ gl_transaction_date = ppa.application_date, gl_transaction_amount = (ppa.paid_amount + ppa.discount_taken_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 ;`