animeic 2 жил өмнө
parent
commit
1a3f6b3717

+ 4 - 6
boxcost/api/bill-produce-excel.go

@@ -194,12 +194,10 @@ func (b *ProduceBillExcel) drawTableContent() error {
 			b.FormatToEmpty(&budgetAmount)
 			// 实际金额
 			realPrice := ""
-			if b.Content.Status == "complete" {
-				// 实际完成数
-				realCount = fmt.Sprintf("%d", produce.ConfirmCount)
-				b.FormatToEmpty(&realCount)
-				realPrice = fmt.Sprintf("%.3f", produce.OrderPrice*float64(produce.ConfirmCount))
-			}
+			// 实际完成数
+			realCount = fmt.Sprintf("%d", produce.ConfirmCount)
+			b.FormatToEmpty(&realCount)
+			realPrice = fmt.Sprintf("%.3f", produce.OrderPrice*float64(produce.ConfirmCount))
 
 			deliveryTime := produce.DeliveryTime.Local().Format("2006-01-02")
 			DrawRow(b.Row, produce.Name, produce.Norm, produce.Paper, produce.PaperSize, produce.PrintSize, fmt.Sprintf("%d", produce.OrderCount), realCount, priceStr, budgetAmount, realPrice, deliveryTime, produce.Remark)

+ 7 - 9
boxcost/api/bill-purchase-excel.go

@@ -236,15 +236,13 @@ func (b *PurchaseBillExcel) drawTableContent() error {
 			budgetAmount := fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.OrderCount))
 			b.FormatToEmpty(&budgetAmount)
 
-			if b.Content.Status == "complete" {
-				// 实际完成数
-				realCount = fmt.Sprintf("%d", paper.ConfirmCount)
-				b.FormatToEmpty(&realCount)
-
-				// 实际金额
-				realPrice = fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.ConfirmCount))
-				b.FormatToEmpty(&realPrice)
-			}
+			// 实际完成数
+			realCount = fmt.Sprintf("%d", paper.ConfirmCount)
+			b.FormatToEmpty(&realCount)
+
+			// 实际金额
+			realPrice = fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.ConfirmCount))
+			b.FormatToEmpty(&realPrice)
 
 			DrawRow(b.Row, paper.Name, paper.Norm, paper.Height, paper.Width, fmt.Sprintf("%d", paper.OrderCount), realCount, price, price2, budgetAmount, realPrice, deliveryTime, paper.Remark)
 			b.Row++

+ 4 - 0
boxcost/api/plan.go

@@ -225,6 +225,10 @@ func DownLoadCompBills(c *gin.Context, apictx *ApiSession) (interface{}, error)
 				billExcel.SetTitle(companyName)
 			}
 		}
+		if billExcel == nil {
+			continue
+		}
+		// download?id=63f70cbbf72d8f1253ccbb4d&compId=1676975264366
 		billExcel.SetRow(row)
 		billExcel.Draws()
 		fmt.Println(billExcel.GetRow())