|
|
using DS.Module.Core.Data;
|
|
|
using DS.Module.Core.Enums;
|
|
|
using DS.WMS.Core.Application.Entity;
|
|
|
using DS.WMS.Core.Info.Entity;
|
|
|
using SqlSugar;
|
|
|
|
|
|
namespace DS.WMS.Core.Invoice.Entity
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 发票相关基类
|
|
|
/// </summary>
|
|
|
[SugarTable("application_invoice_form", TableDescription = "发票主表")]
|
|
|
public class Invoice : BaseOrgModelV2<long>
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 发票号
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "发票号", Length = 200, IsNullable = true)]
|
|
|
public string? InvoiceNO { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 发票业务编号
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "发票业务编号", Length = 20, IsNullable = false)]
|
|
|
public string BillNO { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 流水号
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "流水号", Length = 256, IsNullable = true)]
|
|
|
public string? SN { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票时间
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票时间")]
|
|
|
public DateTime InvoiceDate { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票单位ID
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票单位ID", IsNullable = false)]
|
|
|
public long CustomerId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票单位
|
|
|
/// </summary>
|
|
|
[Navigate(NavigateType.OneToOne, nameof(CustomerId))]
|
|
|
public InfoClient? Customer { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票单位名称
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票单位名称", Length = 200)]
|
|
|
public string? CustomerName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 收款单位银行
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "收款单位银行", Length = 100, IsNullable = true)]
|
|
|
public string? BankName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 收款单位银行
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "收款单位账号", Length = 100, IsNullable = true)]
|
|
|
public string? Account { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
///// 申请金额
|
|
|
///// </summary>
|
|
|
//[SugarColumn(ColumnDescription = "申请金额", IsNullable = true)]
|
|
|
//public decimal? ApplyAmount { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
///// 申请金额大写
|
|
|
///// </summary>
|
|
|
//[SugarColumn(ColumnDescription = "申请金额大写", Length = 100, IsNullable = true)]
|
|
|
//public string? AmountUppercase { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 币别
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "币别", IsNullable = false, Length = 3)]
|
|
|
public string Currency { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 锁定状态
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "锁定状态", DefaultValue = "0")]
|
|
|
public bool IsLocked { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 锁定人ID
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "锁定人ID", IsNullable = true)]
|
|
|
public long? LockUserId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 锁定时间
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "锁定时间", IsNullable = true)]
|
|
|
public DateTime? LockTime { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票人ID
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票人ID", IsNullable = true)]
|
|
|
public long? OperatorId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票方式
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票方式")]
|
|
|
public InvoiceMode Mode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 发票类型
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "发票类型")]
|
|
|
public InvoiceType? Type { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 是否已打印
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "是否已打印", DefaultValue = "0")]
|
|
|
public bool IsPrinted { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 是否已结算
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "是否已结算", DefaultValue = "0")]
|
|
|
public bool IsSettled { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票税率
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票税率")]
|
|
|
public decimal TaxRate { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 销方名称
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "销方名称", Length = 200, IsNullable = true)]
|
|
|
public string? OrgName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 发票抬头
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "发票抬头", Length = 200, IsNullable = true)]
|
|
|
public string? InvoiceHeader { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 纳税人识别号
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "纳税人识别号", Length = 60, IsNullable = true)]
|
|
|
public string? TaxID { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 客户纳税人识别号
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "客户纳税人识别号", Length = 60, IsNullable = true)]
|
|
|
public string? CustomerTaxID { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 客户地址电话
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "客户地址电话", Length = 200, IsNullable = true)]
|
|
|
public string? CustomerAddressTel { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 客户银行名称
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "客户银行名称", Length = 100, IsNullable = true)]
|
|
|
public string? CustomerBankName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 客户银行账号
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "客户银行账号", Length = 100, IsNullable = true)]
|
|
|
public string? CustomerAccount { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 代开客户
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "代开客户", Length = 200, IsNullable = true)]
|
|
|
public string? AutualCustomerName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 发票类别代码
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "发票类别代码", Length = 10, IsNullable = true)]
|
|
|
public string? CategoryCode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 发票类别
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "发票类别", Length = 50, IsNullable = true)]
|
|
|
public string? Category { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票金额(开票明细的合计)
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票金额")]
|
|
|
public decimal InvoiceAmount { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 外币金额(费用明细的外币合计)
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "外币金额")]
|
|
|
public decimal OtherInvoiceAmount { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 原币金额
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "原币金额")]
|
|
|
public decimal OriginalAmount { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 开票分公司ID(所属机构)
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "开票分公司ID(所属机构)")]
|
|
|
public long? SaleDeptId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 收款人
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "收款人", Length = 50, IsNullable = true)]
|
|
|
public string? Payee { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 复核人
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "复核人", Length = 50, IsNullable = true)]
|
|
|
public string? Checker { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 是否境外发票
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "是否境外发票", DefaultValue = "0")]
|
|
|
public bool IsOverseasInvoice { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 红票发票代码
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "红票发票代码", IsNullable = true, Length = 50)]
|
|
|
public string? RedCode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 红票发票ID
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "红票发票ID", IsNullable = true)]
|
|
|
public long? RedId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 是否被冲红
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "是否被冲红", DefaultValue = "0")]
|
|
|
public bool IsSetRed { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 冲红原因
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "冲红原因", Length = 100, IsNullable = true)]
|
|
|
public string? RedReason { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
///// 冲红确认单ID
|
|
|
///// </summary>
|
|
|
//[SugarColumn(ColumnDescription = "冲红确认单ID", IsNullable = true)]
|
|
|
//public long? RedBillId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 收款币别
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "收款币别", IsNullable = true, Length = 3)]
|
|
|
public string? ReceiptCurrency { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 推送方式
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "推送方式", Length = 10, IsNullable = true)]
|
|
|
public string? PushMode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 推送方式值
|
|
|
/// </summary>
|
|
|
[SugarColumn(IsIgnore = true)]
|
|
|
public PushMode[] PushModeValues { get; set; } = [];
|
|
|
|
|
|
/// <summary>
|
|
|
/// 手机号
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "手机号", Length = 20, IsNullable = true)]
|
|
|
public string? CellPhoneNO { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 邮箱
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "邮箱", Length = 100, IsNullable = true)]
|
|
|
public string? Email { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 电子发票接口类型
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "电子发票接口类型")]
|
|
|
public InvoiceApiType? ApiType { get; set; }
|
|
|
|
|
|
///// <summary>
|
|
|
///// 电子发票接口类型
|
|
|
///// </summary>
|
|
|
//[SugarColumn(ColumnDescription = "电子发票接口类型", Length = 50, IsNullable = true)]
|
|
|
//public string? ApiLine { get; set; }
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
///// 电子发票接口顺序号
|
|
|
///// </summary>
|
|
|
//[SugarColumn(ColumnDescription = "电子发票接口顺序号", Length = 50, IsNullable = true)]
|
|
|
//public string? ApiSerial { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 电子发票接口状态
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "电子发票接口状态", Length = 50, IsNullable = true)]
|
|
|
public string? ApiStatus { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 电子发票接口代码
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "电子发票接口代码", Length = 50, IsNullable = true)]
|
|
|
public string? ApiCode { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 电子发票PDF地址
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "电子发票PDF地址", Length = 300, IsNullable = true)]
|
|
|
public string? PDFUrl { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 是否已作废
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "是否已作废", DefaultValue = "0")]
|
|
|
public bool IsCancelled { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 作废人ID
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "作废人ID", IsNullable = true)]
|
|
|
public long? CancelUserId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 作废时间
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "作废时间")]
|
|
|
public DateTime? CancelTime { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 发票备注
|
|
|
/// </summary>
|
|
|
[SugarColumn(ColumnDescription = "发票备注", IsNullable = true)]
|
|
|
public string? InvoiceRemark { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 费用明细
|
|
|
/// </summary>
|
|
|
[Navigate(NavigateType.OneToMany, nameof(ApplicationDetail.ApplicationId))]
|
|
|
public List<ApplicationDetail> Details { get; set; } = [];
|
|
|
|
|
|
/// <summary>
|
|
|
/// 发票明细
|
|
|
/// </summary>
|
|
|
[Navigate(NavigateType.OneToMany, nameof(InvoiceDetail.ApplicationId))]
|
|
|
public List<InvoiceDetail> InvoiceDetails { get; set; } = [];
|
|
|
}
|
|
|
}
|