aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops/utils.py')
-rw-r--r--python/report_ops/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py
index 0c322fb7..d1b15aa5 100644
--- a/python/report_ops/utils.py
+++ b/python/report_ops/utils.py
@@ -17,6 +17,7 @@ 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__)
@@ -200,10 +201,12 @@ class Monitor:
date: datetime.date
headers: ClassVar = ()
num_format: ClassVar = []
+ sql_query: ClassVar = None
_insert_queue: ClassVar[list] = []
_em: ClassVar = ExchangeMessage()
+ _conn: dbconn("dawndb")
- def __init_subclass__(cls, headers, num_format=[]):
+ def __init_subclass__(cls, headers, sql_query=None, num_format=[]):
cls.headers = headers
cls.num_format = num_format
@@ -231,6 +234,7 @@ class Monitor:
class GFSMonitor(
Monitor,
headers=("date", "portfolio", "amount", "currency"),
+ sql_query="SELECT endqty as amount, invccy as currency, periodenddate as date, port as portfolio FROM valuation_reports vr WHERE fund=%s AND port ='GFS_HELPER_BUSINESS_UNIT' AND periodenddate =%s;",
num_format=[("{0:,.2f}", 2)],
):
@classmethod
@@ -317,7 +321,7 @@ class CBMonitor(
</style>
</head>
<body>
- Good morning,<br><br>We see a projected overdraft on the below dates. Please move to cover:<br><br>{cls.to_tabulate()}
+ Good morning,<br><br>We see a projected overdraft on the below dates. Please move to cover and confirm:<br><br>{cls.to_tabulate()}
</body>
</html>"""
),