using System;
using Edu.Common.Enum.Finance;
using VT.FW.DB;

namespace Edu.Model.Entity.Finance
{
    /// <summary>
    /// 财务单据实体
    /// </summary>
    [Serializable]
    [DB(ConnectionName = "FinanceConnection")]
    public class RB_Finance
    {

        /// <summary>
        /// 主键
        /// </summary>        
        public int FrID
        {
            get;
            set;
        }
        /// <summary>
        /// 团控编号
        /// </summary>        
        public int? TCID
        {
            get;
            set;
        }
        /// <summary>
        /// 订单编号
        /// </summary>        
        public int? OrderID
        {
            get;
            set;
        }
        /// <summary>
        /// 手续费
        /// </summary>
        public decimal? Fee
        {
            get;
            set;
        }
        /// <summary>
        /// 原币手续费
        /// </summary>
        public decimal? OriginalFee
        {
            get; set;
        }
        /// <summary>
        /// 订单来源
        /// </summary>
        public OrderResourceEnum? OrderSource
        {
            get; set;
        }
        /// <summary>
        /// 其他来源ID
        /// </summary>
        public int? SourceID
        {
            get; set;
        }
        /// <summary>
        /// 客户类型
        /// </summary>        
        public Common.Enum.Finance.ClientTypeEnum? ClientType
        {
            get;
            set;
        }
        /// <summary>
        /// 客户编号
        /// </summary>        
        public int? ClientID
        {
            get;
            set;
        }
        /// <summary>
        /// 1-收入2-支出
        /// </summary>
        public WFTempLateClassEnum? Type
        {
            get; set;
        }
        /// <summary>
        /// 客户ID
        /// </summary>
        public int? CustomerId
        {
            get; set;
        }
        /// <summary>
        /// 流水号
        /// </summary>
        public string AccountNumber
        {
            get; set;
        }
        /// <summary>
        /// 发起人
        /// </summary>        
        public int? CreateBy
        {
            get;
            set;
        }
        /// <summary>
        /// 发起时间
        /// </summary>        
        public DateTime? CreateDate
        {
            get;
            set;
        }
        /// <summary>
        /// 集团
        /// </summary>        
        public int? RB_Group_Id
        {
            get;
            set;
        }
        /// <summary>
        /// 公司
        /// </summary>        
        public int? RB_Branch_Id
        {
            get;
            set;
        }
        /// <summary>
        /// 部门ID
        /// </summary>
        public int? RB_Depart_Id
        {
            get;
            set;
        }
        /// <summary>
        ///见枚举
        /// </summary>        
        public FinanceAuditStatus? Status
        {
            get;
            set;
        }
        /// <summary>
        /// 模板ID
        /// </summary>
        public int? TemplateId
        {
            get; set;
        }
        /// <summary>
        /// 模板工作流条件ID
        /// </summary>
        public int? ConditionId
        {
            get;
            set;
        }
        /// <summary>
        ///类型Type=1汇款人 Type=2则为客户名称
        /// </summary>
        public string RemitterName
        {
            get;
            set;
        }
        /// <summary>
        /// 交易日期
        /// </summary>
        public DateTime? TradeDate
        {
            get;
            set;
        }
        /// <summary>
        /// 原币金额
        /// </summary>
        public decimal? WBMoney
        {
            get; set;
        }
        /// <summary>
        /// 汇率
        /// </summary>
        public decimal? Rate
        {
            get; set;
        }
        /// <summary>
        /// 应付金额
        /// </summary>
        public decimal? Money
        {
            get;
            set;
        }
        /// <summary>
        /// 实收实付金额
        /// </summary>
        public decimal? PayMoney
        {
            get;
            set;
        }
        /// <summary>
        /// 发起备注
        /// </summary>
        public string Description
        {
            get;
            set;
        }
        /// <summary>
        /// 组价URL用于呈现单据相关信息
        /// </summary>
        public string URL { get; set; }
        /// <summary>
        /// 0-私账1-公账2-人民币现金3-外币现金
        /// </summary>
        public FinanceAccountTypeEnum? IsPublic
        {
            get; set;
        }
        /// <summary>
        /// 回调参数
        /// </summary>
        public string Callback { get; set; }
        /// <summary>
        /// 预计付款日期
        /// </summary>
        public DateTime? PayDate
        {
            get; set;
        }
        /// <summary>
        /// 出纳是否审核0-未审核1-已审核
        /// </summary>
        public int? Is_Cashier
        {
            get; set;
        }
        /// <summary>
        /// 是否自动生成0-否1-是
        /// </summary>
        public int? Is_Auto
        {
            get; set;
        }
        /// <summary>
        ///回调类型0-默认回调1-不回调
        /// </summary>
        public CallTypeEnum? CallType
        {
            get; set;
        }
        /// <summary>
        /// 地接批量审批的唯一编码
        /// </summary>
        public string DijieOnlyCode { get; set; }

