Различия

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

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

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

общее.описание/скидки/скидки.и.программы.1556201861.txt.gz · Последние изменения: 2019/04/25 17:17 (внешнее изменение)