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