018 select fix dt_to
This commit is contained in:
+1
-1
@@ -489,7 +489,7 @@
|
||||
<td class="c">#date_accept#</td>
|
||||
<td class="c">#__index#</td>
|
||||
<td class="c">#dateFormat(date_nop,'YYYY-MM-DD')#</td>
|
||||
<td class="c">#dateFormat(date_end,'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="c">#is_easy#</td>
|
||||
|
||||
<!--- <td class="c">#additional_agreement_uid#</td> --->
|
||||
|
||||
+22
-18
@@ -59,6 +59,7 @@ stair as ( -- рабочая лесенка (инстансы строк, име
|
||||
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
|
||||
),
|
||||
alloc as (select c."WZ" as wz
|
||||
, round(sum(c."VM_RAM_Allocated")) as ram
|
||||
@@ -92,7 +93,7 @@ z.id_klienta as WZ, z.__name as client, z.__id as company_uid, round(sum(c.cnt*o
|
||||
FROM stair o
|
||||
JOIN elma.companies z on (o._companies=z.__id)
|
||||
LEFT OUTER JOIN component c on (c.__id = ANY (o.params))
|
||||
WHERE c.code LIKE 'iaas.ngc.%.vcpu-_'
|
||||
WHERE c.code LIKE 'iaas.ngc.%.vcpu%-_'
|
||||
GROUP BY z.id_klienta, z.__id, z.__name
|
||||
),
|
||||
sold_disk as (SELECT
|
||||
@@ -113,21 +114,24 @@ GROUP BY z.id_klienta
|
||||
)
|
||||
|
||||
select
|
||||
r.wz as wz_sold,
|
||||
r.client as client_sold, r.company_uid,
|
||||
a.wz as wz_alloc,
|
||||
ds.status_ids,
|
||||
r.codes as ram_codes,
|
||||
r.quantity as ram_sold,
|
||||
a.ram as ram_alloc,
|
||||
a.ram_on as ram_alloc_on,
|
||||
c.codes as cpu_codes,
|
||||
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:field_set titleMapOut="titleMap" lengthOut="fieldCount">
|
||||
<d:field title="WZ Elma">r.wz as wz_sold</d:field>
|
||||
<d:field title="Клиент">r.client as client_sold</d:field>
|
||||
<d:field title="WZ Cloud">r.company_uid</d:field>
|
||||
<d:field title="Статусы">a.wz as wz_alloc</d:field>
|
||||
<d:field title="Коды RAM">ds.status_ids</d:field>
|
||||
<d:field title="RAM GB Elma">r.codes as ram_codes</d:field>
|
||||
<d:field title="RAM Cloud">r.quantity as ram_sold</d:field>
|
||||
<d:field title="RAM Cloud ON">a.ram as ram_alloc</d:field>
|
||||
<d:field title="">a.ram_on as ram_alloc_on</d:field>
|
||||
<d:field title="Коды CPU">c.codes as cpu_codes</d:field>
|
||||
<d:field title="CPU Elma">c.quantity as cpu_sold</d:field>
|
||||
<d:field title="CPU Cloud">a.cpu as cpu_alloc</d:field>
|
||||
<d:field title="CPU Cloud ON">a.cpu_on as cpu_alloc_on</d:field>
|
||||
<d:field title="Коды Дисков">d.quantity as disk_sold</d:field>
|
||||
<d:field title="Диски GB Elma">da.disk_alloc</d:field>
|
||||
<d:field title="Диски Cloud">d.codes as disk_codes</d:field>
|
||||
</d:field_set>
|
||||
from sold_ram r
|
||||
join deal_stat ds on (r.wz=ds.wz)
|
||||
join sold_cpu c on (r.wz=c.wz)
|
||||
@@ -142,10 +146,10 @@ order by 1,3
|
||||
|
||||
|
||||
<cfif isDefined("output_xls")>
|
||||
<layout:xml qRead=#qCharge# titleMap=#titleMap# filename="#pageInfo.entity#.xml"/>
|
||||
<layout:xml qRead=#qReconciliation# titleMap=#titleMap# filename="#pageInfo.entity#.xml"/>
|
||||
<cfabort/>
|
||||
</cfif><cfif isDefined("output_json")>
|
||||
<layout:json qRead=#qCharge# titleMap=#titleMap# filename="#pageInfo.entity#.json"/>
|
||||
<layout:json qRead=#qReconciliation# titleMap=#titleMap# filename="#pageInfo.entity#.json"/>
|
||||
<cfabort/>
|
||||
</cfif><!---
|
||||
---><layout:page section="header" pageInfo=#pageInfo#>
|
||||
|
||||
Reference in New Issue
Block a user