1、采购订单入库相关金额恢复2位小数;相同商品除不尽的情况通过新建多条数据来处理;

This commit is contained in:
chenlin 2024-09-20 10:58:13 +08:00
parent 2ff86339b1
commit 07544bcc1c
3 changed files with 2 additions and 8 deletions

View File

@ -285,7 +285,6 @@ func ErpPurchaseDetail(c *gin.Context) {
v.EffectiveCount = nCount // 有效数量 v.EffectiveCount = nCount // 有效数量
v.ErpCategoryID = erpCommodity.ErpCategoryId v.ErpCategoryID = erpCommodity.ErpCategoryId
v.ErpCategoryName = erpCommodity.ErpCategoryName v.ErpCategoryName = erpCommodity.ErpCategoryName
v.Price = math.Round(v.Price*1000) / 1000
commodityList = append(commodityList, v) commodityList = append(commodityList, v)
} }

View File

@ -1330,8 +1330,8 @@ func InventoryErpPurchaseUpdateStock(gdb *gorm.DB, list []ErpPurchaseInventory,
ErpCategoryName: commodityInfo.ErpCategoryName, ErpCategoryName: commodityInfo.ErpCategoryName,
ErpSupplierId: purchaseOrder.ErpSupplierId, ErpSupplierId: purchaseOrder.ErpSupplierId,
ErpSupplierName: purchaseOrder.ErpSupplierName, ErpSupplierName: purchaseOrder.ErpSupplierName,
StaffCostPrice: tools.RoundToThreeDecimalPlaces(v.EmployeePrice - v.ImplementationPrice), StaffCostPrice: tools.RoundToTwoDecimalPlaces(v.EmployeePrice - v.ImplementationPrice),
WholesalePrice: tools.RoundToThreeDecimalPlaces(v.ImplementationPrice), WholesalePrice: tools.RoundToTwoDecimalPlaces(v.ImplementationPrice),
State: InStock, State: InStock,
StorageType: PurchaseInventory, // 采购入库 StorageType: PurchaseInventory, // 采购入库
FirstStockTime: nowTime, FirstStockTime: nowTime,

View File

@ -116,11 +116,6 @@ func RoundToTwoDecimalPlaces(num float64) float64 {
return math.Round(num*100) / 100 return math.Round(num*100) / 100
} }
// RoundToThreeDecimalPlaces 将float64类型四舍五入保留3位小数
func RoundToThreeDecimalPlaces(num float64) float64 {
return math.Round(num*1000) / 1000
}
// Uint32SliceContains 检查 uint32 切片中是否包含特定的值 // Uint32SliceContains 检查 uint32 切片中是否包含特定的值
func Uint32SliceContains(slice []uint32, val uint32) bool { func Uint32SliceContains(slice []uint32, val uint32) bool {
for _, item := range slice { for _, item := range slice {