diff options
Diffstat (limited to 'python/citco_ops/cash.py')
| -rw-r--r-- | python/citco_ops/cash.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/python/citco_ops/cash.py b/python/citco_ops/cash.py index 78f26330..84a8c80b 100644 --- a/python/citco_ops/cash.py +++ b/python/citco_ops/cash.py @@ -61,15 +61,13 @@ class CashReport: class IsoselCashReport(CashReport, fund="ISOSEL", account_number="ISOS01"): - def download_reports(self): + @classmethod + def download_reports(cls, date=datetime.date.today()): em = ExchangeMessage() for msg in em.get_msgs(path=["SeleneOps", "Passport"]): for attach in msg.attachments: message_time = attach.last_modified_time - if ( - attach.name == "Attachment1.pgp" - and prev_business_day(message_time.date()) == self.date - ): + if attach.name == "Attachment1.pgp" and message_time.date() == date: dest = get_dir(message_time.date()) dest.mkdir(exist_ok=True, parents=True) with attach.fp as fp: @@ -87,7 +85,7 @@ class IsoselCashReport(CashReport, fund="ISOSEL", account_number="ISOS01"): csvFile.write(text) def to_db(self): - self.download_reports() + self.download_reports(self.date) p = max( [ f |
