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

@@ -10,8 +10,6 @@ CREATE OR REPLACE VIEW public.vw_bi_itsa_physical_open_costs AS
), contract_open_quantity AS (
SELECT 'Purchase'::text AS "TradeType",
pc."intPurchaseLineId" AS "TradeLineId",
pc."dblTheoriticalQuantity" AS "TheoriticalQuantity",
pc."dblInInstructedQuantity" AS "InstructedQuantity",
CASE
WHEN (pc."ysnFinished" = true) THEN (0)::numeric(18,3)
WHEN ((pc."dblTheoriticalQuantity")::double precision > pc."dblInInstructedQuantity") THEN (((pc."dblTheoriticalQuantity")::double precision - pc."dblInInstructedQuantity"))::numeric(18,3)
@@ -30,8 +28,6 @@ CREATE OR REPLACE VIEW public.vw_bi_itsa_physical_open_costs AS
UNION ALL
SELECT 'Sale'::text AS "TradeType",
pc."intSaleLineId" AS "TradeLineId",
pc."dblTheoreticalQuantity" AS "TheoriticalQuantity",
pc."dblInstructedQuantity" AS "InstructedQuantity",
CASE
WHEN (pc."ysnFinished" = true) THEN (0)::numeric(18,3)
WHEN ((pc."dblTheoreticalQuantity")::double precision > pc."dblInstructedQuantity") THEN (((pc."dblTheoreticalQuantity")::double precision - pc."dblInstructedQuantity"))::numeric(18,3)