Browse Source

bill download realprice update

animeic 1 năm trước cách đây
mục cha
commit
ba6c224d53

+ 10 - 0
boxcost/api/bill-produce-excel.go

@@ -521,6 +521,16 @@ func (b *ProduceBillExcel) drawTableContent() error {
 			realCount = fmt.Sprintf("%d", produce.ConfirmCount)
 			b.FormatToEmpty(&realCount)
 			realPrice = fmt.Sprintf("%.3f", produce.OrderPrice*float64(produce.ConfirmCount))
+
+			// !10.27 如果是固定价格
+			if produce.IsFix == nil {
+				_fix := false
+				produce.IsFix = &_fix
+			}
+			if *produce.IsFix {
+				realPrice = budgetAmount
+			}
+
 			b.FormatToEmpty(&realPrice)
 
 			deliveryTime := produce.DeliveryTime.Local().Format("2006-01-02")

+ 10 - 0
boxcost/api/bill-product-excel.go

@@ -262,6 +262,16 @@ func (b *ProductBillExcel) drawTableContent() error {
 
 			// 实际金额
 			realPrice = fmt.Sprintf("%.3f", float64(product.ConfirmCount)*product.OrderPrice)
+
+			// !10.27 如果是固定价格
+			if product.IsFix == nil {
+				_fix := false
+				product.IsFix = &_fix
+			}
+			if *product.IsFix {
+				realPrice = budgetAmount
+			}
+
 			b.FormatToEmpty(&realPrice)
 
 			// a采购项目 b规格 c下单数量 d单位 e完成数量 f单价 g预算金额 h实际金额 i交货时间 j备注

+ 10 - 0
boxcost/api/bill-purchase-excel.go

@@ -304,6 +304,16 @@ func (b *PurchaseBillExcel) drawTableContent() error {
 
 			// 实际金额
 			realPrice = fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.ConfirmCount))
+
+			// !10.27 如果是固定价格
+			if paper.IsFix == nil {
+				_fix := false
+				paper.IsFix = &_fix
+			}
+			if *paper.IsFix {
+				realPrice = budgetAmount
+			}
+
 			b.FormatToEmpty(&realPrice)
 			rowMaxHeight := DrawRow(b.Row, paper.Name, paper.Norm, paper.Height, paper.Width, fmt.Sprintf("%d", paper.OrderCount), price, price2, budgetAmount, deliveryTime, paper.Remark)
 			// 设置行高