Files
Implementation_ITSA/Database Backups/SQL Views/vw_utility_price_curve.sql
AzureAD\SylvainDUVERNAY 832a142e87 Commit all views for ITSA
2026-03-24 14:40:53 +01:00

22 lines
1.0 KiB
SQL

CREATE OR REPLACE VIEW public.vw_utility_price_curve AS
SELECT pp.id AS "intPriceCurveId",
pp.price_desc AS "strPriceDescription",
pp.price_index AS "strPriceIndex",
cc.name AS "strCurrency",
pu.name AS "strUnit",
pp.price_curve_type AS "strPriceCurveType",
COALESCE(pa.name, ''::character varying) AS "strPriceArea",
COALESCE(pc.name, ''::character varying) AS "strPriceCalendar",
COALESCE(pft.name, ''::character varying) AS "strPricingType",
pm.beg_date AS "dtmPricingStartDate",
pm.end_date AS "dtmPricingEndDate",
pm.month_name AS "strPricingMonth"
FROM ((((((price_price pp
JOIN currency_currency cc ON ((pp.price_currency = cc.id)))
LEFT JOIN price_area pa ON ((pp.price_area = pa.id)))
LEFT JOIN price_calendar pc ON ((pp.price_calendar = pc.id)))
LEFT JOIN product_uom pu ON ((pp.price_unit = pu.id)))
LEFT JOIN product_month pm ON ((pp.price_period = pm.id)))
LEFT JOIN price_fixtype pft ON ((pp.price_type = pft.id)))
WHERE ((1 = 1) AND (pp.active = true));;