aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index b4ae0682..70e9b668 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -4154,7 +4154,7 @@ FROM irs JOIN counterparties ON cp_code = code) ORDER BY trade_date DESC, folder
CREATE OR REPLACE FUNCTION baml_fcm_fx(p_date date) RETURNS TABLE (account TEXT, curr currency, "TotBal" NUMERIC, "HomeCurrency" currency, "fxRate" NUMERIC, "convTotBal" NUMERIC, "BuySell" TEXT, "ValueDate" date) LANGUAGE plpgsql
AS $function$
BEGIN
- RETURN query SELECT a.account, a.curr, round(a.totbal::NUMERIC, 2) , a.homecurrency, round(a.fxrate::NUMERIC, 5), round(a.convtotbal::NUMERIC, 2), a.buysell, a.valuedate
+ RETURN query SELECT case when a.account='V0NSCLMSPT' then '6MZ20049' else a.account, a.curr, round(a.totbal::NUMERIC, 2) , a.homecurrency, round(a.fxrate::NUMERIC, 5), round(a.convtotbal::NUMERIC, 2), a.buysell, a.valuedate
FROM(SELECT cash_account AS account, buy_currency AS curr,-buy_amount AS totbal, sell_currency AS homecurrency, spot_rate AS fxrate, sell_amount AS convtotbal, 'Buy' AS buysell, settle_date AS valuedate
FROM spots
WHERE sell_currency = 'USD'