diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/baml_fcm_fx.py | 13 | ||||
| -rw-r--r-- | python/citco_ops/utils.py | 6 |
2 files changed, 11 insertions, 8 deletions
diff --git a/python/baml_fcm_fx.py b/python/baml_fcm_fx.py index 70f75aad..56d2068f 100644 --- a/python/baml_fcm_fx.py +++ b/python/baml_fcm_fx.py @@ -17,8 +17,8 @@ if __name__ == "__main__": args = parser.parse_args() sql_str = ( "SELECT settle_date, buy_currency, buy_amount, " - "sell_currency, sell_amount, spot_rate FROM spots " - "WHERE cash_account = 'V0NSCLMSPT' AND trade_date = %s" + "sell_currency, sell_amount, spot_rate, cash_account FROM spots " + "WHERE cash_account in ('V0NSCLMSPT', '6MZ20K79') AND trade_date = %s" ) dawndb = dbconn("dawndb") with dawndb.cursor() as c: @@ -26,8 +26,11 @@ if __name__ == "__main__": rec = next(iter(c)) if rec: if rec.buy_currency == "EUR": + cash_account = ( + "6MZ20049" if rec.cash_account == "V0NSCLMSPT" else rec.cash_account + ) data = [ - "6MZ20049", + cash_account, "EUR", -rec.buy_amount, "USD", @@ -38,7 +41,7 @@ if __name__ == "__main__": ] else: data = [ - "6MZ20049", + cash_account, "EUR", rec.sell_amount, "USD", @@ -65,4 +68,4 @@ if __name__ == "__main__": ], tablefmt="unsafehtml", ) - BamlFcmNotify.email_fcm(args.date, t) + BamlFcmNotify.email_fcm(args.date, t, cash_account) diff --git a/python/citco_ops/utils.py b/python/citco_ops/utils.py index 663d982b..5f122091 100644 --- a/python/citco_ops/utils.py +++ b/python/citco_ops/utils.py @@ -296,10 +296,10 @@ class GFSMonitor(Payment): class BamlFcmNotify: @classmethod - def email_fcm(cls, date, data): + def email_fcm(cls, date, data, cash_account): em = ExchangeMessage() em.send_email( - f"FX Details: 6MZ20049 {date}", + f"FX Details: {cash_account} {date}", HTMLBody( f""" <html> @@ -310,7 +310,7 @@ class BamlFcmNotify: </style> </head> <body> - Hello,<br><br>Please see below details for an FX Spot Trade we did with the desk today for account 6MZ20049. Please let me know if you need more information.<br><br>{data} + Hello,<br><br>Please see below details for an FX Spot Trade we did with the desk today for account {cash_account}. Please let me know if you need more information.<br><br>{data} </body> </html>""" ), |
