From 20f5467e9185f15ebc13ab464061d7dc29575a26 Mon Sep 17 00:00:00 2001 From: Clinton Alexander Date: Tue, 12 Jul 2016 16:20:13 +0100 Subject: [PATCH] All fields now submit correctly. --- src/main/webdemo/js/Deal.js | 10 +++++----- src/main/webdemo/js/viewmodel/FixedLeg.js | 4 ++-- src/main/webdemo/js/viewmodel/FloatingLeg.js | 4 ++-- src/main/webdemo/view/create-deal.html | 17 +++-------------- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/main/webdemo/js/Deal.js b/src/main/webdemo/js/Deal.js index d1f8a76dc4..18bfa25da8 100644 --- a/src/main/webdemo/js/Deal.js +++ b/src/main/webdemo/js/Deal.js @@ -1,6 +1,6 @@ "use strict" -define(['utils/dayCountBasisLookup', 'viewmodel/FixedRate'], (dayCountBasisLookup, fixedRateViewModel) => { +define(['viewmodel/FixedRate'], (fixedRateViewModel) => { let calculationModel = { expression: "( fixedLeg.notional.quantity * (fixedLeg.fixedRate.ratioUnit.value)) -(floatingLeg.notional.quantity * (calculation.fixingSchedule.get(context.getDate('currentDate')).rate.ratioUnit.value))", floatingLegPaymentSchedule: { @@ -29,15 +29,15 @@ define(['utils/dayCountBasisLookup', 'viewmodel/FixedRate'], (dayCountBasisLooku fixedLeg.effectiveDate = formatDateForNode(common.effectiveDate); fixedLeg.terminationDate = formatDateForNode(common.terminationDate); fixedLeg.fixedRate = { ratioUnit: { value: fixedLeg.fixedRate } }; - fixedLeg.dayCountBasisDay = dayCountBasisLookup[fixedLeg.dayCountBasis].day; - fixedLeg.dayCountBasisYear = dayCountBasisLookup[fixedLeg.dayCountBasis].year; + fixedLeg.dayCountBasisDay = fixedLeg.dayCountBasis.day; + fixedLeg.dayCountBasisYear = fixedLeg.dayCountBasis.year; delete fixedLeg.dayCountBasis; floatingLeg.notional.token = common.baseCurrency; floatingLeg.effectiveDate = formatDateForNode(common.effectiveDate); floatingLeg.terminationDate = formatDateForNode(common.terminationDate); - floatingLeg.dayCountBasisDay = dayCountBasisLookup[floatingLeg.dayCountBasis].day; - floatingLeg.dayCountBasisYear = dayCountBasisLookup[floatingLeg.dayCountBasis].year; + floatingLeg.dayCountBasisDay = floatingLeg.dayCountBasis.day; + floatingLeg.dayCountBasisYear = floatingLeg.dayCountBasis.year; delete floatingLeg.dayCountBasis; common.tradeID = tradeId; diff --git a/src/main/webdemo/js/viewmodel/FixedLeg.js b/src/main/webdemo/js/viewmodel/FixedLeg.js index 6d3c4e6fb8..445ab4fc0f 100644 --- a/src/main/webdemo/js/viewmodel/FixedLeg.js +++ b/src/main/webdemo/js/viewmodel/FixedLeg.js @@ -1,6 +1,6 @@ 'use strict'; -define([], () => { +define(['utils/dayCountBasisLookup'], (dayCountBasisLookup) => { return { fixedRatePayer: "Bank A", notional: { @@ -10,7 +10,7 @@ define([], () => { effectiveDateAdjustment: null, terminationDateAdjustment: null, fixedRate: "1.676", - dayCountBasis: "30/360", + dayCountBasis: dayCountBasisLookup["ACT/360"], rollConvention: "Following", dayInMonth: 10, paymentRule: "InArrears", diff --git a/src/main/webdemo/js/viewmodel/FloatingLeg.js b/src/main/webdemo/js/viewmodel/FloatingLeg.js index 68a22becfd..83a1e22840 100644 --- a/src/main/webdemo/js/viewmodel/FloatingLeg.js +++ b/src/main/webdemo/js/viewmodel/FloatingLeg.js @@ -1,6 +1,6 @@ 'use strict'; -define([], () => { +define(['utils/dayCountBasisLookup'], (dayCountBasisLookup) => { return { floatingRatePayer: "Bank B", notional: { @@ -11,7 +11,7 @@ define([], () => { effectiveDateAdjustment: null, terminationDate: new Date(2026, 3, 11), terminationDateAdjustment: null, - dayCountBasis: "30/360", + dayCountBasis: dayCountBasisLookup["ACT/360"], rollConvention: "Following", fixingRollConvention: "Following", dayInMonth: 10, diff --git a/src/main/webdemo/view/create-deal.html b/src/main/webdemo/view/create-deal.html index f40d449d6f..0a8d25f2ea 100644 --- a/src/main/webdemo/view/create-deal.html +++ b/src/main/webdemo/view/create-deal.html @@ -109,20 +109,9 @@
-