View: dbo.GL_Transaction_Detail__Payroll_Check_Payroll_Item_Liability__View | |||
View definition | |||
-- SUMMARY -- This view produces ledger entries that credit the payroll check payroll item liability accounts. CREATE VIEW dbo.GL_Transaction_Detail__Payroll_Check_Payroll_Item_Liability__View AS select pcpid.payroll_check_payroll_item_distribution_KEY , pcpi.bank_transaction_KEY , bt.checkbook_KEY , cpi.client_KEY , pcpid.liability__gl_account_KEY as gl_account_KEY , 2 /* Credit */ as gl_balance_effect_KEY , glt.gl_period_KEY , pcpid.amount as gl_transaction_amount , bt.transaction_date as gl_transaction_date , bt.description as gl_transaction_description , pcpi.description as gl_transaction_detail_description , glt.gl_transaction_KEY , bt.reference_number as gl_transaction_reference_number , bt.reference_number_sortable as gl_transaction_reference_number_sortable , CAST(10 AS TINYINT) AS gl_transaction_source_expression_KEY -- GLTransactionSourceExpression.PayrollCheckPayrollItemLiability , 2 as gl_transaction_source_KEY -- GLTransactionSource.BankTransaction , bt.bank_transaction_type_KEY as gl_transaction_type_KEY , 0 as is_activity_journal_entry , 101 /* Regular */ as journal_entry_type_KEY , glt.journal_KEY , 1 as source_was_a_distribution , bt.transaction_status_KEY , cpi.sequence_number from dbo.Payroll_Check_Payroll_Item as pcpi inner join dbo.Client_Payroll_Item as cpi on pcpi.client_payroll_item_KEY = cpi.client_payroll_item_KEY inner join dbo.Bank_Transaction as bt on pcpi.bank_transaction_KEY = bt.bank_transaction_KEY inner join dbo.Client as c on cpi.client_KEY = c.client_KEY inner join dbo.GL_Transaction_N_Bank_Transaction as nbt on pcpi.bank_transaction_KEY = nbt.bank_transaction_KEY inner join dbo.GL_Transaction as glt on nbt.gl_transaction_KEY = glt.gl_transaction_KEY inner join dbo.Payroll_Check_Payroll_Item_Distribution as pcpid on pcpi.payroll_check_payroll_item_KEY = pcpid.payroll_check_payroll_item_KEY where bt.bank_transaction_type_KEY = 5 and cpi.payroll_item_type_KEY in (2 /*Deduction*/, 3 /*Employee Contribution*/) and (pcpi.is_excluded_net_pay = 0 or cpi.payroll_item_type_KEY = 3 /* EmployerContribution */) and bt.transaction_status_KEY in (1 /* Live */, 5 /* Unprinted */, 3 /* Voided */, 9 /* ImpoundMemo */, 14 /*ImpoundMemoDeleted*/, 15 /*ImpoundMemoVoided*/) and (bt.data_origin_KEY != 2 -- Payroll Check that came from a CSA client with the TBS or c.csa_client_had_tbs_or_gl_module_marked = 0) -- or GL module marked do not affect accounting. ; | |||