From 353f5ce5c2d70c0973b2ccf81363856b655e3105 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Apr 2026 18:31:08 +0300 Subject: [PATCH] 033 improvements --- Application.cfc | 16 +-- contragent_rpt.cfm | 254 ++++++++++++++++++++++++++++++++++++++++ crm2cloud.cfm | 87 ++++++++------ crm2cloud_filter.cfm | 92 +++++++++++++++ layout/grid_summary.cfm | 5 +- 5 files changed, 407 insertions(+), 47 deletions(-) create mode 100644 contragent_rpt.cfm create mode 100644 crm2cloud_filter.cfm diff --git a/Application.cfc b/Application.cfc index d4c5ea4..c9c04c7 100644 --- a/Application.cfc +++ b/Application.cfc @@ -75,7 +75,13 @@ - + + + + + + + @@ -96,13 +102,7 @@ - - - - - - - + diff --git a/contragent_rpt.cfm b/contragent_rpt.cfm new file mode 100644 index 0000000..5b412aa --- /dev/null +++ b/contragent_rpt.cfm @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pageInfo=#pageInfo# + id="#d.__id#" + status=#pageInfo.status# + trackOut="tr" + idAttributesOut="id" +/> + + + + + + + + + Отчет по контрагенту + + #d.__name# + [#d.__id#] + + + + + + + + + + + +
+ +
+
__id
+
#d.__id#
+
+ +
+
__name
+ +
+ +
+
_inn
+
#d._inn#
+
+ +
+
_kpp
+
#d._kpp#
+
+ +
+
id_klienta
+
#d.id_klienta#
+
+ + + + + +
+ +
+ + + + + + + + with + status(status, status_id, probability_pc) as (VALUES + ('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70), + ('Тестирование',8,50),('Отправлено ТКП',10,20),('Внутреннее согласование',37,10),('Проработка решения',4,10),('Сбор потребностей',1,0) + ) + select + siv.__id + ,siv.__name + ,siv.user_description + ,siv.discount + ,siv.cnt + ,siv.modifier_code + ,siv.abstractive_service_code + ,siv.is_actual + ,siv.type + ,siv.hash + ,siv.version + ,siv.__index + ,siv.date_nop + ,siv.date_end + ,siv.is_easy + ,siv.params::text + ,a.__id::text as additional_agreement_uid + ,a.__name as additional_agreement + ,p.price + ,p.cnt as p_cnt + ,p.ed_izm + ,p.code + ,p.discount as p_discount + ,p.__id as p_uid + ,p.name + ,s.probability_pc + ,d.__index + ,d.__id as deal_uid + from elma.deals_services siv + join elma.deals d on d.__id=ANY(siv.deal) + join status s on (d.__status_status=s.status_id) + join elma.service_parametrs p ON (p.__id = ANY (siv.params) AND p."__deletedAt" IS NULL) + left outer join elma.additional_agreements a on (a.__id=ANY(siv.additional_agreement)) + where d._companies= + AND siv.is_actual + AND a.is_actual + AND date_nop <= CURRENT_TIMESTAMP + AND COALESCE(date_end,CURRENT_TIMESTAMP) >= CURRENT_TIMESTAMP + order by version::int + + + +

Услуги (версии строк спецификации, только актуальные)

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
__indexuser_descriptionКомпонентыКол-воСуммаКодtypedate_nopdate_endadditional_agreement
#__index##user_description# + + + + + + + + + + + + + + + +
#code##name##p_cnt##ed_izm##nFmt(price,3)##p_discount#%
+
#cnt##nFmt(cost*cnt*(100-(isNumeric(discount)?discount:0))/100)# + #abstractive_service_code#.#modifier_code# + #type##dateFormat(date_nop,'YYYY-MM-DD')##dateFormat(date_end,'YYYY-MM-DD')##additional_agreement#
+ + + + + + + + +
+ \ No newline at end of file diff --git a/crm2cloud.cfm b/crm2cloud.cfm index ac3026d..898fda3 100644 --- a/crm2cloud.cfm +++ b/crm2cloud.cfm @@ -5,12 +5,10 @@ - + - - - + WITH status(status, status_id, probability_pc) as (VALUES ('Закрыта неуспешно',7,0),('Закрыта успешно',6,100),('Договор подписан',5,100),('Договор на подписании',15,90),('Договор на согласовании',12,70), @@ -56,7 +54,7 @@ stair as ( -- рабочая лесенка (инстансы строк, име select * FROM ( SELECT *, MIN(dt_from) OVER (PARTITION BY line_key ORDER BY deal_index desc) running_min_dt - FROM line --WHERE probability_pc > 0 + FROM line WHERE probability_pc > 0 ) t WHERE t.dt_from = t.running_min_dt AND t.dt_to > CURRENT_TIMESTAMP OR t.dt_to IS NULL @@ -128,9 +126,12 @@ select c.quantity as cpu_sold a.cpu as cpu_alloc a.cpu_on as cpu_alloc_on - d.quantity as disk_sold - da.disk_alloc - d.codes as disk_codes + d.codes as disk_codes + d.quantity as disk_sold + da.disk_alloc + z.__name as alloc_company + z.__id as alloc_company_uid + from sold_ram r join deal_stat ds on (r.wz=ds.wz) @@ -138,18 +139,20 @@ join sold_cpu c on (r.wz=c.wz) left join sold_disk d on (r.wz=d.wz) full join alloc a on (r.wz=a.wz) left join disk_alloc da on (a.wz=da.wz) - +left join elma.companies z on (lower(a.wz)=lower(z.id_klienta)) +where 1=1 order by 1,3 - + + - + - + @@ -157,16 +160,13 @@ order by 1,3 Сверка CRM - Cloud - - - - + - + - - -
+ + + - + - + - + - + - + @@ -211,28 +218,34 @@ S3 операции и трафик: #dateFormat(qS3OpsTrfAge.dt_load,'YYYY-M - + - + - - - + + + - - - + + + - - + + diff --git a/crm2cloud_filter.cfm b/crm2cloud_filter.cfm new file mode 100644 index 0000000..04659f7 --- /dev/null +++ b/crm2cloud_filter.cfm @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + Сверка - фильтр + + + + + +
+ +
+
+
+ +
+
+ + +
+
Контрагент
+
+ + #i18("по вхождению подстроки","by substring")# +
+
+ +
+
WZ
+
+ + #i18("по вхождению подстроки","by substring")# +
+
+ +
+
Контрагент
+
+ + select __id::text as __id, __name, id_klienta + from elma.companies + order by __name + + + + +
+
+ + + +
+ + +
+ + + \ No newline at end of file diff --git a/layout/grid_summary.cfm b/layout/grid_summary.cfm index cc56219..9f0ef16 100644 --- a/layout/grid_summary.cfm +++ b/layout/grid_summary.cfm @@ -1,12 +1,13 @@ + - - + +
#wz_sold##client_sold# + + #client_sold# + + #alloc_company# + + #wz_alloc# #status_ids# #ram_codes##ram_sold##ram_alloc##ram_alloc_on# style="background:lightgreen;">#ram_sold# style="background:lightcoral;">#ram_alloc# style="background:lightcoral;">#ram_alloc_on# #cpu_codes##cpu_sold##cpu_alloc##cpu_alloc_on# style="background:lightgreen;">#cpu_sold# style="background:lightcoral;">#cpu_alloc# style="background:lightcoral;">#cpu_alloc_on# #disk_codes##disk_sold##disk_alloc# style="background:lightgreen;">#disk_sold# style="background:lightcoral;">#disk_alloc#