Imports System.ComponentModel

Namespace UTSModule.Production
    Public Enum OrderStatusEnum

        ''' <summary>
        ''' 已下单待转内部单
        ''' </summary>
        <Description("已下单待转M/O")>
        PlaceOrder = 1

        ''' <summary>
        ''' 已转M/O待制条码
        ''' </summary>
        <Description("已转M/O待制条码")>
        MOrder = 2

        ''' <summary>
        ''' 已制SN待制计划
        ''' </summary>
        <Description("已制SN待制计划")>
        SnRules = 3

        ''' <summary>
        ''' 已制计划待生产
        ''' </summary>
        <Description("已制计划待生产")>
        ProductionPlan = 4

        ''' <summary>
        ''' 生产中
        ''' </summary>
        <Description("生产中")>
        InProduction = 5

        ''' <summary>
        ''' 完成生产
        ''' </summary>
        <Description("完成生产")>
        CompleteProduction = 6

        ''' <summary>
        ''' 已完成
        ''' </summary>
        <Description("已完成")>
        Completed = 7

        ''' <summary>
        ''' 取消
        ''' </summary>
        <Description("取消")>
        Cancel = -1

        ''' <summary>
        ''' 暂停中
        ''' </summary>
        <Description("暂停中")>
        Suspend = -2

    End Enum


    ''' <summary>
    ''' 客户订单信息
    ''' </summary>
    Public Class CustomerOrderManager
        Sub New()
            OrderID = -1

            OrderStatus = OrderStatusEnum.Suspend
        End Sub

        ''' <summary>
        ''' 订单索引
        ''' </summary>
        Public OrderID As Integer


        ''' <summary>
        ''' 订单条码序号字符串
        ''' </summary>
        Public OrderNo As String

        ''' <summary>
        ''' 订单状态
        ''' </summary>

        Public OrderStatus As OrderStatusEnum

        ''' <summary>
        ''' 订单总量
        ''' </summary>
        Public OrderCount As Integer

        ''' <summary>
        ''' 订单产品
        ''' </summary>

        Public ProductID As Integer

        ''' <summary>
        ''' 订单所属客户索引
        ''' </summary>
        Public CompanyID As Integer

        ''' <summary>
        ''' 订单交期
        ''' </summary>
        Public DeliveryTime As Date

        ''' <summary>
        ''' 订单创建时间
        ''' </summary>
        Public CreateTime As Date

        ''' <summary>
        ''' 成本单价
        ''' </summary>
        Public CostPrice As Double

        ''' <summary>
        ''' 销售单价
        ''' </summary>
        Public TransactPrice As Double


        Public Function IsInitialized() As Boolean
            If OrderID = -1 Then Return False

            Return True
        End Function
    End Class
End Namespace