-- fix EVA view: will now get plan costs for baselines directly
CREATE OR REPLACE FORCE VIEW "V_PLANTA_CUMU_DT827" AS 
  SELECT 
    PROJECTID as PROJECT_ID,
    REPORTID as REPORT_ID,
    TIMESLICE "MONTH",
    TRUNC(TIMESLICE,'YY') "YEAR",
    TC COSTS_TOTAL,
    PC PLAN_TOTAL,
    AE+RE EFFORT_TOTAL,
    AR+RR REVENUES_TOTAL,
    CML_TC COSTS_CUMULATIVE,
    CML_AC COSTS_ACTUAL_CUMULATIVE,
    CML_RC COSTS_REMAIN_CUMULATIVE,
    CML_AE+CML_RE EFFORT_CUMULATIVE,
    CML_AR+CML_RR REVENUES_CUMULATIVE,
    CML_PC PLAN_CUMULATIVE
  FROM DT827_CONDENSED
  WHERE DENSITYRATIO = 3 -- = PR (project level)
;