        private int? otherType = 0;
        /// <summary>
        /// 其他来源类型  1追加团款  2单机票（2019-11-20 机票管理里  只有机票不绑团，其财务单据 需要在简易报表那边排除）
        /// 3 平台   4 外交平台  （2019-12-05）ld 
        /// 5 酒店折让单 2019-12-18 ld
        /// 6 手配费收入 2019-12-30 ld
        /// 7 预付款冲抵 2019-12-30 ld
        /// 8 领队返款单据 2020-03-30 ld
        /// 9 电商单据 2020-04-01 ld
        /// 10 财务收据 2020-04-09 ld
        /// 11 赞羊返佣 2020-06-09 ld
        /// 12 赞羊已发货退货退款 2020-06-09 ld
        /// 13 赞羊成本 2020-06-09 ld
        /// 14 赞羊未发货退款 2020-06-09 ld
        /// 15 电商采购 2020-07-07 ld
        /// 16 电商出库 2020-07-09 ld
        /// 17 电商报损/报溢单 2020-07-28 ld
        /// 18 电商推荐返佣 2020-08-05 ld
        /// 19 微店返佣 2020-08-05 ld
        /// 20 直播返佣 2020-08-18 ld
        /// 21 赞羊订单其他收入 2020-08-18 ld
        /// 22 赞羊订单其他支出 2020-08-18 ld
        /// 23 电商erp已发货退货退款 2020-09-15 ld
        /// 24 电商erp未发货退款(制单就原路退款) 2020-09-15 ld
        /// 25 和平甲鹤 已复制单据
        /// 26 教育教师奖金单据
        /// 27 教育教师绩效单据  2020-12-18 ld
        /// 28 教育退课单据 2020-12-23  ld
        /// 29 教育报价单-订单 2021-03-15  ld
        /// </summary>
        public int? OtherType { get => otherType; set => otherType = value; }

        /// <summary>
        /// 平台/外交平台id
        /// </summary>
        public int? PlatformAccountId { get; set; }
        /// <summary>
        /// 相关的财务单据id
        /// </summary>
        public int? ReFinanceId { get; set; }
        /// <summary>
        /// 冲抵金额  只能用于预付款冲抵，有统计 不能共用  会冲突
        /// </summary>
        public decimal? MatchMoney { get; set; }

        /// <summary>
        /// 关联信息2
        /// </summary>
        public int? ReFinanceId2 { get; set; }

        /// <summary>
        /// 创建人名称
        /// </summary>
        public string RB_CreateByName { get; set; }
        /// <summary>
        /// 集团名称
        /// </summary>
        public string RB_GroupName { get; set; }
        /// <summary>
        /// 公司名称
        /// </summary>
        public string RB_BranchName { get; set; }
        /// <summary>
        /// 部门名称
        /// </summary>
        public string RB_DepartName { get; set; }

        private int? financeType = 1;//默认erp
        /// <summary>
        /// 财务单据类型   1erp   2教育
        /// </summary>
        public int? FinanceType { get => financeType; set => financeType = value; }
    }
}
