|
@@ -407,7 +407,7 @@ func (b *PlanCostExcel) drawAllContent() error {
|
|
|
}
|
|
|
|
|
|
// 工序数据
|
|
|
- if len(b.Content.Process) > 0 {
|
|
|
+ if b.Content.Process != nil {
|
|
|
// 生产汇总金额
|
|
|
startACell := fmt.Sprintf("%s%d", "A", row)
|
|
|
endMCell := fmt.Sprintf("%s%d", "K", row)
|
|
@@ -457,23 +457,23 @@ func (b *PlanCostExcel) drawAllContent() error {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- for _, ps := range b.Content.Process {
|
|
|
- count := fmt.Sprintf("%d", ps.Count)
|
|
|
- confirmCount := fmt.Sprintf("%d", ps.ConfirmCount)
|
|
|
- price := fmt.Sprintf("%.2f", ps.Price)
|
|
|
- b.FormatToEmpty(&price)
|
|
|
- budgetAmountf := ps.Price * float64(ps.Count)
|
|
|
- budgetAmount := fmt.Sprintf("%.2f", budgetAmountf)
|
|
|
- b.FormatToEmpty(&budgetAmount)
|
|
|
- realAmountf := ps.Price * float64(ps.ConfirmCount)
|
|
|
- realAmount := fmt.Sprintf("%.2f", realAmountf)
|
|
|
- b.FormatToEmpty(&realAmount)
|
|
|
- confirmTotalPlanPrice += realAmountf
|
|
|
- totalPlanPrice += float32(budgetAmountf)
|
|
|
-
|
|
|
- DrawRow(row, ps.Name, ps.Supplier, ps.Norm, ps.Unit, count, confirmCount, price, budgetAmount, realAmount)
|
|
|
- row++
|
|
|
- }
|
|
|
+ ps := b.Content.Process
|
|
|
+ count := fmt.Sprintf("%.2f", ps.Supplier.OrderCount)
|
|
|
+ confirmCount := fmt.Sprintf("%d", ps.ConfirmCount)
|
|
|
+ price := fmt.Sprintf("%.2f", ps.Supplier.OrderPrice)
|
|
|
+ b.FormatToEmpty(&price)
|
|
|
+ // budgetAmountf := ps.Supplier.OrderPrice * float64(ps.Supplier.OrderCount)
|
|
|
+ budgetAmount := fmt.Sprintf("%.2f", ps.Supplier.OrderRealPrice)
|
|
|
+ b.FormatToEmpty(&budgetAmount)
|
|
|
+ // realAmountf := ps.Price * float64(ps.ConfirmCount)
|
|
|
+ realAmountf := ps.Supplier.OrderPrice * float64(ps.ConfirmCount)
|
|
|
+ realAmount := fmt.Sprintf("%.2f", realAmountf)
|
|
|
+ b.FormatToEmpty(&realAmount)
|
|
|
+ confirmTotalPlanPrice += realAmountf
|
|
|
+ totalPlanPrice += float32(ps.Supplier.OrderRealPrice)
|
|
|
+
|
|
|
+ DrawRow(row, ps.ProcessInfo.Name, ps.Supplier.SupplierInfo.Name, ps.ProcessInfo.Norm, ps.ProcessInfo.Unit, count, confirmCount, price, budgetAmount, realAmount)
|
|
|
+ row++
|
|
|
|
|
|
}
|
|
|
// 生产汇总金额
|