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

65 lines
2.3 KiB
C#

using YLErp.Model.Enum;
namespace YLErp.Model.FinancialVoucherCreator
{
public class DepositWithdrawGenerator
{
public static FinancialStatement GetFinancialStatement(bool isSamePeer, string clientName, double cashAmount, bool isCashOut)
{
if (isCashOut)
{
var financialStatement = new FinancialStatement
{
AbstractTye = FinancialVoucherAbstractEnum.DepositWithdraw.GetHashCode(),
Abstract = $"支付{clientName}出金",
IsSamePeer = isSamePeer
};
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应付款/应付单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 0,
DataField = cashAmount,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "银行存款/招商银行",
DebitOrCredit = 1,
DataField = cashAmount,
Remark = ""
});
return financialStatement;
}
else
{
var financialStatement = new FinancialStatement
{
AbstractTye = FinancialVoucherAbstractEnum.DepositWithdraw.GetHashCode(),
Abstract = $"收到{clientName}入金",
IsSamePeer = isSamePeer
};
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "银行存款/招商银行",
DebitOrCredit = 0,
DataField = cashAmount,
Remark = ""
});
financialStatement.Children.Add(new FinancialStatement
{
AccountingSubject = "其他应付款/应付单位款",
SupplementaryAcountingUnit = clientName,
DebitOrCredit = 1,
DataField = cashAmount,
Remark = ""
});
return financialStatement;
}
}
}
}