aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/gfs_monitor.py6
-rw-r--r--python/report_ops/utils.py8
2 files changed, 8 insertions, 6 deletions
diff --git a/python/gfs_monitor.py b/python/gfs_monitor.py
index 5b2665bc..5386f358 100644
--- a/python/gfs_monitor.py
+++ b/python/gfs_monitor.py
@@ -19,12 +19,12 @@ if __name__ == "__main__":
args = parser.parse_args()
logger = logging.getLogger(__name__)
conn = dbconn("dawndb")
- 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;"
+ sql_str = "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;"
em = ExchangeMessage()
with conn.cursor() as c:
- for fund in ("BOWDST", "SERCGMAST"):
+ for fund in ("SERCGMAST", "BOWDST"):
c.execute(sql_str, (fund, args.cob))
for row in c:
- GFSMonitor.stage(c._asdict())
+ GFSMonitor.stage(row._asdict())
GFSMonitor.email(fund)
GFSMonitor._insert_queue.clear()
diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py
index 3bf56462..0c322fb7 100644
--- a/python/report_ops/utils.py
+++ b/python/report_ops/utils.py
@@ -205,7 +205,7 @@ class Monitor:
def __init_subclass__(cls, headers, num_format=[]):
cls.headers = headers
- cls.line_format = line_format
+ cls.num_format = num_format
@classmethod
def stage(cls, d: dict):
@@ -215,7 +215,7 @@ class Monitor:
def format(cls):
for line in cls._insert_queue:
for f, i in cls.num_format:
- line[i] = f.format[i]
+ line[i] = f.format(line[i])
@classmethod
def to_tabulate(cls):
@@ -229,7 +229,9 @@ class Monitor:
class GFSMonitor(
- Monitor, headers=("date", "amount", "currency"), num_format=[("{0:,.2f}", 1)]
+ Monitor,
+ headers=("date", "portfolio", "amount", "currency"),
+ num_format=[("{0:,.2f}", 2)],
):
@classmethod
def email(cls, fund):