1、采购订单入库相关金额恢复2位小数;相同商品除不尽的情况通过新建多条数据来处理;
This commit is contained in:
parent
2ff86339b1
commit
07544bcc1c
|
@ -285,7 +285,6 @@ func ErpPurchaseDetail(c *gin.Context) {
|
|||
v.EffectiveCount = nCount // 有效数量
|
||||
v.ErpCategoryID = erpCommodity.ErpCategoryId
|
||||
v.ErpCategoryName = erpCommodity.ErpCategoryName
|
||||
v.Price = math.Round(v.Price*1000) / 1000
|
||||
|
||||
commodityList = append(commodityList, v)
|
||||
}
|
||||
|
|
|
@ -1330,8 +1330,8 @@ func InventoryErpPurchaseUpdateStock(gdb *gorm.DB, list []ErpPurchaseInventory,
|
|||
ErpCategoryName: commodityInfo.ErpCategoryName,
|
||||
ErpSupplierId: purchaseOrder.ErpSupplierId,
|
||||
ErpSupplierName: purchaseOrder.ErpSupplierName,
|
||||
StaffCostPrice: tools.RoundToThreeDecimalPlaces(v.EmployeePrice - v.ImplementationPrice),
|
||||
WholesalePrice: tools.RoundToThreeDecimalPlaces(v.ImplementationPrice),
|
||||
StaffCostPrice: tools.RoundToTwoDecimalPlaces(v.EmployeePrice - v.ImplementationPrice),
|
||||
WholesalePrice: tools.RoundToTwoDecimalPlaces(v.ImplementationPrice),
|
||||
State: InStock,
|
||||
StorageType: PurchaseInventory, // 采购入库
|
||||
FirstStockTime: nowTime,
|
||||
|
|
|
@ -116,11 +116,6 @@ func RoundToTwoDecimalPlaces(num float64) float64 {
|
|||
return math.Round(num*100) / 100
|
||||
}
|
||||
|
||||
// RoundToThreeDecimalPlaces 将float64类型四舍五入保留3位小数
|
||||
func RoundToThreeDecimalPlaces(num float64) float64 {
|
||||
return math.Round(num*1000) / 1000
|
||||
}
|
||||
|
||||
// Uint32SliceContains 检查 uint32 切片中是否包含特定的值
|
||||
func Uint32SliceContains(slice []uint32, val uint32) bool {
|
||||
for _, item := range slice {
|
||||
|
|
Loading…
Reference in New Issue
Block a user