You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

374 lines
9.0 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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