jiangshuai
2023-10-20 96844c22ef3fba86a55e0af1b51bc1009d6fa950
constvar/const.go
@@ -6,6 +6,8 @@
   BaseOperationTypeIncoming BaseOperationType = iota + 1 //收货
   BaseOperationTypeOutgoing                              //交货
   BaseOperationTypeInternal                              //内部调拨
   BaseOperationTypeDisuse                                //报废
   BaseOperationTypeAdjust                                //库存盘点
)
func (slf BaseOperationType) IsValid() bool {
@@ -46,9 +48,46 @@
type ProductType int
const (
   ProductTypeRaw      = iota + 1 // 原材料
   ProductTypeSemi                // 半成品
   ProductTypeFinished            // 成品
   Consumables   ProductType = iota + 1 // 消耗品
   Server                               // 服务
   StoredProduct                        // 可储存的产品
)
type MaterialMode string
const (
   MaterialModeRaw      MaterialMode = "原材料"
   MaterialModeSemi     MaterialMode = "半成品"
   MaterialModeFinished MaterialMode = "成品"
)
type MaterialStatus int
const (
   MaterialStatusCreate   MaterialStatus = iota // 新建
   MaterialStatusActive                         // 启用
   MaterialStatusInactive = -1                  // 停用
)
// InvoicingStrategy 开票策略
type InvoicingStrategy int
const (
   IndentNumber       InvoicingStrategy = iota + 1 //订购数量
   DeliverNumber                                   //交付数量
   PrepaidPrice                                    //预付\固定价格
   Milestones                                      //基于里程碑
   BasedDeliverNumber                              //基于交付数量
)
// OrderCreation 订单创建
type OrderCreation int
const (
   Nothing       OrderCreation = iota + 1 //不操作
   Task                                   //任务
   Object                                 //项目
   TaskAndObject                          //任务和项目
)
type ProductStatus int
@@ -87,6 +126,8 @@
   LocationTypeInventoryLoss                         // 库存损失
   LocationTypeProduction                            // 生产
   LocationTypeTransit                               // 中转位置
   LocationTypeDisuse                                //报废位置
   LocationTypeAdjust                                //库存盘点
)
func (t LocationType) Valid() bool {
@@ -110,7 +151,7 @@
const (
   CostingMethodStandardPrice CostingMethod = iota + 1 //标准价格
   CostingMethodFIFO                                   //先进先出
   CostingMethodAverageCost                            //
   CostingMethodAverageCost                            //平均成本
)
func (t CostingMethod) Valid() bool {
@@ -136,3 +177,10 @@
   OperationStatus_Ready                              //就绪
   OperationStatus_Finish                             //完成
)
type PostType int
const (
   PostType_Soon       PostType = iota + 1 //尽快
   PostType_AfterReady                     //当所有产品就绪时
)