using System.Runtime.Serialization; using DS.Module.Core; using DS.WMS.Core.Op.Entity; namespace DS.WMS.Core.Fee.Dtos { /// /// 按业务展示的费用信息 /// public class FeeDto { readonly IEnumerable _items; /// /// 费用记录项 /// public IEnumerable Items => _items; /// /// 使用指定的数据源初始化统计。 /// /// 数据源 public FeeDto(IEnumerable source) { _items = source; //人民币 ReceivableCNY = _items.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(); PayableCNY = _items.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(); //美元 ReceivableUSD = _items.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(); PayableUSD = _items.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(); //其他 ReceivableOther = _items.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount).GetValueOrDefault(); PayableOther = _items.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD" && x.Currency != "CNY").Sum(x => x.Amount).GetValueOrDefault(); } /// /// 人民币应收款 /// public decimal ReceivableCNY { get; private set; } /// /// 人民币应付款 /// public decimal PayableCNY { get; private set; } /// /// 美元应收款 /// public decimal ReceivableUSD { get; private set; } /// /// 美元应付款 /// public decimal PayableUSD { get; private set; } /// /// 其他币种应收款 /// public decimal ReceivableOther { get; private set; } /// /// 其他币种应付款 /// public decimal PayableOther { get; private set; } } /// /// 费用记录 /// public class FeeRecordDto { /// /// 申请单ID /// public long ApplicationId { get; set; } /// /// 费用记录ID /// public long RecordId { get; set; } /// /// 业务ID /// public long BusinessId { get; set; } /// /// 业务类型 /// public BusinessType BusinessType { get; set; } /// /// 客户名称 /// public string? CustomerName { get; set; } /// /// 费用ID /// public long FeeId { get; set; } /// /// 费用名称 /// public string? FeeName { get; set; } /// /// 费用类型 /// public FeeType FeeType { get; set; } /// /// 费用总金额 /// public decimal? Amount { get; set; } /// /// 币别 /// public string Currency { get; set; } /// /// 原始币别 /// public string OriginalCurrency { get; set; } /// /// 原始汇率 /// public decimal? OriginalRate { get; set; } /// /// 折算汇率 /// public decimal? ExchangeRate { get; set; } /// /// 未结金额 /// public decimal? RestAmount { get; set; } /// /// 本次申请金额 /// public decimal? ApplyAmount { get; set; } /// /// 本次申请原始金额 /// public decimal? OriginalApplyAmount { get; set; } /// /// 开票金额 /// public decimal? InvoiceAmount { get; set; } /// /// 备注 /// public string? Remark { get; set; } [IgnoreDataMember] public long CreateBy { get; set; } /// /// 录入人 /// public string? CreateByName { get; set; } } }