View: dbo.Etl_Helper_Ledger_Entry_Ar_Payment_Application_Ar_Cr_View
View definition
`CREATE VIEW dbo.Etl_Helper_Ledger_Entry_Ar_Payment_Application_Ar_Cr_View AS SELECT -- Unique key arpav.gl_transaction_KEY, ledger_entry_type_KEY = 24 /* AR Payment Application AR Cr */, -- PayloadLedger entry payload j.client_KEY, glt.journal_KEY, glt.gl_period_KEY, art.gl_account_KEY, gl_accounting_method_KEY = 1 /* Accrual */, gl_balance_effect_KEY = 2 /* Credit */, gl_transaction_type_KEY = 570 /*AR payment application*/, transaction_status_KEY = 1 /*Live*/, gl_transaction_date = arpav.application_date, gl_transaction_amount = arpav.paid_amount + arpav.discount_honored_amount, gl_transaction_description = arpav.description, gl_transaction_detail_description = arpav.description, gl_transaction_reference_number = arpav.reference_number, gl_transaction_reference_number_sortable = arpav.reference_number_sortable, -- Standard supplemental information gl_transaction_source_expression_KEY = CAST(1 AS TINYINT), -- GLTransactionSourceExpression.ARPaymentApplication gl_transaction_source_KEY = 8 /*ARPaymentApplication*/, 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 art.customer_KEY FROM dbo.AR_Payment_Application_View AS arpav INNER JOIN dbo.GL_Transaction AS glt ON arpav.gl_transaction_KEY = glt.gl_transaction_KEY INNER JOIN dbo.Journal AS j ON j.journal_KEY = glt.journal_KEY INNER JOIN dbo.AR_Transaction AS art ON arpav.receivable__gl_transaction_KEY = art.gl_transaction_KEY ;`