aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/baml_fcm_fx.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/baml_fcm_fx.py b/python/baml_fcm_fx.py
index f218625e..4c0d327e 100644
--- a/python/baml_fcm_fx.py
+++ b/python/baml_fcm_fx.py
@@ -8,7 +8,7 @@ from exchangelib import HTMLBody
_fcm_alias = {"V0NSCLMSPT": "6MZ20049"}
-def email_fcm(em, d):
+def email_fcm(em, d, fund):
fcm_account = _fcm_alias.get(d["cash_account"], d["cash_account"])
em.send_email(
f"FX Details: {fcm_account} Trade Date: {d['trade_date']}",
@@ -27,7 +27,7 @@ def email_fcm(em, d):
</html>"""
),
to_recipients=_recipients["BAML_FCM"],
- cc_recipients=_cc_recipients[d["fund"]],
+ cc_recipients=_cc_recipients[fund],
)
@@ -71,12 +71,12 @@ def to_tabulate(d):
def main(trade_date, conn, fund, em):
with conn.cursor() as c:
c.execute(
- "SELECT spots.cash_account, buy_currency, sell_currency, buy_amount, sell_amount, spot_rate, settle_date, trade_date FROM spots LEFT JOIN accounts2 USING (cash_account) WHERE account_type='Fcm' AND spots.cp_code='BAMSNY' AND spots.trade_date =%s AND spots.fund=%s;",
+ "SELECT spots.cash_account, buy_currency, sell_currency, buy_amount, sell_amount, spot_rate, settle_date, trade_date FROM spots LEFT JOIN accounts2 USING (cash_account) WHERE account_type='Fcm' AND spots.cp_code='BAMSNY' AND spots.trade_date =%s AND spots.fund=%s",
(trade_date, fund),
)
for rec in c:
d = rec._asdict()
- email_fcm(em, d)
+ email_fcm(em, d, fund)
if __name__ == "__main__":