瀏覽代碼

修复成本表实际价格错误

animeic 2 年之前
父節點
當前提交
d2721943bc
共有 2 個文件被更改,包括 7 次插入7 次删除
  1. 6 6
      boxcost/api/plan-cost-excel.go
  2. 1 1
      boxcost/db/model/pack.go

+ 6 - 6
boxcost/api/plan-cost-excel.go

@@ -195,7 +195,7 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 							b.FormatToEmpty(&orderCount)
 
 							// 实际数量
-							realCount := fmt.Sprintf("%d", stage.RealCount)
+							realCount := fmt.Sprintf("%d", stage.ConfirmCount)
 							b.FormatToEmpty(&realCount)
 							// 单价
 							price := fmt.Sprintf("%.3f", stage.OrderPrice)
@@ -205,8 +205,8 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 							perBudgetPrice += stage.OrderPrice * float64(stage.OrderCount)
 							b.FormatToEmpty(&budgetPrice)
 							// 实际金额
-							perRealPrice += stage.OrderPrice * float64(stage.RealCount)
-							realPrice := fmt.Sprintf("%.3f", stage.OrderPrice*float64(stage.RealCount))
+							perRealPrice += stage.OrderPrice * float64(stage.ConfirmCount)
+							realPrice := fmt.Sprintf("%.3f", stage.OrderPrice*float64(stage.ConfirmCount))
 							b.FormatToEmpty(&realPrice)
 							if stage.Unit == "吨" || stage.Unit == "平方米" {
 								stage.Unit = "张"
@@ -314,7 +314,7 @@ func (b *PlanCostExcel) drawAllContent() error {
 					b.FormatToEmpty(&orderCount)
 
 					// 实际数量
-					realCount := fmt.Sprintf("%d", stage.RealCount)
+					realCount := fmt.Sprintf("%d", stage.ConfirmCount)
 					b.FormatToEmpty(&realCount)
 					// 单价
 					price := fmt.Sprintf("%.3f", stage.OrderPrice)
@@ -324,8 +324,8 @@ func (b *PlanCostExcel) drawAllContent() error {
 					perBudgetPrice += stage.OrderPrice * float64(stage.OrderCount)
 					b.FormatToEmpty(&budgetPrice)
 					// 实际金额
-					perRealPrice += stage.OrderPrice * float64(stage.RealCount)
-					realPrice := fmt.Sprintf("%.3f", stage.RealPrice)
+					perRealPrice += stage.OrderPrice * float64(stage.ConfirmCount)
+					realPrice := fmt.Sprintf("%.3f", stage.OrderPrice*float64(stage.ConfirmCount))
 					b.FormatToEmpty(&realPrice)
 					if stage.Unit == "吨" || stage.Unit == "平方米" {
 						stage.Unit = "张"

+ 1 - 1
boxcost/db/model/pack.go

@@ -57,7 +57,7 @@ type ComponentStage struct {
 	RealPrice float64 `bson:"realPrice,omitempty" json:"realPrice"`
 
 	//确认收货数量
-	RealCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
+	ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
 
 	// 供应相关信息
 	// 交货时间