diff options
Diffstat (limited to 'python/baml_fcm_fx.py')
| -rw-r--r-- | python/baml_fcm_fx.py | 13 |
1 files changed, 8 insertions, 5 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) |
