animeic %!s(int64=2) %!d(string=hai) anos
pai
achega
3ac0c3a319
Modificáronse 1 ficheiros con 15 adicións e 0 borrados
  1. 15 0
      boxcost/api/plan-cost-excel.go

+ 15 - 0
boxcost/api/plan-cost-excel.go

@@ -191,6 +191,10 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 							perRealPrice += mat.RealPrice
 							realPrice := fmt.Sprintf("%.3f", mat.RealPrice)
 							b.FormatToEmpty(&realPrice)
+							if mat.MatInfo.Unit == "吨" || mat.MatInfo.Unit == "平方米" {
+								mat.MatInfo.Unit = "张"
+							}
+
 							b.drawRow(row, "", mat.MatInfo.Name, "", supplierName, mat.MatInfo.Norm, matHeigth, matWidth, mat.MatInfo.Unit, orderCount, confirmCount, orderPrice, orderRealPrice, realPrice)
 
 							row++
@@ -236,6 +240,11 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 
 									// 实际金额 在外层合并单元格
 									realAmount := ""
+
+									if craft.CraftInfo.Unit == "吨" || craft.CraftInfo.Unit == "平方米" {
+										craft.CraftInfo.Unit = "张"
+									}
+
 									b.drawRow(row, "", "", craft.CraftInfo.Name, supplierName, craft.CraftInfo.Norm, carftHeigth, carftWidth, craft.CraftInfo.Unit, orderCount, confirmCount, price, budgetAmount, realAmount)
 									// mergeEndRow = row
 									category := craft.CraftInfo.Category
@@ -470,6 +479,9 @@ func (b *PlanCostExcel) drawAllContent() error {
 					perRealPrice += mat.RealPrice
 					realPrice := fmt.Sprintf("%.3f", mat.RealPrice)
 					b.FormatToEmpty(&realPrice)
+					if mat.MatInfo.Unit == "吨" || mat.MatInfo.Unit == "平方米" {
+						mat.MatInfo.Unit = "张"
+					}
 					b.drawRow(row, "", mat.MatInfo.Name, "", supplierName, mat.MatInfo.Norm, matHeigth, matWidth, mat.MatInfo.Unit, orderCount, confirmCount, orderPrice, orderRealPrice, realPrice)
 
 					row++
@@ -505,6 +517,9 @@ func (b *PlanCostExcel) drawAllContent() error {
 
 							// 实际金额 在外层合并单元格
 							realAmount := ""
+							if craft.CraftInfo.Unit == "吨" || craft.CraftInfo.Unit == "平方米" {
+								craft.CraftInfo.Unit = "张"
+							}
 							b.drawRow(row, "", "", craft.CraftInfo.Name, supplierName, craft.CraftInfo.Norm, carftHeigth, carftWidth, craft.CraftInfo.Unit, orderCount, confirmCount, price, budgetAmount, realAmount)
 							// mergeEndRow = row