39 lines
1.3 KiB
SQL
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);;
|