Browse files

Merge pull request #139 from garyhgohoos/22807-2

Issue #22807:remove join to prjtask
  • Loading branch information...
2 parents e51d6f4 + 9c7f911 commit 37f9cfdbfe4de30f00c6c3faa03282e42da84e54 Greg Pazo committed Mar 5, 2014
Showing with 3 additions and 12 deletions.
  1. +3 −12 dbscripts/metasql/projects-detail_nohierarchy.mql
@@ -5,20 +5,14 @@
-- Non-hierarchical view to support CSV export from Project List screen
-SELECT prj.*, prjtask.*, crmacct_name, cntct_name,
+SELECT prj_id AS id, 1 AS altId,
+ prj.*, crmacct_name, cntct_name,
addr_city, addr_state,
prjtype_descr AS project_type,
CASE WHEN (prj_status='P') THEN 'Planning'
WHEN (prj_status='O') THEN 'In-Process'
WHEN (prj_status='C') THEN 'Completed'
- ELSE 'Unknown' END AS project_status,
- cust_name,
- CASE WHEN (prjtask_status='P') THEN 'Planning'
- WHEN (prjtask_status='O') THEN 'In-Process'
- WHEN (prjtask_status='C') THEN 'Completed'
- ELSE 'Unknown' END AS task_status,
- (prjtask_hours_budget-prjtask_hours_actual) AS prjtask_hours_balance,
- (prjtask_exp_budget-prjtask_exp_actual) AS prjtask_exp_balance
+ ELSE 'Unknown' END AS project_status
<? foreach("char_id_text_list") ?>
, charass_alias<? literal("char_id_text_list") ?>.charass_value AS char<? literal("char_id_text_list") ?>
<? endforeach ?>
@@ -29,13 +23,10 @@ SELECT prj.*, prjtask.*, crmacct_name, cntct_name,
, charass_alias<? literal("char_id_date_list") ?>.charass_value::date AS char<? literal("char_id_date_list") ?>
<? endforeach ?>
FROM prj()
-JOIN prjtask ON (prj_id=prjtask_prj_id)
LEFT JOIN prjtype ON (prj_prjtype_id=prjtype_id)
LEFT JOIN crmacct ON (prj_crmacct_id=crmacct_id)
LEFT JOIN cntct ON (crmacct_cntct_id_1=cntct_id)
LEFT JOIN addr ON (cntct_addr_id=addr_id)
-LEFT JOIN te.teprjtask ON (prjtask_id=teprjtask_prjtask_id)
-LEFT JOIN custinfo ON (teprjtask_cust_id=cust_id)
<? foreach("char_id_text_list") ?>
LEFT OUTER JOIN charass charass_alias<? literal("char_id_text_list") ?> ON ((charass_alias<? literal("char_id_text_list") ?>.charass_target_type='PROJ')
AND (charass_alias<? literal("char_id_text_list") ?>.charass_target_id=prj_id)

0 comments on commit 37f9cfd

Please sign in to comment.