Zmiany pomiędzy wersją 20 and wersją 21 dla DeployerGuide/Custumization/AdvancedReporting/SQLExamples

Pokaż
Ignoruj:
Data i czas:
06/11/14 15:02:32 (10 years temu)
Autor:
JP (IP: 83.18.25.98)
Komentarz:

--

Legend:

Bez zmian
Dodane
Usunięte
Zmienione
  • DeployerGuide/Custumization/AdvancedReporting/SQLExamples

    v20 v21  
    274274) 
    275275 
     276 
     277-- 
     278-- Lista spraw wraz z kolorowaniem statusy 
     279-- 
     280drop sequence if exists lp; 
     281create temp sequence lp start 1; 
     282SELECT nextval('lp') AS lp, * FROM  
     283(SELECT p.prc_id as keyval, 'PROCESS'::TEXT as clsnam, COALESCE(p.dscrpt, '-') AS dscrpt, p.c_name, p.optime::date, c.name_1, 
     284p.fxterm, p.foreda::date, p.forepa, p.credib, p.rspini, 
     285p.lm_dat::date AS ost_mod, 
     286(CASE WHEN p.currpa != 'PLN' THEN 
     287(SELECT cr_avg FROM currency_exchange_table cet WHERE cet.cursmb = p.currpa ORDER BY crdate LIMIT 1)  
     288ELSE 1 END) * p.forepa AS wartosc_wal, 
     289p.currpa AS waluta, 
     290'<div style="background-color: ' || tops.colour || '; width: 100%; height: 100%; padding: 2px">' || tops.dscrpt || '</div>' AS status 
     291FROM processes_view p  
     292LEFT JOIN contacts c USING(contid) 
     293LEFT JOIN types_of_processes_states tops ON (tops.state_::int = p.pr_sta AND tops.clsnam = 'PROCESS') 
     294WHERE p.is_del IS FALSE AND p.is_fix IS false  
     295AND rspuid = {LOGGED_USR_ID} 
     296AND {FILTER_STRING} 
     297AND forepa > 0 
     298ORDER BY tops.prior_, p.forepa DESC) AS x 
    276299}}}