diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/gfs_monitor.py | 15 | ||||
| -rw-r--r-- | python/report_ops/custodians.py | 6 | ||||
| -rw-r--r-- | python/report_ops/utils.py | 3 |
3 files changed, 12 insertions, 12 deletions
diff --git a/python/gfs_monitor.py b/python/gfs_monitor.py index a6e95f59..11e0b197 100644 --- a/python/gfs_monitor.py +++ b/python/gfs_monitor.py @@ -54,9 +54,12 @@ if __name__ == "__main__": args = parser.parse_args() logger = logging.getLogger(__name__) conn = dbconn("dawndb") - for fund in ( - "SERCGMAST", - "BOWDST", - ): - check_gfs(args.cob, fund, conn) - check_cleared_cds(args.cob, fund, conn) + sql_str = "SELECT endqty as payment_amount, invccy as currency, periodenddate as settle_date FROM valuation_reports vr WHERE fund=%s AND port ='GFS_HELPER_BUSINESS_UNIT' AND periodenddate =%s AND abs(endqty) > 50000;" + em = ExchangeMessage() + with conn.cursor() as c: + for fund in ("BOWDST", "SERCGMAST"): + c.execute(sql_str, (fund, args.cob)) + for row in c: + GFSMonitor.stage(c._asdict()) + GFSMonitor.email(fund) + GFSMonitor._insert_queue.clear() diff --git a/python/report_ops/custodians.py b/python/report_ops/custodians.py index a0763995..905ca9c2 100644 --- a/python/report_ops/custodians.py +++ b/python/report_ops/custodians.py @@ -31,10 +31,8 @@ def upload_to_custodian(account, trade_date, upload, em): if any( [ old_row.identifier != row.identifier, - abs(float(old_row.principal_payment) - row.principal_payment) - > 1e-2, - abs(float(old_row.accrued_payment) - row.accrued_payment) - > 1e-2, + old_row.principal_payment != row.principal_payment, + old_row.accrued_payment != row.accrued_payment, ] ): old_trade = BondDeal.from_dict( diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py index 1e610510..83c39fc1 100644 --- a/python/report_ops/utils.py +++ b/python/report_ops/utils.py @@ -17,7 +17,6 @@ import re from zoneinfo import ZoneInfo from .misc import _recipients, _cc_recipients from tabulate import tabulate -from serenitas.utils.db import dbconn logger = logging.getLogger(__name__) @@ -329,7 +328,7 @@ class CBMonitor( </style> </head> <body> - Good morning,<br><br>We see a projected overdraft on the below dates. Please move to cover and confirm:<br><br>{cls.to_tabulate()} + Good morning,<br><br>We see a projected overdraft on the below dates. Please move to cover:<br><br>{cls.to_tabulate()} </body> </html>""" ), |
