using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.Sale;
using System;
using VT.FW.DB;

namespace Edu.Model.Entity.Course
{
    /// <summary>
    /// 订单实体类
    /// </summary>
    [Serializable]
    [DB(ConnectionName = "DefaultConnection")]
    public class RB_Order
    {
        /// <summary>
        /// 订单编号
        /// </summary>
		public int OrderId { get; set; }

        /// <summary>
        /// 班级id
        /// </summary>
        public int ClassId { get; set; }

        /// <summary>
        /// 交易方式  1线上交易   2线下交易
        /// </summary>
        public TradeWayEnum TradeWay { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal Class_Price { get; set; }
        /// <summary>
        /// 成交单价
        /// </summary>
        public decimal Unit_Price { get; set; }
        /// <summary>
        /// 客人数量
        /// </summary>
        public int GuestNum { get; set; }
        /// <summary>
        /// 应收总额
        /// </summary>
        public decimal PreferPrice { get; set; }
        /// <summary>
        /// 实收金额
        /// </summary>
        public decimal Income { get; set; }
        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal Refund { get; set; }
        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal DiscountMoney { get; set; }
        /// <summary>
        /// 平台税金
        /// </summary>
        public decimal PlatformTax { get; set; }
        /// <summary>
        /// 订单状态  枚举
        /// </summary>
        public OrderStateEnum OrderState { get; set; }
        /// <summary>
        /// 订单来源  枚举
        /// </summary>
        public OrderSourceEnum OrderSource { get; set; }
        /// <summary>
        /// 业务人员
        /// </summary>
        public int EnterID { get; set; }
        /// <summary>
        /// 订单来自于  枚举
        /// </summary>
        public OrderFormEnum OrderForm { get; set; }
        private decimal commission = -1;
        /// <summary>
        /// 提成金额
        /// </summary>
        public decimal CommissionMoney { get => commission; set => commission = value; }
        /// <summary>
        /// 额外奖励金额
        /// </summary>
        public decimal ExtraRewardMoney { get; set; }
        /// <summary>
        /// 额外扣除金额
        /// </summary>
        public decimal ExtraDeductMoney { get; set; }
        /// <summary>
        /// 提成是否已发放  1是  0否
        /// </summary>
        public int IsCommissionGive { get; set; }
        /// <summary>
        /// 销售备注
        /// </summary>
        public string SaleRemark { get; set; }
        /// <summary>
        /// 教务备注
        /// </summary>
        public string TeacherRemark { get; set; }
        /// <summary>
        /// 校长备注
        /// </summary>
        public string RectorRemark { get; set; }
        /// <summary>
        /// 经理备注
        /// </summary>
        public string DirectorRemark { get; set; }

        /// <summary>
		/// 集团编号
		/// </summary>
		public int Group_Id { get; set; }

        /// <summary>
        /// 学校编号
        /// </summary>
        public int School_Id { get; set; }

        /// <summary>
        /// 部门id
        /// </summary>
        public int Dept_Id { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public int CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public int UpdateBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 续费订单号
        /// </summary>
        public int RenewOrderId { get; set; }

        /// <summary>
        /// 报价单id
        /// </summary>
        public int OfferId { get; set; }

        /// <summary>
        /// 订单类型
        /// </summary>
        public OrderTypeEnum OrderType { get; set; }

        /// <summary>
        /// 来源编号(OrderType=1,SourceId=0),(OrderType=2,SourceId=留学就业产品对应编号)
        /// </summary>
        public int SourceId { get; set; }

        /// <summary>
        /// 协助人员编号(协助老师编号)
        /// </summary>
        public int HelpEnterId { get; set; }

        /// <summary>
        /// 一般同行名称
        /// </summary>
        public string GeneralOccupation { get; set; }

        /// <summary>
        /// 教育同行名称
        /// </summary>
        public string EduOccupation { get; set; }

        /// <summary>
        /// 是否少价(1-是)
        /// </summary>
        public int IsLessPrice { get; set; }

        /// <summary>
        /// 少价金额
        /// </summary>
        public decimal LessPrice { get; set; }

        /// <summary>
        /// (教育订单使用)订单性质(1-直通车,2-代收代付,3-返佣)
        /// </summary>
        public OrderNatureEnum OrderNature { get; set; }

        /// <summary>
        /// (教育订单使用)订单性质(1-直通车,2-代收代付,3-返佣)
        /// </summary>
        public decimal OldPreferPrice { get; set; }

        /// <summary>
        /// 课程编号
        /// </summary>
        public int CourseId { get; set; }

        /// <summary>
        /// 插班开始课时
        /// </summary>
        public int StartClassHours { get; set; }

        /// <summary>
        /// 是否插班报入(1是)
        /// </summary>
        public int IsChaBan { get; set; }

        /// <summary>
        /// 销售返佣类型  0百分比   1固定值
        /// </summary>
        public decimal CommissionType { get; set; }

        /// <summary>
        /// 提成比例/固定值
        /// </summary>
        public decimal CommissionRate { get; set; }

        /// <summary>
        /// 销售返佣类型  0百分比   1固定值 （同行）
        /// </summary>
        public decimal CommissionTypeTH { get; set; }

        /// <summary>
        /// 提成比例/固定值 （同行）
        /// </summary>
        public decimal CommissionRateTH { get; set; }

        /// <summary>
        /// 提成补交
        /// </summary>
        public decimal CommissionBack { get; set; }

        /// <summary>
        /// 提成备注： 记录下单时  使用的 比例
        /// </summary>
        public string CommissionRemark { get; set; }

        /// <summary>
        /// 额外提成已发放金额
        /// </summary>
        public decimal ExtraCommissionMoney { get; set; }

        /// <summary>
        /// 提成是否发放完毕   1是  0否
        /// </summary>
        public int IsCommissionGiveOK { get; set; }

        /// 生效时间
        /// </summary>
        public DateTime EffectTime { get; set; }

        /// <summary>
        /// 生效状态(0-未生效，1-生效中，2-完成)
        /// </summary>
        public int EffectStatus { get; set; }

        /// <summary>
        /// 前置订单编号
        /// </summary>
        public int UpOrderId { get; set; }

        /// <summary>
        /// 预约单号
        /// </summary>
        public int VisitorReserveId { get; set; }

        /// <summary>
        /// 留学确认时间（确认后 才能发提成  才进报表）
        /// </summary>
        public DateTime? LXConfirmDate { get; set; }

        ///
        /// 是否续班订单(1-是)
        /// </summary>
        public int IsRenewOrder { get; set; }
    }
}
