FIX RYCHLOST EKONOMIKA
Some checks failed
CI and deploy / migration-check (push) Failing after 10s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-04-27 19:47:18 +02:00
parent c52946a4ce
commit 8114ec5e63
5 changed files with 177 additions and 12 deletions

View File

@@ -15,7 +15,11 @@ as $fn$
case when l.site_id is not null then l.green_bonus_czk else r.green_bonus_czk end as gb,
coalesce(l.grid_import_cashflow_czk, r.grid_import_cashflow_czk) as gic,
coalesce(l.grid_export_revenue_czk, r.grid_export_revenue_czk) as ger
from ems.vw_economics_daily r
from ems.fn_economics_daily_for_window(
p_site_id,
(p_month_start::timestamp at time zone 'Europe/Prague'),
(p_month_end::timestamp at time zone 'Europe/Prague')
) r
left join ems.audit_day_lock l
on l.site_id = r.site_id
and l.day_local = r.day_local