|
@@ -181,15 +181,15 @@ func (b *PlanCostExcel) drawSupplierContent() error {
|
|
|
confirmCount := fmt.Sprintf("%d", mat.ConfirmCount)
|
|
|
b.FormatToEmpty(&confirmCount)
|
|
|
// 单价
|
|
|
- orderPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderPrice)
|
|
|
+ orderPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderPrice)
|
|
|
b.FormatToEmpty(&orderPrice)
|
|
|
// 预算金额
|
|
|
- orderRealPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderRealPrice)
|
|
|
+ orderRealPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderRealPrice)
|
|
|
perOrderRealPrice += mat.Supplier.OrderRealPrice
|
|
|
b.FormatToEmpty(&orderRealPrice)
|
|
|
// 实际金额
|
|
|
perRealPrice += mat.RealPrice
|
|
|
- realPrice := fmt.Sprintf("%.2f", mat.RealPrice)
|
|
|
+ realPrice := fmt.Sprintf("%.3f", mat.RealPrice)
|
|
|
b.FormatToEmpty(&realPrice)
|
|
|
b.drawRow(row, "", mat.MatInfo.Name, "", supplierName, mat.MatInfo.Norm, matHeigth, matWidth, mat.MatInfo.Unit, orderCount, confirmCount, orderPrice, orderRealPrice, realPrice)
|
|
|
|
|
@@ -227,7 +227,7 @@ func (b *PlanCostExcel) drawSupplierContent() error {
|
|
|
// 实际数量
|
|
|
confirmCount := fmt.Sprintf("%d", craft.ConfirmCount)
|
|
|
b.FormatToEmpty(&confirmCount)
|
|
|
- price := fmt.Sprintf("%.2f", craft.Supplier.OrderPrice)
|
|
|
+ price := fmt.Sprintf("%.3f", craft.Supplier.OrderPrice)
|
|
|
b.FormatToEmpty(&price)
|
|
|
|
|
|
// 预算金额
|
|
@@ -347,15 +347,15 @@ func (b *PlanCostExcel) drawSupplierContent() error {
|
|
|
row++
|
|
|
if len(b.Content.Process) > 0 {
|
|
|
for _, ps := range b.Content.Process {
|
|
|
- orderCount := fmt.Sprintf("%.2f", ps.Supplier.OrderCount)
|
|
|
+ orderCount := fmt.Sprintf("%.3f", ps.Supplier.OrderCount)
|
|
|
confirmCount := fmt.Sprintf("%d", ps.ConfirmCount)
|
|
|
- price := fmt.Sprintf("%.2f", ps.Supplier.OrderPrice)
|
|
|
+ price := fmt.Sprintf("%.3f", ps.Supplier.OrderPrice)
|
|
|
b.FormatToEmpty(&price)
|
|
|
totalOrderRealPrice += ps.Supplier.OrderRealPrice
|
|
|
totalRealPrice += ps.RealPrice
|
|
|
- orderRealPrice := fmt.Sprintf("%.2f", ps.Supplier.OrderRealPrice)
|
|
|
+ orderRealPrice := fmt.Sprintf("%.3f", ps.Supplier.OrderRealPrice)
|
|
|
b.FormatToEmpty(&orderRealPrice)
|
|
|
- realPrice := fmt.Sprintf("%.2f", ps.RealPrice)
|
|
|
+ realPrice := fmt.Sprintf("%.3f", ps.RealPrice)
|
|
|
supplierName := ""
|
|
|
if ps.Supplier.SupplierInfo != nil {
|
|
|
supplierName = ps.Supplier.SupplierInfo.Name
|
|
@@ -394,13 +394,13 @@ func (b *PlanCostExcel) drawSupplierContent() error {
|
|
|
|
|
|
// 生产预算汇总
|
|
|
b.Excel.SetCellStyle(b.SheetName, LCell, LCell, b.AlignCenterStyle)
|
|
|
- planOrderRealPrice := fmt.Sprintf("%.2f", totalOrderRealPrice)
|
|
|
+ planOrderRealPrice := fmt.Sprintf("%.3f", totalOrderRealPrice)
|
|
|
b.FormatToEmpty(&planOrderRealPrice)
|
|
|
b.Excel.SetCellValue(b.SheetName, LCell, planOrderRealPrice)
|
|
|
|
|
|
// 生产实际汇总
|
|
|
b.Excel.SetCellStyle(b.SheetName, MCell, MCell, b.AlignCenterStyle)
|
|
|
- planRealPrice := fmt.Sprintf("%.2f", totalRealPrice)
|
|
|
+ planRealPrice := fmt.Sprintf("%.3f", totalRealPrice)
|
|
|
b.FormatToEmpty(&planRealPrice)
|
|
|
b.Excel.SetCellValue(b.SheetName, MCell, planRealPrice)
|
|
|
|
|
@@ -460,15 +460,15 @@ func (b *PlanCostExcel) drawAllContent() error {
|
|
|
confirmCount := fmt.Sprintf("%d", mat.ConfirmCount)
|
|
|
b.FormatToEmpty(&confirmCount)
|
|
|
// 单价
|
|
|
- orderPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderPrice)
|
|
|
+ orderPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderPrice)
|
|
|
b.FormatToEmpty(&orderPrice)
|
|
|
// 预算金额
|
|
|
- orderRealPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderRealPrice)
|
|
|
+ orderRealPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderRealPrice)
|
|
|
perOrderRealPrice += mat.Supplier.OrderRealPrice
|
|
|
b.FormatToEmpty(&orderRealPrice)
|
|
|
// 实际金额
|
|
|
perRealPrice += mat.RealPrice
|
|
|
- realPrice := fmt.Sprintf("%.2f", mat.RealPrice)
|
|
|
+ realPrice := fmt.Sprintf("%.3f", mat.RealPrice)
|
|
|
b.FormatToEmpty(&realPrice)
|
|
|
b.drawRow(row, "", mat.MatInfo.Name, "", supplierName, mat.MatInfo.Norm, matHeigth, matWidth, mat.MatInfo.Unit, orderCount, confirmCount, orderPrice, orderRealPrice, realPrice)
|
|
|
|
|
@@ -496,7 +496,7 @@ func (b *PlanCostExcel) drawAllContent() error {
|
|
|
// 实际数量
|
|
|
confirmCount := fmt.Sprintf("%d", craft.ConfirmCount)
|
|
|
b.FormatToEmpty(&confirmCount)
|
|
|
- price := fmt.Sprintf("%.2f", craft.Supplier.OrderPrice)
|
|
|
+ price := fmt.Sprintf("%.3f", craft.Supplier.OrderPrice)
|
|
|
b.FormatToEmpty(&price)
|
|
|
|
|
|
// 预算金额
|
|
@@ -597,15 +597,15 @@ func (b *PlanCostExcel) drawAllContent() error {
|
|
|
row++
|
|
|
if len(b.Content.Process) > 0 {
|
|
|
for _, ps := range b.Content.Process {
|
|
|
- orderCount := fmt.Sprintf("%.2f", ps.Supplier.OrderCount)
|
|
|
+ orderCount := fmt.Sprintf("%.3f", ps.Supplier.OrderCount)
|
|
|
confirmCount := fmt.Sprintf("%d", ps.ConfirmCount)
|
|
|
- price := fmt.Sprintf("%.2f", ps.Supplier.OrderPrice)
|
|
|
+ price := fmt.Sprintf("%.3f", ps.Supplier.OrderPrice)
|
|
|
b.FormatToEmpty(&price)
|
|
|
totalOrderRealPrice += ps.Supplier.OrderRealPrice
|
|
|
totalRealPrice += ps.RealPrice
|
|
|
- orderRealPrice := fmt.Sprintf("%.2f", ps.Supplier.OrderRealPrice)
|
|
|
+ orderRealPrice := fmt.Sprintf("%.3f", ps.Supplier.OrderRealPrice)
|
|
|
b.FormatToEmpty(&orderRealPrice)
|
|
|
- realPrice := fmt.Sprintf("%.2f", ps.RealPrice)
|
|
|
+ realPrice := fmt.Sprintf("%.3f", ps.RealPrice)
|
|
|
supplierName := ""
|
|
|
if ps.Supplier.SupplierInfo != nil {
|
|
|
supplierName = ps.Supplier.SupplierInfo.Name
|
|
@@ -639,13 +639,13 @@ func (b *PlanCostExcel) drawAllContent() error {
|
|
|
|
|
|
// 生产预算汇总
|
|
|
b.Excel.SetCellStyle(b.SheetName, LCell, LCell, b.AlignCenterStyle)
|
|
|
- planOrderRealPrice := fmt.Sprintf("%.2f", totalOrderRealPrice)
|
|
|
+ planOrderRealPrice := fmt.Sprintf("%.3f", totalOrderRealPrice)
|
|
|
b.FormatToEmpty(&planOrderRealPrice)
|
|
|
b.Excel.SetCellValue(b.SheetName, LCell, planOrderRealPrice)
|
|
|
|
|
|
// 生产实际汇总
|
|
|
b.Excel.SetCellStyle(b.SheetName, MCell, MCell, b.AlignCenterStyle)
|
|
|
- planRealPrice := fmt.Sprintf("%.2f", totalRealPrice)
|
|
|
+ planRealPrice := fmt.Sprintf("%.3f", totalRealPrice)
|
|
|
b.FormatToEmpty(&planRealPrice)
|
|
|
b.Excel.SetCellValue(b.SheetName, MCell, planRealPrice)
|
|
|
|
|
@@ -693,7 +693,7 @@ func NewPlanCostExcel(f *excelize.File) *PlanCostExcel {
|
|
|
}
|
|
|
|
|
|
func (b *PlanCostExcel) FormatToEmpty(str *string) {
|
|
|
- if *str == "0" || *str == "0.00" {
|
|
|
+ if *str == "0" || *str == "0.000" {
|
|
|
*str = ""
|
|
|
}
|
|
|
|