diff --git a/YLErpDAL/Modules/SwapModule/SwapDealService.cs b/YLErpDAL/Modules/SwapModule/SwapDealService.cs index c9605a21..5598d46b 100644 --- a/YLErpDAL/Modules/SwapModule/SwapDealService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapDealService.cs @@ -862,7 +862,9 @@ namespace YLErp.Modules.SwapModule var consumedInterest = position.InterestType == (int)InterestTypeEnum.复利 ? GetConsumedInterest(td.id, position.id, endDate) : 0m; - interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, calcLast||newCalcLast, consumedInterest)); + interests.Add(CalcUnwindInterest(td, valueDate, endDate, positionClone, rate, floatRate, posiPrincipal, + closePrincipal, newClosePercent, annualDays, preEodPosition, eventType, add, swap, orginPv, calcFirst, + calcLast||newCalcLast, consumedInterest)); } } //当日有平仓或互换记录时,避免重复结算 @@ -1132,11 +1134,13 @@ namespace YLErp.Modules.SwapModule preEod.ValueDate = td.StartDate.Value; if (calcFirst) { - preEod.ValueDate= preEod.ValueDate.AddDays(-1); + preEod.ValueDate = preEod.ValueDate.AddDays(-1); } } - return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, closePrincipal, closePercent, annualDays, eventType, preEod, false, orginPv, calcFirst, calcLast, consumedInterest); + return InitSwapDealInterest(td, valueDate, endDate, rate, position, add, swap, posiPrincipal, + closePrincipal, closePercent, annualDays, eventType, preEod, false, + orginPv, calcFirst, calcLast, consumedInterest); } /// /// 初始化利息腿信息 @@ -1324,7 +1328,9 @@ namespace YLErp.Modules.SwapModule /// 是否年化 /// 年化天数 /// - public void CalcDailyCompoundInterest(DateTime endDate, swap_position position, decimal principal, swap_flow_event flowEvent, int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast, ref decimal InterestAmount, ref decimal TdInterestAmount, decimal consumedInterest = 0m, decimal resetCarryInterest = 0m) + public void CalcDailyCompoundInterest(DateTime endDate, swap_position position, decimal principal, swap_flow_event flowEvent, + int annualDays, bool needPrice, decimal floateRate, decimal closePercent, decimal orginPv, bool calcFirst, bool calcLast, + ref decimal InterestAmount, ref decimal TdInterestAmount, decimal consumedInterest = 0m, decimal resetCarryInterest = 0m) { var startDate = position.PosiStartDate; decimal interestProfitSum = 0; diff --git a/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs b/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs index bfc2e45d..8f2d3ed4 100644 --- a/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs +++ b/YLErpDAL/Modules/SwapModule/SwapTradeBaseService.cs @@ -369,7 +369,7 @@ namespace YLErp.Modules.SwapModule { interestStart = td.StartDate.Value; var exerciseDate = td.ExerciseDate.Value; - interestEnd = valueDate> exerciseDate? exerciseDate : valueDate; + interestEnd = valueDate > exerciseDate ? exerciseDate : valueDate; bool calcFirst = true; bool calcLast = true;