aboutsummaryrefslogtreecommitdiffstats
path: root/python/Dawn
diff options
context:
space:
mode:
Diffstat (limited to 'python/Dawn')
-rw-r--r--python/Dawn/models.py6
-rw-r--r--python/Dawn/static/dawn.js29
-rw-r--r--python/Dawn/views.py2
3 files changed, 21 insertions, 16 deletions
diff --git a/python/Dawn/models.py b/python/Dawn/models.py
index 6b0e95b0..b46b96f8 100644
--- a/python/Dawn/models.py
+++ b/python/Dawn/models.py
@@ -190,7 +190,7 @@ class RepoDeal(db.Model):
action = db.Column(ACTION)
folder = db.Column(CDS_STRAT, nullable=False)
custodian = db.Column(db.String(12), default='SGFCM', nullable=False)
- cashaccount = db.Column(db.String(10), default='SGNSCLMASW', nullable=False)
+ cashaccount = db.Column(db.String(10), default='V0NSCLMAMB', nullable=False)
cp_code = db.Column(db.String(12), db.ForeignKey('counterparties.code'),
info={'choices': [(None, '')],
'label': 'counterparty'}, nullable=False)
@@ -230,7 +230,7 @@ class SwaptionDeal(db.Model):
portfolio = db.Column(PORTFOLIO)
folder = db.Column(SWAPTION_STRAT, nullable=False)
custodian = db.Column(db.String(12), default='NONE', nullable=False)
- cashaccount = db.Column(db.String(10), default='V0NSCLMFCM', nullable=False)
+ cashaccount = db.Column(db.String(10), default='V0NSCLMAMB', nullable=False)
cp_code = db.Column(db.String(12), db.ForeignKey('counterparties.code'),
info={'choices': [(None, '')],
'label': 'counterparty'}, nullable=False)
@@ -311,7 +311,7 @@ class CapFloorDeal(db.Model):
action = db.Column(ACTION)
folder = db.Column(SWAPTION_STRAT, nullable=False)
custodian = db.Column(db.String(12), default='NONE', nullable=False)
- cashaccount = db.Column(db.String(10), default='SGNSCLMASW', nullable=False)
+ cashaccount = db.Column(db.String(10), default='V0NSCLMAMB', nullable=False)
cp_code = db.Column(db.String(12), db.ForeignKey('counterparties.code'),
info={'choices': [(None, '')],
'label': 'counterparty'}, nullable=False)
diff --git a/python/Dawn/static/dawn.js b/python/Dawn/static/dawn.js
index 646db989..143947c8 100644
--- a/python/Dawn/static/dawn.js
+++ b/python/Dawn/static/dawn.js
@@ -1,5 +1,5 @@
var index_list = [];
-var bbg_map = {'CDX': ["IG", "HY"], 'ITRX': ["EUR", "XOVER"]}
+var bbg_map = {'CDX': ["IG", "HY"], 'ITRX': ["EUR", "XOVER"]};
var series_map = {'CDX': ["24", "25", "26", "27", "28", "29", "30", "31"],
'ITRX': ["24", "25", "26", "27", "28", "29", "30"]};
var index_tenor = ["3Y", "5Y", "7Y", "10Y"];
@@ -26,10 +26,11 @@ $(function() {
});
});
$('#swap_type').change(function() {
+ var to_hide, to_show;
switch ($(this).val()) {
case 'CD_INDEX_TRANCHE':
- var to_show = ['attach', 'detach', 'initial_margin_percentage',
- 'index_ref', 'corr_attach', 'corr_detach'];
+ to_show = ['attach', 'detach', 'initial_margin_percentage',
+ 'index_ref', 'corr_attach', 'corr_detach'];
to_show.forEach(function(id) {
$('#' + id).parent().parent().css('display', 'block');
});
@@ -38,19 +39,21 @@ $(function() {
$('#clearing_facility').parent().parent().css('display', 'none');
$('#clearing_facility').val('');
$('#initial_margin_percentage').parent().parent().css('display', 'block');
+ $('#account_code').parent().parent().css('display', 'none');
break;
case 'CD_INDEX':
- var to_hide = ['attach', 'detach', 'initial_margin_percentage',
- 'corr_attach', 'corr_detach', 'index_ref'];
+ to_hide = ['attach', 'detach', 'initial_margin_percentage',
+ 'corr_attach', 'corr_detach', 'index_ref'];
to_hide.forEach(function(id) {
$('#' + id).parent().parent().css('display', 'none');
});
$('#clearing_facility').parent().parent().css('display', 'block');
$('#clearing_facility').val('ICE-CREDIT');
+ $('#account_code').parent().parent().css('display', 'block');
break;
case 'ABS_CDS':
- var to_hide = ['attach', 'detach',
- 'corr_attach', 'corr_detach', 'index_ref'];
+ to_hide = ['attach', 'detach',
+ 'corr_attach', 'corr_detach', 'index_ref'];
to_hide.forEach(function(id) {
$('#' + id).parent().parent().css('display', 'none');
});
@@ -59,8 +62,8 @@ $(function() {
$('#clearing_facility').val('');
break;
case 'CD_BASKET_TRANCHE':
- var to_show = ['attach', 'detach', 'initial_margin_percentage',
- 'corr_attach', 'corr_detach', 'index_ref'];
+ to_show = ['attach', 'detach', 'initial_margin_percentage',
+ 'corr_attach', 'corr_detach', 'index_ref'];
to_show.forEach(function(id) {
$('#' + id).parent().parent().css('display', 'block');
});
@@ -68,8 +71,8 @@ $(function() {
$('#clearing_facility').val('');
break;
case 'SWAPTION':
- var to_hide = ['fixed_rate', 'index_ref', 'security_desc',
- 'corr_attach', 'corr_detach'];
+ to_hide = ['fixed_rate', 'index_ref', 'security_desc',
+ 'corr_attach', 'corr_detach'];
to_hide.forEach(function(id) {
$('#' + id).parent().parent().css('display', 'none');
});
@@ -77,8 +80,8 @@ $(function() {
$('#settlement_type').val('Cash');
break;
case 'CD_INDEX_OPTION':
- var to_hide = ['attach', 'detach',
- 'corr_attach', 'corr_detach'];
+ to_hide = ['attach', 'detach',
+ 'corr_attach', 'corr_detach'];
to_hide.forEach(function(id) {
$('#' + id).parent().parent().css('display', 'none');
});
diff --git a/python/Dawn/views.py b/python/Dawn/views.py
index 2cf8ee5b..97873eaf 100644
--- a/python/Dawn/views.py
+++ b/python/Dawn/views.py
@@ -341,6 +341,8 @@ def trade_manage(tradeid, kind):
url_for('trade_manage', tradeid=tradeid, kind=kind))
else:
if kind == 'cds':
+ if trade.swap_type != 'CD_INDEX':
+ trade.account_code = 'BAC'
trade.cashaccount = trade.fcm_account.cash_account
session.commit()
if form.upload_globeop.data: