Dump - ITSA views

This commit is contained in:
AzureAD\SylvainDUVERNAY
2026-06-14 11:05:54 +02:00
parent 3a3e715336
commit af63a53372
27 changed files with 708 additions and 140 deletions

View File

@@ -0,0 +1,18 @@
CREATE OR REPLACE VIEW public.vw_utility_premium_composition AS
SELECT pc.line AS "intContractLineId",
'Purchase'::text AS "strContractType",
pf.name AS "strPremiumType",
pc.premium AS "dblPremiumAmount",
pc.reference AS "strReference"
FROM (premium_composition pc
JOIN price_fixtype pf ON ((pc.type = pf.id)))
WHERE (pc.line IS NOT NULL)
UNION ALL
SELECT pc.sale_line AS "intContractLineId",
'Sale'::text AS "strContractType",
pf.name AS "strPremiumType",
pc.premium AS "dblPremiumAmount",
pc.reference AS "strReference"
FROM (premium_composition pc
JOIN price_fixtype pf ON ((pc.type = pf.id)))
WHERE (pc.sale_line IS NOT NULL);;