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.

268 lines
7.2 KiB
C#

using System.Runtime.Serialization;
using DS.Module.Core;
using DS.WMS.Core.Op.Entity;
5 months ago
namespace DS.WMS.Core.Application.Dtos
{
/// <summary>
5 months ago
/// 费用记录
/// </summary>
5 months ago
public class FeeRecordDto
{
/// <summary>
5 months ago
/// 费用记录ID
/// </summary>
5 months ago
public long RecordId { get; set; }
/// <summary>
5 months ago
/// 业务ID
/// </summary>
5 months ago
public long BusinessId { get; set; }
5 months ago
/// <summary>
/// 业务类型
/// </summary>
public BusinessType BusinessType { get; set; }
/// <summary>
/// 客户ID
/// </summary>
public long CustomerId { get; set; }
5 months ago
/// <summary>
/// 客户名称
/// </summary>
public string? CustomerName { get; set; }
/// <summary>
5 months ago
/// 费用ID
/// </summary>
5 months ago
public long FeeId { get; set; }
/// <summary>
5 months ago
/// 费用名称
/// </summary>
5 months ago
public string? FeeName { get; set; }
/// <summary>
/// 收付/费用类型
/// </summary>
5 months ago
public FeeType FeeType { get; set; }
/// <summary>
5 months ago
/// 费用总金额
/// </summary>
5 months ago
public decimal Amount { get; set; }
/// <summary>
5 months ago
/// 币别
/// </summary>
5 months ago
public string Currency { get; set; }
/// <summary>
5 months ago
/// 剩余金额
/// </summary>
5 months ago
public decimal RestAmount { get; set; }
/// <summary>
/// 本次申请/开票金额
5 months ago
/// </summary>
public decimal ApplyAmount { get; set; }
/// <summary>
/// 原始汇率
/// </summary>
public decimal? ExchangeRate { get; set; }
5 months ago
[IgnoreDataMember]
public long CreateBy { get; set; }
/// <summary>
/// 录入人
/// </summary>
public string? CreateByName { get; set; }
/// <summary>
/// 录入方式
/// </summary>
public string? InputMethod { get; set; }
5 months ago
/// <summary>
/// 备注
/// </summary>
public string? Remark { get; set; }
}
/// <summary>
5 months ago
/// 按业务展示的费用信息
/// </summary>
5 months ago
public class PaymentApplicaitonBiz
{
5 months ago
readonly IEnumerable<FeePaymentDto> _items;
/// <summary>
5 months ago
/// 费用记录项
/// </summary>
5 months ago
public IEnumerable<FeePaymentDto> Items => _items;
/// <summary>
5 months ago
/// 使用指定的数据源初始化统计。
/// </summary>
5 months ago
/// <param name="source">数据源</param>
public PaymentApplicaitonBiz(List<FeePaymentDto> source)
{
_items = source;
//人民币
ReceivableCNY = _items.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount);
PayableCNY = _items.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount);
//美元
ReceivableUSD = _items.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount);
PayableUSD = _items.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount);
//其他
ReceivableOther = _items.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount);
PayableOther = _items.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD" && x.Currency != "CNY").Sum(x => x.Amount);
}
/// <summary>
5 months ago
/// 人民币应收款
/// </summary>
5 months ago
public decimal ReceivableCNY { get; private set; }
/// <summary>
5 months ago
/// 人民币应付款
/// </summary>
5 months ago
public decimal PayableCNY { get; private set; }
/// <summary>
5 months ago
/// 美元应收款
/// </summary>
5 months ago
public decimal ReceivableUSD { get; private set; }
/// <summary>
5 months ago
/// 美元应付款
/// </summary>
5 months ago
public decimal PayableUSD { get; private set; }
/// <summary>
5 months ago
/// 其他币种应收款
/// </summary>
5 months ago
public decimal ReceivableOther { get; private set; }
/// <summary>
5 months ago
/// 其他币种应付款
/// </summary>
5 months ago
public decimal PayableOther { get; private set; }
}
5 months ago
/// <summary>
/// 付费申请费用记录
/// </summary>
public class FeePaymentDto : FeeRecordDto
{
/// <summary>
5 months ago
/// 原始汇率
/// </summary>
5 months ago
public decimal? OriginalRate { get; set; }
/// <summary>
/// 原始币别
/// </summary>
public string OriginalCurrency { get; set; }
/// <summary>
5 months ago
/// 本次申请原始金额
/// </summary>
5 months ago
public decimal? OriginalApplyAmount { get; set; }
/// <summary>
5 months ago
/// 开票金额
/// </summary>
5 months ago
public decimal? InvoiceAmount { get; set; }
public long? SaleDeptId { get; set; }
/// <summary>
/// 所属分部
/// </summary>
public string? SaleDeptName { get; set; }
/// <summary>
/// 税率
/// </summary>
public decimal TaxRate { get; set; }
/// <summary>
/// 录入方式
/// </summary>
public string? InputMethod { get; set; }
5 months ago
}
/// <summary>
/// 按业务展示的费用信息
/// </summary>
public class InvoiceApplicaitonBiz
{
readonly IEnumerable<FeeInvoiceDto> _items;
/// <summary>
5 months ago
/// 费用记录项
/// </summary>
5 months ago
public IEnumerable<FeeInvoiceDto> Items => _items;
/// <summary>
5 months ago
/// 使用指定的数据源初始化统计。
/// </summary>
5 months ago
/// <param name="source">数据源</param>
public InvoiceApplicaitonBiz(List<FeeInvoiceDto> source)
{
_items = source;
RestAmountCNY = _items.Where(x => x.Currency == "CNY").Sum(x => x.RestAmount);
RestAmountUSD = _items.Where(x => x.Currency == "USD").Sum(x => x.RestAmount);
RestAmountOther = _items.Where(x => x.Currency != "CNY" && x.Currency != "USD").Sum(x => x.RestAmount);
}
/// <summary>
5 months ago
/// 人民币未开
/// </summary>
5 months ago
public decimal RestAmountCNY { get; private set; }
/// <summary>
5 months ago
/// 美元未开
/// </summary>
5 months ago
public decimal RestAmountUSD { get; private set; }
/// <summary>
5 months ago
/// 其他未开
/// </summary>
5 months ago
public decimal RestAmountOther { get; private set; }
}
5 months ago
/// <summary>
/// 发票申请费用记录
/// </summary>
public class FeeInvoiceDto : FeeRecordDto
{
/// <summary>
5 months ago
/// 税率
/// </summary>
5 months ago
public decimal TaxRate { get; set; }
/// <summary>
/// 原始申请金额
/// </summary>
public decimal OriginalAmount { get; set; }
/// <summary>
/// 原始汇率
/// </summary>
public decimal? OriginalRate { get; set; }
/// <summary>
/// 原始币别
/// </summary>
public string? OriginalCurrency { get; set; }
}
}