Zmiany pomiędzy wersją 63 and wersją 64 dla DeployerGuide/Customization/ProcessAutomation/Examples

Pokaż
Ignoruj:
Data i czas:
12/31/18 12:07:57 (6 years temu)
Autor:
JP (IP: 83.144.106.170)
Komentarz:

--

Legend:

Bez zmian
Dodane
Usunięte
Zmienione
  • DeployerGuide/Customization/ProcessAutomation/Examples

    v63 v64  
    111111SELECT EXISTS(SELECT * FROM global_sys_conf WHERE (SELECT regexp_matches(objnam,  '_(\d+)$'))[1]::int = {LOGGED_USR_ID}) 
    112112}}} 
     113 
     114 
     115W14.  
     116-- sprawdzenie czy są uzupełnione cechy na kliencie, do którego jest kierowana oferta 
     117SELECT x.potrzeba IS NOT NULL 
     118AND x.segment IS NOT NULL 
     119AND x.zrodlo IS NOT NULL 
     120AND x.branza IS NOT NULL 
     121FROM (   
     122 SELECT  
     123 (SELECT ftopnm FROM features_opt_view fop WHERE fop.featid = 11 AND fop.tbl_id = fod.contid) AS segment, 
     124 (SELECT ftopnm FROM features_opt_view fop WHERE fop.featid = 17 AND fop.tbl_id = fod.contid) AS zrodlo, 
     125 (SELECT ftopnm FROM features_opt_view fop WHERE fop.featid = 13 AND fop.tbl_id = fod.contid) AS branza, 
     126 (SELECT data__ FROM features_text_view ftv WHERE ftv.featid = 26 AND ftv.tbl_id = fod.contid) AS potrzeba       
     127 FROM documents d  
     128 INNER JOIN fk_offer_documents fod USING(doc_id) 
     129 INNER JOIN contacts c1 ON c1.contid = fod.contid 
     130 WHERE d.doc_id = {DOC_ID}) x 
     131 
     132 
     133W15. 
     134-- sprawdzenie czy są uzupełnione cechy na fakturze do którego odbiorcy, lub klienta końcowego oznaczonego na cesze faktury jako klient z bazy - jest kierowana faktura 
     135SELECT x.typ IS NOT NULL 
     136AND x.segment IS NOT NULL 
     137AND x.zrodlo IS NOT NULL 
     138AND x.branza IS NOT NULL 
     139FROM ( 
     140SELECT  
     141 (SELECT text_sum(ftopnm) FROM features_opt_view fop WHERE fop.featid = 12 AND fop.ftopid IN (7,9, 28) AND fop.tbl_id = (COALESCE(ftv.data__::int, v.toctid))) AS typ, 
     142 (SELECT ftopnm FROM features_opt_view fop WHERE fop.featid = 11 AND fop.tbl_id = (COALESCE(ftv.data__::int, v.toctid))) AS segment, 
     143 (SELECT ftopnm FROM features_opt_view fop WHERE fop.featid = 17 AND fop.tbl_id = (COALESCE(ftv.data__::int, v.toctid))) AS zrodlo, 
     144 (SELECT ftopnm FROM features_opt_view fop WHERE fop.featid = 13 AND fop.tbl_id = (COALESCE(ftv.data__::int, v.toctid))) AS branza 
     145 FROM documents d  
     146 INNER JOIN vatnote v USING(doc_id) 
     147 INNER JOIN contacts c1 ON c1.contid = v.toctid 
     148 LEFT JOIN features_text_view ftv ON ftv.tbl_id = d.doc_id AND ftv.featid = 15 -- klient końcowy 
     149 LEFT JOIN contacts c2 ON c2.contid = ftv.data__::int  
     150 WHERE d.doc_id = 352273) x 
     151 
    113152 
    114153== PRZYPISANIA ==