dsmzx
2024-06-26 8053877f1321da612b3cfa128b3ffffaf0d77e77
出库/入库 打印 修改bug
1个文件已修改
23 ■■■■■ 已修改文件
controllers/operation.go 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go
@@ -1002,8 +1002,8 @@
    sheet := "Sheet1"
    f.SetCellValue(sheet, "A2", "单位(部门):"+operation.CompanyName) // 单位部门
    f.SetCellValue(sheet, "H2", operation.OperationDate)         // 时间
    f.SetCellValue(sheet, "O2", operation.Number)                // 编号
    f.SetCellValue(sheet, "J2", operation.OperationDate)         // 时间
    f.SetCellValue(sheet, "Q2", operation.Number)                // 编号
    totalAmount := decimal.NewFromInt(0) // 总金额
    totalPrice := decimal.NewFromInt(0)  // 总价
@@ -1013,14 +1013,19 @@
        if i > 9 {
            break
        }
        f.SetCellValue(sheet, "A"+strconv.Itoa(rowIndex), v.Product.Name)               // 产品名称
        f.SetCellValue(sheet, "B"+strconv.Itoa(rowIndex), v.Product.Specs)              //规格
        f.SetCellValue(sheet, "C"+strconv.Itoa(rowIndex), v.TotalGrossWeight.String())  //重量
        f.SetCellValue(sheet, "D"+strconv.Itoa(rowIndex), v.Amount.String())            //数量
        f.SetCellValue(sheet, "E"+strconv.Itoa(rowIndex), v.AuxiliaryAmount.String())   //辅助数量
        f.SetCellValue(sheet, "F"+strconv.Itoa(rowIndex), v.AuxiliaryUnit)              //辅助单位
        f.SetCellValue(sheet, "A"+strconv.Itoa(rowIndex), v.Product.Name)    // 品名
        f.SetCellValue(sheet, "B"+strconv.Itoa(rowIndex), v.Product.Type)    // 型号
        f.SetCellValue(sheet, "C"+strconv.Itoa(rowIndex), v.Product.Unit)    // 单位
        f.SetCellValue(sheet, "D"+strconv.Itoa(rowIndex), v.Amount.String()) // 数量
        unit := service.CreateMoreUnit(v.Amount, v.Product.MoreUnitList)
        for _, v1 := range unit {
            if !v1.Amount.IsZero() {
                f.SetCellValue(sheet, "E"+strconv.Itoa(rowIndex), v1.Amount) // 辅数量
                f.SetCellValue(sheet, "F"+strconv.Itoa(rowIndex), v1.Unit)   // 辅单位
                break
            }
        }
        f.SetCellValue(sheet, "G"+strconv.Itoa(rowIndex), v.Product.SalePrice.String()) // 单价
        // 金额
        if !v.Product.SalePrice.IsZero() {
            ap := v.Amount.Mul(v.Product.SalePrice)