From: garyhgohoos Date: Mon, 21 Jul 2014 15:56:58 +0000 (-0400) Subject: Issue #24194:add invoice doc type X-Git-Tag: v4.6.0-beta~6^2 X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=1f89276e30055ebeeb24527b347d730978443221;p=xtuple Issue #24194:add invoice doc type --- diff --git a/foundation-database/public/views/docinfo.sql b/foundation-database/public/views/docinfo.sql index e873cc8ad..3e0d66339 100644 --- a/foundation-database/public/views/docinfo.sql +++ b/foundation-database/public/views/docinfo.sql @@ -364,6 +364,37 @@ CREATE VIEW docinfo AS WHERE ((docass_source_type='S') AND (docass_source_id=cohead_id) AND (cust_id=cohead_cust_id)) +------------ INVOICE ----------- + UNION ALL + SELECT docass_id AS id, + invchead_invcnumber AS target_number, + docass_target_type AS target_type, + docass_target_id AS target_id, + docass_source_type AS source_type, + docass_source_id AS source_id, + cust_name AS name, firstline(invchead_notes) AS description, + docass_purpose AS purpose + FROM docass, invchead, custinfo + WHERE ((docass_target_type='INV') + AND (docass_target_id=invchead_id) + AND (cust_id=invchead_cust_id)) + UNION ALL + SELECT docass_id AS id, + invchead_invcnumber AS target_number, + docass_source_type AS target_type, + docass_source_id AS target_id, + docass_target_type AS source_type, + docass_target_id AS source_id, + cust_name AS name, firstline(invchead_notes) AS description, + CASE + WHEN docass_purpose = 'A' THEN 'C' + WHEN docass_purpose = 'C' THEN 'A' + ELSE docass_purpose + END AS purpose + FROM docass, invchead, custinfo + WHERE ((docass_source_type='INV') + AND (docass_source_id=invchead_id) + AND (cust_id=invchead_cust_id)) ------------ PURCHASE ORDER ----------- UNION ALL SELECT docass_id AS id,