View: dbo.Payable_Transaction_Template_View
View definition
`CREATE VIEW dbo.Payable_Transaction_Template_View AS SELECT ptt.transaction_template_KEY, ptt.vendor_KEY, ptt.payable__gl_account_KEY, ptt.payable_transaction_type_KEY, ptt.reference_number, ptt.purchase_order_number, ptt.vendor__contact_address_type_KEY, ptt.payment_term_KEY, ptt.not_eligible_for_discount_allowed_amount, ptt.memo, ptt.description, ptt.transaction_status_KEY, pttd.amount, pttd.discount_allowed_amount FROM dbo.Payable_Transaction_Template as ptt INNER JOIN ( SELECT transaction_template_KEY, cast(sum(amount) as decimal(17, 2)) as amount, cast(sum(discount_allowed_amount) as decimal(17, 2)) as discount_allowed_amount FROM dbo.Payable_Transaction_Template_Distribution GROUP BY transaction_template_KEY ) AS pttd ON ptt.transaction_template_KEY = pttd.transaction_template_KEY;`