From 1691d8ee8fe10799d98b296625fd30183407ef25 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 28 六月 2024 12:17:22 +0800
Subject: [PATCH] 新增操作类型增加基础操作类型和仓库id来支持库存盘点
---
service/more_units.go | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/service/more_units.go b/service/more_units.go
index 3a4cf49..5abdb09 100644
--- a/service/more_units.go
+++ b/service/more_units.go
@@ -11,8 +11,11 @@
func CreateMoreUnit(amount decimal.Decimal, units []models.UnitItems) []models.UnitItems {
moreValueArr := make([]models.UnitItems, 0, len(units))
for _, unitItem := range units {
+ if unitItem.Amount.IsZero() {
+ continue
+ }
moreValueArr = append(moreValueArr, models.UnitItems{
- Amount: amount.Mul(unitItem.Amount),
+ Amount: amount.Div(unitItem.Amount),
Unit: unitItem.Unit,
Floating: unitItem.Floating,
})
--
Gitblit v1.8.0