From a9ad4cabc4d303532fbd743538f7480c0eef5a69 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期五, 05 七月 2024 14:58:42 +0800 Subject: [PATCH] 库存盘点验证时的出入库数量使用盘点时的库存数量计算 --- models/material.go | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/models/material.go b/models/material.go index 20896fc..e410f35 100644 --- a/models/material.go +++ b/models/material.go @@ -164,7 +164,14 @@ } } if len(slf.MoreUnitList) != 0 { - str, err := json.Marshal(slf.MoreUnitList) + items := make([]UnitItems, 0) + for k, item := range slf.MoreUnitList { + if item.Unit != "" && !item.Amount.IsZero() { + items = append(items, slf.MoreUnitList[k]) + } + } + + str, err := json.Marshal(items) if err != nil { return err } -- Gitblit v1.8.0