aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops/__main__.py')
-rw-r--r--python/report_ops/__main__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/report_ops/__main__.py b/python/report_ops/__main__.py
index 194dd536..0f8f2440 100644
--- a/python/report_ops/__main__.py
+++ b/python/report_ops/__main__.py
@@ -1,5 +1,6 @@
from serenitas.analytics.dates import prev_business_day
from serenitas.utils.exchange import ExchangeMessage
+from serenitas.utils.db import dbconn
import logging
import argparse
import datetime
@@ -18,6 +19,7 @@ from .cash import NTCashReport, UMBCashReport, BNYCashReport
from .admin import AccruedReport, AllReport
from .wires import BowdstWire, NTWire
from .custodians import upload_to_custodian
+from .utils import notify_payment_settlements, PaymentMonitor
logger = logging.getLogger(__name__)
@@ -48,6 +50,12 @@ parser.add_argument(
help="upload trade files to notify custodians",
)
parser.add_argument(
+ "-ps",
+ "--payment_settlements",
+ action="store_true",
+ help="notify payment settlements by email",
+)
+parser.add_argument(
"-n", "--no-upload", action="store_true", help="do not upload, just create files"
)
parser.add_argument(
@@ -111,3 +119,9 @@ if args.send_to_custodians:
upload_to_custodian(account, args.date, not args.no_upload, em)
except ValueError as e:
logger.info(e)
+
+if args.payment_settlements:
+ conn = dbconn("dawndb")
+ for fund in ("SERCGMAST", "BRINKER", "BOWDST", "ISOSEL"):
+ notify_payment_settlements(date, fund, conn)
+ PaymentMonitor._insert_queue.clear()