zhangqian
2024-01-12 884bce48b11018adf1c15591aeab9af6cb9e5b6b
支持有库存管理的产品
2个文件已修改
6 ■■■■■ 已修改文件
model/test/material.go 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/test/product.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
model/test/material.go
@@ -26,7 +26,9 @@
    MinPurchaseAmount decimal.Decimal `gorm:"type:decimal(35,18);comment:最小采购量" json:"minPurchaseAmount"`
    PurchaseType      PurchaseType    `gorm:"type:int(11);comment:采购类型" json:"purchaseType"`
    SalePrice         decimal.Decimal `gorm:"type:decimal(35,18);comment:销售单价" json:"salePrice"`
    CategoryName      string          `gorm:"type:varchar(255);comment:产品类别名称" json:"categoryName"` //产品类别名称
    CategoryName      string          `gorm:"type:varchar(255);comment:产品类别名称" json:"categoryName"`            //产品类别名称
    IsStorage         int             `gorm:"type:tinyint(1);default:1;comment:是否存库(1是2否)" json:"isStorage"`   //无库存的在wms以及srm中需要过滤掉
    IsVirtual         int             `json:"isVirtual" gorm:"type:tinyint(1);default:2;comment:是否虚拟物料(1是2否)"` //虚拟物料在MRP计算时跳过该层级直接领用下级物料,虚拟物料不生成工单
}
// PurchaseType 采购类型
service/test/product.go
@@ -120,7 +120,7 @@
    db = db.Where("purchase_type = ?", test.PurchaseTypeOutSource)
    db = db.Where("material_type != ?", test.MaterialTypeVirtual)
    db = db.Where("is_storage = ?", 1)
    err = db.Count(&total).Error
    if err != nil {