Commit all views

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-04-23 09:24:37 +02:00
parent 79f6e6111f
commit 3986882771
16 changed files with 518 additions and 91 deletions

View File

@@ -27,7 +27,9 @@ CREATE OR REPLACE VIEW public.vw_utility_dim_physical_sale_contract AS
''::character varying AS "strStrategyName",
''::character varying AS "strBookName",
''::character varying AS "strIncotermCode",
NULL::date AS "dtmEstimatedBLDate"
NULL::date AS "dtmEstimatedBLDate",
''::character varying AS "strPricingType",
''::character varying AS "strCounterpartyCountry"
UNION ALL
SELECT sl.id AS "intSaleLineId",
sc.number AS "strContractNb",
@@ -57,7 +59,9 @@ UNION ALL
strategy."strValueName" AS "strStrategyName",
book."strValueName" AS "strBookName",
COALESCE(inc.code, ''::character varying) AS "strIncotermCode",
COALESCE(bl.estimated_date, sl.to_del) AS "dtmEstimatedBLDate"
COALESCE(bl.estimated_date, sl.to_del) AS "dtmEstimatedBLDate",
sl.price_type AS "strPricingType",
COALESCE(ad."strCountry", 'Undefined'::character varying) AS "strCounterpartyCountry"
FROM (((((((((((((((((((sale_line sl
JOIN sale_sale sc ON ((sl.sale = sc.id)))
JOIN party_party pty ON ((sc.party = pty.id)))
@@ -77,5 +81,5 @@ UNION ALL
LEFT JOIN vw_utility_last_counterparty_address ad ON ((pty.id = ad."intPartyId")))
LEFT JOIN vw_utility_strategy_dimension strategy ON (((sl.id = strategy."intTradeLineId") AND (strategy."strTradeCategory" = 'Physical'::text) AND (strategy."strTradeType" = 'Sale'::text))))
LEFT JOIN vw_utility_book_dimension book ON (((sl.id = book."intTradeLineId") AND (book."strTradeCategory" = 'Physical'::text) AND (book."strTradeType" = 'Sale'::text))))
LEFT JOIN pricing_estimated bl ON (((sl.id = bl.line) AND ((bl.trigger)::text = 'bldate'::text))))
LEFT JOIN pricing_estimated bl ON (((sl.id = bl.sale_line) AND ((bl.trigger)::text = 'bldate'::text))))
WHERE ((1 = 1) AND ((sl.type)::text = 'line'::text));;