Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
общее.описание:скидки:скидки.и.программы [2019/04/26 13:06]
a.korobka [Скидки и наценки]
общее.описание:скидки:скидки.и.программы [2019/05/08 10:21] (текущий)
Строка 19: Строка 19:
 declare did integer; declare did integer;
 begin begin
-  for execute statement ('select dname, bdate, fdate, comment, flist,  +  for select dname, bdate, fdate, comment, flist,  
-                                 ​case when pos=0 then did else (select min(dd.did) from discountsprav dd  +             ​case when pos=0 then did else (select min(dd.did) from discountsprav dd  
-                                                                 ​where dd.dtype=1 and dd.dname starting with trim(substring(d.dname from 1 for d.pos-1))) end +                                             ​where dd.dtype=1 and dd.dname starting with trim(substring(d.dname from 1 for d.pos-1))) end 
-                            from (select dname, startdate bdate, disdate fdate, comment, list(f.shortname,​ ascii_char(10)) flist, did, position(''('' in dname) pos +        from (select dname, startdate bdate, disdate fdate, comment, list(f.shortname,​ ascii_char(10)) flist, did, position('​('​ in dname) pos 
-                                    from discountsprav d +                from discountsprav d 
-                                    left join FILIAL_GROUP_LINKS fl on fl.filial_group_id=d.filial_group_id +                left join FILIAL_GROUP_LINKS fl on fl.filial_group_id=d.filial_group_id 
-                                    left join filials f on f.filid=fl.filial +                left join filials f on f.filid=fl.filial 
-                                   ​where dtype=1 +               ​where dtype=1 
-                                     ​and (disdate is null or disdate>​current_date) +                 ​and (disdate is null or disdate>​current_date) 
-                                     ​and (f.filid is null or f.filid>​0 and coalesce(f.dis_in_schedule,​0)=0) +                 ​and (f.filid is null or f.filid>​0 and coalesce(f.dis_in_schedule,​0)=0)  
-                                   ​group by 1, 2, 3, 4, 6, 7) d +               ​group by 1, 2, 3, 4, 6, 7) d 
-                           ​order by 1') +       ​order by 1
-  on external '​192.168.2.47:​MED99'​ as user '​CHEA'​ password '​PDNTP'​+
   into dname, bdate, fdate, comment, flist, did do   into dname, bdate, fdate, comment, flist, did do
   begin   begin
Строка 57: Строка 56:
 declare did integer; declare did integer;
 begin begin
-  for execute statement ('select dname, fdate, schname, comment, +  for select dname, fdate, schname, comment, 
-                                 ​case when pos=0 then d.did else (select min(dd.did) from discountsprav dd where dd.dname starting with substring(d.dname from 1 for d.pos-1) ) end did   +             ​case when pos=0 then d.did else (select min(dd.did) from discountsprav dd  
-                            from (select dname, did, position(''('' in dname) pos, +                                               where dd.dtype=3 and dd.dname starting with trim(substring(d.dname from 1 for d.pos-1))) end did   
-                                         ​cast(minvalue(coalesce(d.disdate, ​''​01.01.2100''), ws.disdate) as date) fdate, +        from (select dname, did, position('​('​ in dname) pos, 
-                                         ​substring(ws.kodoper||'' ​''​||ws.schname from 1 for 65) schname, comment +                     ​cast(minvalue(coalesce(d.disdate,​ '​01.01.2100'​),​ ws.disdate) as date) fdate, 
-                                    from discountsprav d +                     ​substring(ws.kodoper||'​ '​||ws.schname from 1 for 65) schname, comment 
-                                    left join wschema ws on ws.schid=d.schid where dtype=3) d +                from discountsprav d 
-                           ​where (fdate is null or fdate>​current_date) +                left join wschema ws on ws.schid=d.schid ​ 
-                           ​order by 1') +                left join user$pricestructure ps on ps.structid=ws.structid 
-  on external '​192.168.2.47:​MED99'​ as user '​CHEA'​ password '​PDNTP'​+               where dtype=3 ​and d.schid is not null 
 +                 and ps.fdate>​= current_date) d 
 +       ​where (fdate is null or fdate>​current_date) 
 +       ​order by 1
   into dname, fdate, schname, comment, did do   into dname, fdate, schname, comment, did do
   begin   begin

общее.описание/скидки/скидки.и.программы.1556273212.txt.gz · Последние изменения: 2019/04/26 13:06 — a.korobka