lishihai
2024-06-20 d533225faddf7b77497b479e8c3fe6458ffe7c40
成本单价-销售单价业务修正
2个文件已修改
12 ■■■■ 已修改文件
controllers/operation.go 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/operation_details.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go
@@ -95,7 +95,7 @@
        if err := models.NewOperationSearch().Create(&params); err != nil {
            return err
        }
        od := params.Details
        /*od := params.Details
        for _, v := range od {
            //material, err := models.NewMaterialSearch().SetID(v.ProductId).First()
            //if err != nil {return err}
@@ -106,7 +106,7 @@
            if err := models.NewMaterialSearch().SetOrm(db).Update(material); err != nil {
                return err
            }
        }
        }*/
        return nil
    })
@@ -352,7 +352,7 @@
        if err := models.NewOperationSearch().SetOrm(tx).SetID(params.Id).Save(&params); err != nil {
            return err
        }
        od := params.Details
        /*od := params.Details
        for _, v := range od {
            //material, err := models.NewMaterialSearch().SetID(v.ProductId).First()
            //if err != nil {return err}
@@ -363,7 +363,7 @@
            if err := models.NewMaterialSearch().SetOrm(tx).Update(material); err != nil {
                return err
            }
        }
        }*/
        return nil
    }); err != nil {
        util.ResponseFormat(c, code.RequestParamError, "修改失败:"+err.Error())
models/operation_details.go
@@ -30,8 +30,8 @@
        Remark           string          `gorm:"type:varchar(1024);comment:备注" json:"remark"`
        IsInternalOutput bool            `json:"isInternalOutput"` //是否调拨产生的出库
        Cost      decimal.Decimal `json:"cost" gorm:"-"`      //成本单价
        SalePrice decimal.Decimal `json:"salePrice" gorm:"-"` //销售单价
        Cost      decimal.Decimal `json:"cost" `      //成本单价
        SalePrice decimal.Decimal `json:"salePrice" ` //销售单价
    }
    OperationDetailsSearch struct {