Add BL Estimated Date

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-03-24 15:03:44 +01:00
parent 832a142e87
commit 32148a4a86
4 changed files with 16 additions and 8 deletions

View File

@@ -26,7 +26,8 @@ CREATE OR REPLACE VIEW public.vw_utility_dim_physical_purchase_contract AS
''::character varying AS "strStrategyName",
''::character varying AS "strBookName",
''::character varying AS "strQuantityUom",
''::character varying AS "strIncotermCode"
''::character varying AS "strIncotermCode",
NULL::date AS "dtmEstimatedBLDate"
UNION ALL
SELECT pl.id AS "intPurchaseLineId",
pc.number AS "strContractNb",
@@ -60,8 +61,9 @@ UNION ALL
strategy."strValueName" AS "strStrategyName",
book."strValueName" AS "strBookName",
pu1.name AS "strQuantityUom",
COALESCE(inc.code, ''::character varying) AS "strIncotermCode"
FROM ((((((((((((((((((purchase_line pl
COALESCE(inc.code, ''::character varying) AS "strIncotermCode",
COALESCE(bl.estimated_date, pl.to_del) AS "dtmEstimatedBLDate"
FROM (((((((((((((((((((purchase_line pl
JOIN purchase_purchase pc ON ((pl.purchase = pc.id)))
JOIN party_party pty ON ((pc.party = pty.id)))
JOIN currency_currency cur ON ((pc.currency = cur.id)))
@@ -80,4 +82,5 @@ UNION ALL
LEFT JOIN vw_utility_last_counterparty_address ad ON ((pty.id = ad."intPartyId")))
LEFT JOIN vw_utility_strategy_dimension strategy ON (((pl.id = strategy."intTradeLineId") AND (strategy."strTradeCategory" = 'Physical'::text) AND (strategy."strTradeType" = 'Purchase'::text))))
LEFT JOIN vw_utility_book_dimension book ON (((pl.id = book."intTradeLineId") AND (book."strTradeCategory" = 'Physical'::text) AND (book."strTradeType" = 'Purchase'::text))))
LEFT JOIN pricing_estimated bl ON (((pl.id = bl.line) AND ((bl.trigger)::text = 'bldate'::text))))
WHERE ((1 = 1) AND ((pl.type)::text = 'line'::text) AND ((pc.line_type)::text = 'goods'::text));;