1.修复供应商采购汇总部分金额没有四舍五入的缺陷;
This commit is contained in:
parent
ce6708942a
commit
c64de0727b
|
@ -5015,6 +5015,8 @@ func GetReportBySupplier(req *ErpPurchaseReportBySupplierReq, c *gin.Context) (
|
|||
//resp.List[i].Amount = -resultInfo.TotalWholesalePrice
|
||||
resp.List[i].Amount = resp.List[i].RejectAmount
|
||||
}
|
||||
|
||||
resp.List[i].Amount = math.Round(resp.List[i].Amount*100) / 100
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5032,10 +5034,10 @@ func GetReportBySupplier(req *ErpPurchaseReportBySupplierReq, c *gin.Context) (
|
|||
totalDifference += item.Difference
|
||||
}
|
||||
|
||||
resp.Amount = totalAmount
|
||||
resp.Amount = math.Round(totalAmount*100) / 100
|
||||
resp.Count = totalCount
|
||||
resp.RejectAmount = totalRejectAmount
|
||||
resp.Difference = totalDifference
|
||||
resp.RejectAmount = math.Round(totalRejectAmount*100) / 100
|
||||
resp.Difference = math.Round(totalDifference*100) / 100
|
||||
resp.Total = len(mergedData)
|
||||
|
||||
// 排序规则:供应商编号小>商品编号小>店铺编号小>类型为采购入库
|
||||
|
@ -5163,6 +5165,8 @@ func mergeData(esData []PurchaseReportData) []PurchaseReportData {
|
|||
// 根据有序的键列表顺序构建返回的数组
|
||||
var mergedData []PurchaseReportData
|
||||
for _, key := range keys {
|
||||
mergedMap[key].Amount = math.Round(mergedMap[key].Amount*100) / 100
|
||||
mergedMap[key].RejectAmount = math.Round(mergedMap[key].RejectAmount*100) / 100
|
||||
mergedData = append(mergedData, *mergedMap[key])
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user