CREATE OR REPLACE VIEW public.vw_bi_fct_trade_line AS
 SELECT pc."intPurchaseLineId" AS "intTradeId",
    'Physical'::text AS "Trade Category",
    'Purchase'::text AS "Trade Type",
    pc."dtmEstimatedBLDate" AS "Delivery Date",
    pc."dblTheoriticalQuantity" AS "Contracted Quantity",
    pc."dblQuantity" AS "Quantity",
    pc."dblPrice" AS "Price",
    pc."dblUnitPrice" AS "Unit Price",
    'USD'::text AS "Price Currency",
    pc."dblLineAmount" AS "Line Amount"
   FROM vw_utility_purchase_physical_contract pc
UNION ALL
 SELECT pc."intSaleLineId" AS "intTradeId",
    'Physical'::text AS "Trade Category",
    'Sale'::text AS "Trade Type",
    pc."dtmEstimatedBLDate" AS "Delivery Date",
    pc."dblTheoreticalQuantity" AS "Contracted Quantity",
    pc."dblQuantity" AS "Quantity",
    pc."dblPrice" AS "Price",
    pc."dblUnitPrice" AS "Unit Price",
    'USD'::text AS "Price Currency",
    pc."dblLineAmount" AS "Line Amount"
   FROM vw_utility_sale_physical_contract pc;;
