View: dbo.GL_Transaction_Detail__Journal_Entry__View
View definition
`-- SUMMARY -- This view produces ledger entries from journal entries. -- DROP VIEW dbo.GL_Transaction_Journal_Entry_Detail_View CREATE VIEW dbo.GL_Transaction_Detail__Journal_Entry__View AS SELECT _T002."auto_reversing", NULL AS "bank_transaction_distribution_KEY", NULL AS "bank_transaction_KEY", NULL AS "checkbook_KEY", _T002."client_KEY", _T003."workpaper_reference" AS "distribution_workpaper_reference", NULL AS "first__w2_1099_box_type_KEY", _T003."gl_account_KEY", CASE WHEN ((_T003."amount" < 0)) THEN 2 /* Credit */ ELSE 1 /* Debit */ END AS gl_balance_effect_KEY, NULL AS "gl_balancing_entry_KEY", _T001."gl_period_KEY", CASE WHEN ((_T003."amount" < 0)) THEN - _T003."amount" ELSE _T003."amount" END AS "gl_transaction_amount", _T002."transaction_date" AS "gl_transaction_date", _T002."description" AS "gl_transaction_description", _T003."description" AS "gl_transaction_detail_description", _T001."gl_transaction_KEY", _T002."reference_number" AS "gl_transaction_reference_number", _T002."reference_number_sortable" AS "gl_transaction_reference_number_sortable", CAST(7 AS TINYINT) AS gl_transaction_source_expression_KEY, -- GLTransactionSourceExpression.JournalEntry 1 as gl_transaction_source_KEY, -- GLTransactionSource.JournalEntry _T002.journal_entry_type_KEY as gl_transaction_type_KEY, _T002."is_activity_journal_entry", _T003."journal_entry_distribution_KEY", nje.journal_entry_KEY, _T002."journal_entry_misstatement_type_KEY", _T002."journal_entry_type_KEY", _T001."journal_KEY", _T002."schedule_m3_tax_code_attribute_KEY", NULL AS "second__w2_1099_box_type_KEY", 1 AS "source_was_a_distribution", _T002."transaction_status_KEY", NULL AS "vendor_KEY", _T002."workpaper_reference", _T003."sequence_number" FROM dbo.GL_Transaction AS _T001 inner join dbo.GL_Transaction_N_Journal_Entry as nje on _T001.gl_transaction_KEY = nje.gl_transaction_KEY INNER JOIN dbo.Journal_Entry AS _T002 ON nje.journal_entry_KEY = _T002."journal_entry_KEY" INNER JOIN dbo.Journal_Entry_Distribution AS _T003 ON nje.journal_entry_KEY = _T003."journal_entry_KEY" ;`