Files
zszq-trs/YLErpDAL/Model/FinancialVoucherCreator/TerminationInvestmentIncomeGenerator.cs
T
2024-05-09 14:06:26 +08:00

254 lines
12 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using YLErp.Model.Enum;
namespace YLErp.Model.FinancialVoucherCreator
{
public class TerminationInvestmentIncomeGenerator
{
public static FinancialStatement GetFinancialStatement(bool isSamePeer, string clientName, bool isBuy, string contractCode, double optionFee, double unwindFee)
{
if (isSamePeer)
{
if (isBuy)
{
var settlement = unwindFee - optionFee;
var financialStatement = new FinancialStatement
{
AbstractTye = FinancialVoucherAbstractEnum.TerminationInvestmentIncome.GetHashCode(),
Abstract = $"确认期权提前终止投资收益({contractCode}",
IsSamePeer = isSamePeer
};
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应付款/应付单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 0,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "衍生工具/期权/场外期权/买权/成本",
DebitOrCredit = 1,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/买权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 0,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应付款/应付单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 1,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应收款/应收单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 0,
DataField = Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/买权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 1,
DataField = Math.Abs(settlement),
Remark = ""
});
return financialStatement;
}
else
{
var settlement = unwindFee + optionFee;
var financialStatement = new FinancialStatement
{
AbstractTye = FinancialVoucherAbstractEnum.TerminationInvestmentIncome.GetHashCode(),
Abstract = $"确认期权提前终止投资收益({contractCode}",
IsSamePeer = isSamePeer
};
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "衍生工具/期权/场外期权/卖权/成本",
DebitOrCredit = 0,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应收款/应收单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 1,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/卖权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 0,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应付款/应付单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 1,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应收款/应收单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 0,
DataField = Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/卖权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 1,
DataField = Math.Abs(settlement),
Remark = ""
});
return financialStatement;
}
}
else
{
if (!isBuy)
{
var settlement = unwindFee - optionFee;
var financialStatement = new FinancialStatement
{
AbstractTye = FinancialVoucherAbstractEnum.TerminationInvestmentIncome.GetHashCode(),
Abstract = $"确认期权提前终止投资收益({contractCode}",
IsSamePeer = isSamePeer
};
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/买权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 0,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "衍生工具/期权/场外期权/买权/成本",
DebitOrCredit = 1,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/买权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 0,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应付款/应付单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 1,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应收款/应收单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 0,
DataField = Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/卖权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 1,
DataField = Math.Abs(settlement),
Remark = ""
});
return financialStatement;
}
else
{
var settlement = unwindFee + optionFee;
var financialStatement = new FinancialStatement
{
AbstractTye = FinancialVoucherAbstractEnum.TerminationInvestmentIncome.GetHashCode(),
Abstract = $"确认期权提前终止投资收益({contractCode}",
IsSamePeer = isSamePeer
};
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "衍生工具/期权/场外期权/卖权/成本",
DebitOrCredit = 0,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/卖权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 1,
DataField = optionFee,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/卖权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 0,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应付款/应付单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 1,
DataField = -Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应收款/应收单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 0,
DataField = Math.Abs(settlement),
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "投资收益/衍生工具/期权/场外期权/卖权",
SupplementaryAcountingUnit = "场外衍生品部",
DebitOrCredit = 1,
DataField = Math.Abs(settlement),
Remark = ""
});
return financialStatement;
}
}
}
}
}