tests found

This commit is contained in:
2026-04-15 14:07:39 +03:00
parent ade4071eb8
commit 2e0b71cf3f
11 changed files with 69 additions and 111 deletions
+4 -48
View File
@@ -156,60 +156,14 @@
left outer join elma.additional_agreements a on (a.__id=ANY(siv.additional_agreement))
where d._companies=<cfqueryparam cfsqltype="cf_sql_other" value="#d.__id#" null=#!isValid("guid",d.__id)#/>
AND siv.is_actual
AND a.is_actual
AND date_nop <= CURRENT_TIMESTAMP
--AND a.is_actual
--AND date_nop <= CURRENT_TIMESTAMP
AND COALESCE(date_end,CURRENT_TIMESTAMP) >= CURRENT_TIMESTAMP
ORDER BY __index --, version::int
</cfquery>
<!--- <cfquery name="qCompute"> Это неправильно, джойн надо делать на ВМ
WITH
compute as (select
c."Organization_UUID"
,c."Organization"
,c."VDC"
,c."VDC_CPU_Reserv"
,"Cluster"
, round(sum(c."VM_RAM_Allocated")) as ram
, round(sum(CASE WHEN c."VM_is_ON" > 0 THEN c."VM_RAM_Allocated" ELSE 0 END)) as ram_on
, round(sum(c."VM_vCPU_count")) as cpu
, round(sum(CASE WHEN c."VM_is_ON" > 0 THEN c."VM_vCPU_count" ELSE 0 END)) as cpu_on
FROM vmreports.compute c
WHERE ts=(select max(ts) from vmreports.compute)
AND lower(c."WZ")=lower(<cfqueryparam cfsqltype="cf_sql_varchar" value="#d.id_klienta#"/>)
GROUP BY c."Organization_UUID", c."Organization", c."VDC", c."VDC_CPU_Reserv", c."Cluster"
),
storage as (select
"Organization_UUID"
,"Organization"
,"VDC"
,"Cluster"
,"Storage_Policy"
, round(sum(c."Disk_Allocated")) as disk_alloc
, round(sum(c."Disk_Used")) as disk_used
FROM vmreports.storage c
WHERE ts=(select max(ts) from vmreports.storage)
AND lower(c."WZ")=lower(<cfqueryparam cfsqltype="cf_sql_varchar" value="#d.id_klienta#"/>)
GROUP BY c."Organization_UUID",c."Organization",c."VDC",c."Cluster",c."Storage_Policy"
)
select
c."Organization"
,c."VDC"
,c."VDC_CPU_Reserv"
,c."Cluster"
,c.ram
,c.ram_on
,c.cpu
,c.cpu_on
,s."Storage_Policy"
,s.disk_alloc
,s.disk_used
from compute c
full outer join storage s on (c."Organization_UUID"=s."Organization_UUID" AND c."VDC"=s."VDC")
</cfquery> --->
<cfoutput>
<h3>Услуги по данным CRM (версии строк спецификации, только актуальные на сегодня) <!--- (#qService.recordCount#) ---></h3>
</cfoutput>
@@ -227,6 +181,7 @@
<th width="3%">Модель оплаты</th>
<th width="5%">Дата НОУ</th>
<th width="5%">date_end</th>
<th width="5%">Вер.%</th>
<th width="10%">Дополнительное соглашение</th>
</tr>
</thead>
@@ -270,6 +225,7 @@
<td class="c">#__index#</td> --->
<td class="c">#dateFormat(date_nop,'YYYY-MM-DD')#</td>
<td class="c<cfif isDate(date_end) AND date_end LT Now()> err</cfif>">#dateFormat(date_end,'YYYY-MM-DD')#</td>
<td class="#probability_pc#</td>
<td class="c"><a href="additional_agreement.cfm?__id=#additional_agreement_uid#&#tr.fwx#">#additional_agreement#</a> (#status_id# #status#)</td>
</tr>
</cfoutput>