using System;
using System.Collections.Generic;
using System.Text;

namespace AutoTurnOver.Models.Report
{
    /// <summary>
    /// 现金流预测任务
    /// </summary>
    public class dc_report_cash_flow_forecast_task
    {
        public int id { get; set; }
        public string bailun_sku { get; set; }
        public string warehouse_code { get; set; }
        public string warehouse_type { get; set; }
        public string platform_type { get; set; }
        public string web_site { get; set; }
        /// <summary>
        /// 采购供应商交期
        /// </summary>
        public int delivery { get; set; }
        /// <summary>
        /// 调拨交期
        /// </summary>
        public int transfer_days { get; set; }
        /// <summary>
        /// 运输方式 -1 = 无 1 = 陆运 2 = 海运 3 = 空运
        /// </summary>
        public int transport_type { get; set; }
        /// <summary>
        /// 付款方式 1先款后货，2先货后款，3无需付款
        /// </summary>
        public int buy_pay_type { get; set; }
        /// <summary>
        /// 采购付款账期
        /// </summary>
        public int buy_pay_days { get; set; }
        /// <summary>
        /// 头程物流
        /// </summary>
        public string transfer_logistics_code { get; set; }
        /// <summary>
        /// 尾程物流
        /// </summary>
        public string tail_logistics_code { get; set; }
        /// <summary>
        /// 尾程物流
        /// </summary>
        public decimal refund_ratio { get; set; }
        /// <summary>
        /// 采购单价
        /// </summary>
        public decimal buy_unit_price_cny { get; set; }
        /// <summary>
        /// 采购moq
        /// </summary>
        public int moq { get; set; }
        /// <summary>
        /// 销售单价
        /// </summary>
        public decimal sale_unit_price_cny { get; set; }
        /// <summary>
        /// 状态 0 = 已提交 1=计算中 2= 计算完成  3 = 计算异常
        /// </summary>
        public int status { get; set; }

        /// <summary>
        /// 计算步骤
        /// </summary>
        public string step { get; set; }
        public string error_message { get; set; }
        public string error_stack_trace { get; set; }
        public decimal high { get; set; }
        public decimal @long { get; set; }
        public decimal weight_kg { get; set; }
        public decimal width { get; set; }


    }

    public class dc_report_cash_flow_forecast_task_sale
    {
        public int id { get; set; }
        public int task_id { get; set; }
        public DateTime date { get; set; }
        /// <summary>
        /// 销量
        /// </summary>
        public decimal val { get; set; }
    }

    public class dc_report_cash_flow_forecast_task_log
    {
        public int id { get; set; }

        public int task_id { get; set; }
        public string warehouse_code { get; set; }
        public string platform_type { get; set; }
        public string bailun_sku { get; set; }
        /// <summary>
        /// 1 = 销售数量 2 = 售金额 3 = 退款  4 = 利润  5 =平台费用  6=释放销售成本  7 = 释放头程费用  8 = 尾程费用  9 = 新增采购费用 10 =  新增头程费用
        /// </summary>
        public int data_type { get; set; }
        /// <summary>
        /// 1 = 实时  2 = 后付 3 = 后收 4 =预付
        /// </summary>
        public int pay_type { get; set; }
        /// <summary>
        /// 发送数值
        /// </summary>
        public decimal val { get; set; }
        /// <summary>
        /// 发送时间
        /// </summary>
        public DateTime occur_time { get; set; }
        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime pay_time { get; set; }
        /// <summary>
        /// 相关单号
        /// </summary>
        public string no { get; set; }
        /// <summary>
        /// 项目
        /// </summary>
        public string item { get; set; }
        /// <summary>
        /// 项目编号
        /// </summary>
        public string item_no { get; set; }
        public string web_site { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string remarks { get; set; }

        /// <summary>
        /// 是否作废
        /// </summary>
        public int is_delete { get; set; }
        public DateTime update_time { get; set; }
        public string pay_time_year_month_no { get; set; }
        public string occur_time_year_month_no { get; set; }
    }

    /// <summary>
    /// 虚拟周转模型，用来虚拟下单
    /// </summary>
    public class invented_turnover_model
    {
        public DateTime date { get; set; }
        public string date_str { get { return date.ToString("yyyy-MM-dd"); } }

        /// <summary>
        /// 预测数值
        /// </summary>
        public decimal val { get; set; }

        /// <summary>
        /// 1 = 预测可用库存
        /// 2 =  预测采购数量 未考虑 moq 备货天数
        /// 3 = 考虑备货天数 跟 moq 之后的采购数量
        /// </summary>
        public int type { get; set; }

        public enum type_enum
        {
            入库数量 = 1,
            采购数量 = 2,
            最终采购数量 = 3,
            销量 = 4,
            可用库存 = 5,
            /// <summary>
            /// 采购中转仓入库之后，下调拨单
            /// </summary>
            调拨下单 = 6
        }
    }

}
