using DS.Module.Core; namespace DS.WMS.Core.Application.Dtos { /// /// 费用申请单审核明细展示 /// public class ApplicationSummary { /// /// 费用汇总 /// public List SummaryItems { get; set; } /// /// 申请单明细 /// public IEnumerable? Details { get; set; } /// /// 初始化 /// /// 申请单明细 public ApplicationSummary(IEnumerable details) { ArgumentNullException.ThrowIfNull(details); Details = details; SummaryItems = details.GroupBy(x => new { x.FeeType, x.OriginalCurrency }).Select(x => new SummaryItem { FeeType = x.Key.FeeType, Currency = x.Key.OriginalCurrency, Amount = x.Sum(y => y.Amount), OriginalAmount = x.Sum(y => y.OriginalAmount) }).ToList(); } } /// /// 按业务统计费用 /// public class FeeBiz { /// /// 当前结算对象的全局应收总额 /// public decimal ReceivableTotal { get; set; } /// /// 费用合计 /// public List TotalItems { get; set; } } /// /// 申请单费用汇总 /// public class SummaryItem { /// /// 费用类型 /// public FeeType FeeType { get; set; } /// /// 币别 /// public string Currency { get; set; } /// /// 申请金额 /// public decimal Amount { get; set; } /// /// 原始金额 /// public decimal OriginalAmount { get; set; } } /// /// 申请单费用合计项 /// public class TotalItem { /// /// 币别 /// public string Currency { get; set; } /// /// 应收款 /// public decimal ReceivableAmount { get; set; } /// /// 未收 /// public decimal RestAmount { get; set; } /// /// 应付款 /// public decimal PayableAmount { get; set; } /// /// 利润 /// public decimal Profit { get { return ReceivableAmount - PayableAmount; } } /// /// 利润率 /// public string ProfitMargin { get { if (PayableAmount == 0) return string.Empty; //利润率=利润÷成本×100% return string.Concat((ReceivableAmount / PayableAmount) * 100, "%"); } } } /// /// 按票统计 /// public class BizFeeStat { /// /// 应收款总计 /// public decimal ReceivableTotal { get; set; } /// /// 应付款总计 /// public decimal PayableTotal { get; set; } /// /// 利润总计 /// public decimal ProfitTotal { get { return ReceivableTotal - PayableTotal; } } /// /// 利润率 /// public string ProfitMargin { get { if (PayableTotal == 0) return string.Empty; //利润率=利润÷成本×100% return string.Concat(Math.Round(ReceivableTotal / PayableTotal * 100, 2, MidpointRounding.AwayFromZero), "%"); } } /// /// 人民币应收款 /// public decimal ReceivableCNY { get; set; } /// /// 人民币应付款 /// public decimal PayableCNY { get; set; } /// /// 人民币利润 /// public decimal ProfitCNY { get { return ReceivableCNY - PayableCNY; } } /// /// 美元应收款 /// public decimal ReceivableUSD { get; set; } /// /// 美元应付款 /// public decimal PayableUSD { get; set; } /// /// 美元利润 /// public decimal ProfitUSD { get { return ReceivableUSD - PayableUSD; } } /// /// 其他币种应收款 /// public decimal ReceivableOther { get; set; } /// /// 其他币种应付款 /// public decimal PayableOther { get; set; } /// /// 其他币种利润 /// public decimal ProfitOther { get { return ReceivableOther - PayableOther; } } /// /// 退舱 /// public string? CancelCabin { get; set; } /// /// 签单方式 /// public string? IssueType { get; set; } /// /// 报关日期 /// public DateTime? CustomsDate { get; set; } /// /// 预抵日期 /// public DateTime? ETA { get; set; } /// /// 装货港 /// public string? LoadPort { get; set; } /// /// 卸货港 /// public string? DischargePort { get; set; } /// /// 目的地 /// public string? Destination { get; set; } /// /// 场站 /// public string? Yard { get; set; } /// /// 业务来源明细 /// public string? SourceDetailName { get; set; } /// /// 箱TEU /// public int TEU { get; set; } /// /// 品名 /// public string? GoodsName { get; set; } /// /// 国外代理 /// public string? Agent { get; set; } /// /// 操作员代码 /// public long? OperatorId { get; set; } /// /// 主提单号 /// public string? MBLNO { get; set; } /// /// 分提单号 /// public string? HBLNO { get; set; } /// /// 委托编号 /// public string? CustomerNo { get; set; } /// /// 费用对象ID /// public long? CustomerId { get; set; } /// /// 委托单位名称 /// public string? CustomerName { get; set; } /// /// 业务锁定 /// public bool? IsBusinessLocking { get; set; } /// /// 费用锁定 /// public bool? IsFeeLocking { get; set; } /// /// 开船日期 /// public DateTime? ETD { get; set; } /// /// 业务来源 /// public string? SourceName { get; set; } /// /// 集装箱 /// public string? CntrTotal { get; set; } /// /// 会计期间 /// public string? AccountDate { get; set; } /// /// 操作 /// public string? Operator { get; set; } /// /// 船名 /// public string? Vessel { get; set; } /// /// 航次 /// public string? Voyage { get; set; } /// /// 船公司 /// public string? Carrier { get; set; } /// /// 订舱代理 /// public string? Forwarder { get; set; } /// /// 订舱编号 /// public string? BookingNo { get; set; } } }