| | |
| | | |
| | | 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) // 总价 |
| | |
| | | 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) |