+ %wdcena% as cenam, cenik.novinka, cenik.sleva, cenik.SLEVAPROC,cenik.skladem, ((Trunc((%wdcena%*(1.0+s_dph.procento/100.0))/S_TAB_ROUND.koef))*S_TAB_ROUND.koef) as cenap, vyrobci.nazev AS vyrobce
+ FROM CENIK, S_DPH, vyrobci, SYS_PAR , S_TAB_ROUND
+ WHERE Cenik.ID_CENIK=%sk_ru% AND Cenik.vyrobce=vyrobci.id AND SYS_PAR.ROUND_IMP=S_TAB_ROUND.ID_ROUND
+ AND (s_dph.id_dph=cenik.dph) AND (s_dph.uc_rok=year(today))
+ %wdcena% as cenam, cenik.novinka, cenik.sleva, cenik.SLEVAPROC,cenik.skladem, ((Trunc((%wdcena%*(1.0+s_dph.procento/100.0))/S_TAB_ROUND.koef))*S_TAB_ROUND.koef) as cenap, "" AS vyrobce
+ FROM CENIK, S_DPH, SYS_PAR , S_TAB_ROUND
+ WHERE Cenik.ID_CENIK=%sk_ru% AND SYS_PAR.ROUND_IMP=S_TAB_ROUND.ID_ROUND
+ AND (s_dph.id_dph=cenik.dph) AND (s_dph.uc_rok=year(today))
#endif
SQLStatement: kody_skupiny
+SELECT S_zbozi_sk.kod_skupiny AS kod
+FROM S_zbozi_sk
#if check_kod<>""
+WHERE s_zbozi_sk.kod_skupiny="%check_kod%"
#endif
SQLStatement: tlrabat
#ifexists
+ SELECT S_deal_sk.mn_rab
+ FROM Obchodni_partneri, S_deal_sk
+ WHERE S_deal_sk.deal_id=Obchodni_partneri.deal_sk
+ AND (Obchodni_partneri.intr_user="%jmeno%"
+ AND Obchodni_partneri.intr_pswd="%heslo%")
#then
+ SELECT S_deal_sk.mn_rab AS ANO
+ FROM Obchodni_partneri, S_deal_sk
+ WHERE S_deal_sk.deal_id=Obchodni_partneri.deal_sk
+ AND (Obchodni_partneri.intr_user="%jmeno%"
+ AND Obchodni_partneri.intr_pswd="%heslo%")
#else
+ SELECT NZ_MNRAB AS ANO FROM Sys_par
#endif
SQLStatement: rabaty
#ifexists
+ SELECT cenik.id_cenik,rabat FROM CENIK WHERE cenik.id_cenik=str2int("%sk_ru%") AND rabat<>NONEINTEGER
#then
+ SELECT rabat.metoda, rabat.nad_mnoz, rabat.proc
+ FROM rabat, cenik
+ WHERE cenik.id_cenik=str2int("%sk_ru%") AND
+ rabat.metoda=cenik.rabat
+ ORDER BY rabat.metoda, rabat.nad_mnoz
#else
+ SELECT rabat.metoda, rabat.nad_mnoz, rabat.proc
+ FROM s_zbozi_sk, rabat, cenik
+ WHERE cenik.id_cenik=str2int("%sk_ru%") AND
+ s_zbozi_sk.id_skupiny=cenik.skupina_zbozi AND rabat.metoda=s_zbozi_sk.rabat