aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/Dawn/views.py6
-rw-r--r--python/process_queue.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/python/Dawn/views.py b/python/Dawn/views.py
index ab334c15..2cc5447b 100644
--- a/python/Dawn/views.py
+++ b/python/Dawn/views.py
@@ -394,7 +394,8 @@ def terminate(dealid, kind):
form.populate_obj(termination)
sql_session = form.get_session()
rec = db.session.execute(
- "SELECT notional, coalesce(terminated_amount, 0.), currency, b.globeop_id, cp_code "
+ "SELECT notional, coalesce(terminated_amount, 0.), currency, b.globeop_id, "
+ "cp_code, fund "
f"FROM {table} "
"LEFT JOIN "
"(SELECT dealid, sum(termination_amount) AS terminated_amount "
@@ -407,7 +408,7 @@ def terminate(dealid, kind):
"WHERE dealid = :dealid",
{"dealid": dealid, "date": termination.termination_date},
)
- notional, terminated_amount, currency, globeop_id, cp_code = next(rec)
+ notional, terminated_amount, currency, globeop_id, cp_code, fund = next(rec)
is_assignment = True
if not termination.partial_termination:
termination.termination_amount = notional - terminated_amount
@@ -426,6 +427,7 @@ def terminate(dealid, kind):
ccy=currency,
globeopid=globeop_id,
is_assignment=is_assignment,
+ fund=fund,
)
q = get_queue()
q.rpush(f"{kind}_termination", buf)
diff --git a/python/process_queue.py b/python/process_queue.py
index 9a43f9f3..4ec33469 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -366,7 +366,7 @@ def terminate_list(
logging.error(e)
return
else:
- dest = get_filepath(base_dir, trade_type)
+ dest = get_filepath(base_dir, trade_type, termination["fund"])
if upload:
upload_buf(buf, dest.name)
dest.write_bytes(buf)