Files
Implementation_ITSA/Database Backups/SQL Views/vw_utility_physical_pricing_definition.sql
AzureAD\SylvainDUVERNAY af63a53372 Dump - ITSA views
2026-06-14 11:05:54 +02:00

39 lines
1.3 KiB
SQL

CREATE OR REPLACE VIEW public.vw_utility_physical_pricing_definition AS
SELECT 'Purchase'::text AS "strContractType",
pc.line AS "intContractLineId",
pc.id AS "intPricingComponentId",
pc.price_index AS "intPriceCurveId",
vpc."strPriceDescription",
vpc."strPriceIndex",
vpc."strCurrency",
vpc."strUnit",
vpc."strPriceCurveType",
vpc."strPriceArea",
vpc."strPriceCalendar",
vpc."strPricingType",
vpc."dtmPricingStartDate",
vpc."dtmPricingEndDate",
vpc."strPricingMonth"
FROM (pricing_component pc
LEFT JOIN vw_utility_price_curve vpc ON ((vpc."intPriceCurveId" = pc.price_index)))
WHERE (pc.line IS NOT NULL)
UNION ALL
SELECT 'Sale'::text AS "strContractType",
pc.sale_line AS "intContractLineId",
pc.id AS "intPricingComponentId",
pc.price_index AS "intPriceCurveId",
vpc."strPriceDescription",
vpc."strPriceIndex",
vpc."strCurrency",
vpc."strUnit",
vpc."strPriceCurveType",
vpc."strPriceArea",
vpc."strPriceCalendar",
vpc."strPricingType",
vpc."dtmPricingStartDate",
vpc."dtmPricingEndDate",
vpc."strPricingMonth"
FROM (pricing_component pc
LEFT JOIN vw_utility_price_curve vpc ON ((vpc."intPriceCurveId" = pc.price_index)))
WHERE (pc.sale_line IS NOT NULL);;