using System;
using XYY.Common.Standard;
using XYY.Core.Standard;

namespace XYY.Model.Standard.Finance
{
    public class CustomerRemittance : Finance_CustomerDeliveryBill
    {
        /// <summary>
        /// 客户简称
        /// </summary>
        public string Abbreviation
        {
            get; set;
        }



    }
    [TrackTable(typeof(Finance_CustomerDeliveryBillLog))]
    public class Finance_CustomerDeliveryBill : BaseEntity
    {
        /// <summary>
        /// 当前逾期天数
        /// </summary>
        public int CurrentOverdueDays
        {
            get; set;
        }

        /// <summary>
        /// 最后还款日
        /// </summary>
        public DateTime? LastRepaymentDate
        {
            get; set;
        }



        /// <summary>
        /// 期末余额
        /// </summary>
        public decimal ClosingBalance
        {
            get; set;
        }

        /// <summary>
        /// 本期付款金额
        /// </summary>
        public decimal CurrentPeriod
        {
            get; set;
        }

        /// <summary>
        /// 本期应还金额	
        /// </summary>
        public decimal Arrears
        {
            get; set;
        }

        /// <summary>
        /// 本期还款金额
        /// </summary>
        public decimal Repayment
        {
            get; set;
        }

        /// <summary>
        /// 待还款金额
        /// </summary>
        public decimal AmountToBeRepaid
        {
            get; set;
        }

        /// <summary>
        /// 本期客户收入
        /// </summary>
        public decimal CustomerRevenue
        {
            get; set;
        }

        /// <summary>
        /// 本期客户支出
        /// </summary>
        public decimal CustomerExpenditure
        {
            get; set;
        }


        /// <summary>
        /// 上期余额
        /// </summary>
        public decimal BalanceOfPreviousPeriod
        {
            get; set;
        }

        public string Name
        {
            get; set;
        }

        public string Curreny
        {
            get; set;
        }

        public string ServiceBillUrl
        {
            get; set;
        }

        public FiannceServiceBillStatus Status
        {
            get; set;
        }

        public decimal SysWeight
        {
            get; set;
        }

        public decimal ServiceWeight
        {
            get; set;
        }

        public decimal SysFreigh
        {
            get; set;
        }

        /// <summary>
        /// 服务商金额
        /// </summary>
        public decimal ServiceFreigh
        {
            get; set;
        }


        /// <summary>
        /// 确认金额
        /// </summary>
        public decimal ConfirmedFreigh
        {
            get; set;
        }

        public decimal NotConfirmedFreigh
        {
            get; set;
        }

        /// <summary>
        /// 补款
        /// </summary>
        public decimal Supplement
        {
            get; set;
        }

        public decimal Deduction
        {
            get; set;
        }

        public DateTime StartTime
        {
            get; set;
        }

        public DateTime EndTime
        {
            get; set;
        }

        public int ChannelId
        {
            get; set;
        }

        public int CustomerId
        {
            get; set;
        }

        /// <summary>
        /// 应收款
        /// </summary>
        public decimal Receivables
        {
            get; set;
        }

        /// <summary>
        /// 已收款
        /// </summary>
        [Track("已收款")]
        public decimal Payment
        {
            get; set;
        }

        public decimal? ClaimAmount
        {
            get; set;
        }

        public int DeductionNode
        {
            get; set;
        }
        public int? BillTypeValue { get; set; }

        /// <summary>
        /// 账单状态 0 新增 1 完成 2 异常 3 重跑中
        /// </summary>
        public int BillState { get; set; }

        /// <summary>
        /// 临时编号
        /// </summary>
        public string BillTmpId { get; set; }

    }
    /// <summary>
    /// 头程账单逻辑处理
    /// </summary>
    public class OP_FirstBillInfo : Finance_CustomerDeliveryBill
    {
        public decimal Balance { get; set; }
        /// <summary>
        /// 付款期限天数
        /// </summary>
        public int RepaymentTermDay
        {
            get; set;
        }
        public string CompanyName { get; set; }
        /// <summary>
        /// 无旧账单时使用
        /// 获取余额
        /// </summary>
        public int CustomerInfoId { get; set; }

    }
}
