From 0f8f136bcd5cd9e456fb1bf891f547718c7f3396 Mon Sep 17 00:00:00 2001 From: Xiaoyu Date: Mon, 25 Dec 2023 01:02:28 +0800 Subject: [PATCH] Fix revolving dates --- src/Asset.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Asset.hs b/src/Asset.hs index e17f9bed..6dc02be4 100644 --- a/src/Asset.hs +++ b/src/Asset.hs @@ -84,9 +84,9 @@ class (Show a,IR.UseRate a) => Asset a where -- | ! Internal use calcAlignDate :: a -> Date -> Date calcAlignDate ast d = let - payDates = getPaymentDates ast 0 + payDates = getOriginDate ast:getPaymentDates ast 0 remainTerms = getRemainTerms ast - benchDate = reverse payDates!!pred remainTerms `debug` ("\nPayDates"++show payDates++"\nremain terms"++ show remainTerms) + benchDate = reverse payDates!! remainTerms offset = daysBetween benchDate d in T.addDays offset $ getOriginDate ast