aboutsummaryrefslogtreecommitdiffstats
path: root/python/citco_ops
diff options
context:
space:
mode:
Diffstat (limited to 'python/citco_ops')
-rw-r--r--python/citco_ops/cash.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/python/citco_ops/cash.py b/python/citco_ops/cash.py
index d76e5426..6d6c33cb 100644
--- a/python/citco_ops/cash.py
+++ b/python/citco_ops/cash.py
@@ -47,8 +47,9 @@ class CashReport:
date: datetime.date
_conn: ClassVar[dbconn] = dbconn("dawndb")
- def __init_subclass__(cls, fund):
+ def __init_subclass__(cls, fund, account_number):
cls.fund = fund
+ cls.account_number = account_number
def download_report(self):
em = ExchangeMessage()
@@ -90,12 +91,16 @@ class CashReport:
df["fund"] = self.fund
with self._conn.cursor() as c:
c.execute(
- "DELETE FROM cash_balances WHERE fund=%s AND date=%s",
- (self.fund, self.date),
+ "DELETE FROM cash_balances WHERE fund=%s AND date=%s AND account_number=%s",
+ (
+ self.fund,
+ self.date,
+ self.account_number,
+ ),
)
self._conn.commit()
df.to_sql("cash_balances", index=False, if_exists="append", con=dawn_engine)
-class IsoselCashReport(CashReport, fund="ISOSEL"):
+class IsoselCashReport(CashReport, fund="ISOSEL", account_number="ISOS01"):
pass