using System.Runtime.Serialization; using DS.Module.Core; using DS.Module.Core.Enums; using DS.WMS.Core.Op.Entity; namespace DS.WMS.Core.Fee.Dtos { /// /// 费用申请单 /// public class ApplicationDto { /// /// 申请单编号 /// public string ApplicationNO { get; set; } /// /// 申请单状态 /// public PaymentApplicationStatus Status { get; set; } /// /// 人民币申请金额 /// public decimal? AmountRMB { get; set; } /// /// 美元申请金额 /// public decimal? AmountUSD { get; set; } /// /// 其他币别申请金额 /// public decimal? AmountOther { get; set; } /// /// 申请币别 /// public string? Currency { get; set; } /// /// 折算汇率 /// public decimal? ExchangeRate { get; set; } /// /// 审核人 /// public long? AuditerId { get; set; } /// /// 审核人名称 /// public string? AuditerName { get; set; } /// /// 审核时间 /// public DateTime? AuditTime { get; set; } /// /// 审核备注 /// public string? AuditRemark { get; set; } /// /// 是否已打印 /// public bool IsPrinted { get; set; } /// /// 打印次数 /// public int PrintTimes { get; set; } /// /// 打印人 /// public long? PrinterId { get; set; } /// /// 打印人名称 /// public string? PrinterName { get; set; } /// /// 打印时间 /// public DateTime? PrintTime { get; set; } /// /// 驳回原因 /// public string? Reason { get; set; } /// /// 客户名称/结算单位 /// public string? CustomerName { get; set; } /// /// 结算方式 /// public int Type { get; set; } /// /// 结算人 /// public long? SettlerId { get; set; } /// /// 结算人名称 /// public string? SettlerName { get; set; } /// /// 结算时间 /// public DateTime? SettlementTime { get; set; } /// /// 支票备注 /// public string? ChequeRemarks { get; set; } /// /// 发票号 /// public string? InvoiceNO { get; set; } /// /// 发票日期 /// public DateTime? InvoiceDate { get; set; } /// /// 开票金额 /// public decimal? InvoiceAmount { get; set; } /// /// 客户银行账号 /// public string? CustomerBAN { get; set; } /// /// 所属分部 /// [IgnoreDataMember] public long? SaleDeptId { get; set; } public string? SaleDeptName { get; set; } /// /// 备注 /// public string? Note { get; set; } /// /// 创建时间 /// public DateTime CreateTime { get; set; } /// /// 创建人 /// public long CreateBy { get; set; } public string CreateByName { get; set; } public List? Details { get; set; } /// /// 委托单位 /// public string? Client { get; set; } /// /// 结算对象银行 /// public string? CustomerBank { get; set; } /// /// 审核状态(仅查询用) /// public AuditStatusForQuery? AuditStatus { get; set; } } public enum AuditStatusForQuery { /// /// 未审核 /// Pending = 1, /// /// 已审核 /// Audited = 2, /// /// 仅需自己审核 /// MarkerOnly = 3 } /// /// 费用申请单明细 /// public class FeeApplicationDetailDto { /// /// 业务类型 /// public long BusinessId { get; set; } /// /// 业务类型 /// public BusinessType BusinessType { 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? SaleName { get; set; } /// /// 集装箱 /// public string? CntrTotal { get; set; } /// /// 会计期间 /// public string? AccountDate { get; set; } /// /// 所属分部 /// public string? SaleDeptName { get; set; } /// /// 费用名称 /// public string? FeeName { get; set; } /// /// 费用类型 /// public FeeType FeeType { get; set; } /// /// 费用对象 /// public string? FeeObject { get; set; } /// /// 申请金额 /// public decimal Amount { get; set; } /// /// 原始金额 /// public decimal OriginalAmount { get; set; } /// /// 原始币别 /// public string OriginalCurrency { get; set; } /// /// 原始汇率 /// public decimal? OriginalRate { get; set; } /// /// 折算汇率 /// public decimal? ExchangeRate { get; set; } /// /// 销项税率 /// public decimal AccTaxRate { get; set; } /// /// 更改单 /// public string? ChangeOrder { 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 decimal? OutstandingAmount { get; set; } /// /// 发票备注 /// public string? InvoiceRemark { get; set; } /// /// 订舱编号 /// public string? BookingNo { get; set; } } /// /// 费用申请单审核明细展示 /// public class FeeApplicationSummary { /// /// 费用汇总 /// public List SummaryItems { get; set; } /// /// 申请单明细 /// public List? Details { get; set; } /// /// 初始化 /// /// 申请单明细 public FeeApplicationSummary(List 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; } } }