BugFix SwapCloseAmount计算位置太前,导致资金算了两遍

This commit is contained in:
锦麟 王
2026-06-29 16:38:34 +08:00
parent 1e4ab52c1e
commit 1c45a54395
@@ -413,9 +413,9 @@ namespace YLErp.Modules.SwapModule
var ratio = x.InterestDirection == (int)SwapDirectionEnum. ? 1 : -1;
interestTotal += x.InterestClosePnL * ratio;
});
unwindData.SwapCloseAmount = interestTotal + unwindData.SwapMarginRebatePnl;//需要算上预付金利息,只是不要算预付金返还
unwindData.SwapCloseAmount = interestTotal ;
unwindData.SwapDividendPnl = 0;
unwindData.SwapRealizedPnL = unwindData.SwapCloseAmount;
unwindData.SwapRealizedPnL = unwindData.SwapCloseAmount + unwindData.SwapMarginRebatePnl;
SaveAutoSwapDeal(td, autoInterests, unwindData, interval);
}
@@ -515,13 +515,13 @@ namespace YLErp.Modules.SwapModule
{
clientCashId = AddClientCashInCashOut(td, Convert.ToDouble(-unwindData.SwapCloseAmount), ClientCashInCashOut._互换, cashHappenDate);
}
// 预付金腿:单独插入一条资金记录(系统操作_预付金返息)
if (unwindData.SwapMarginRebatePnl != 0)
{
clientCashId = AddClientCashInCashOut(td, Convert.ToDouble(-unwindData.SwapMarginRebatePnl), ClientCashInCashOut._预付金返息, unwindData.ValueDate);
}
unwindData.SwapCloseAmount = unwindData.SwapRealizedPnL;//需要算上预付金利息 和 分红; 只是不算预付金返还
// 分红:使用派息支付日偏移记录资金记录
if (unwindData.SwapDividendPnl != 0)
{