|
@@ -110,6 +110,7 @@ func (b *ReportExcel) drawTableTitle() error {
|
|
|
drawCol("G", "单价")
|
|
|
drawCol("H", "金额")
|
|
|
drawCol("I", "产品名称")
|
|
|
+ drawCol("J", "对账状态")
|
|
|
// b.Excel.SetRowHeight(b.SheetName, b.Row, 35)
|
|
|
|
|
|
return nil
|
|
@@ -118,7 +119,7 @@ func (b *ReportExcel) drawTableTitle() error {
|
|
|
func (b *ReportExcel) drawTableContent() error {
|
|
|
b.Row += 2
|
|
|
var DrawRow = func(rowIndex int, values ...string) {
|
|
|
- charas := []string{"A", "B", "C", "D", "E", "F", "G", "H", "I"}
|
|
|
+ charas := []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"}
|
|
|
|
|
|
for i, c := range charas {
|
|
|
v := ""
|
|
@@ -149,7 +150,11 @@ func (b *ReportExcel) drawTableContent() error {
|
|
|
err = json.Unmarshal(data, &purchase)
|
|
|
if err != nil {
|
|
|
log.Error(err)
|
|
|
- continue
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+ record := "否"
|
|
|
+ if *purchase.IsRecord {
|
|
|
+ record = "是"
|
|
|
}
|
|
|
for _, paper := range purchase.Paper {
|
|
|
index++
|
|
@@ -161,7 +166,7 @@ func (b *ReportExcel) drawTableContent() error {
|
|
|
// 实际金额
|
|
|
realPrice := fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.ConfirmCount))
|
|
|
b.FormatToEmpty(&realPrice)
|
|
|
- DrawRow(b.Row, fmt.Sprintf("%d", index), completeTime, paper.Name, paper.Norm, fmt.Sprintf("%s*%s", paper.Height, paper.Width), fmt.Sprintf("%d", paper.ConfirmCount), fmt.Sprintf("%.3f", paper.OrderPrice), realPrice, purchase.ProductName)
|
|
|
+ DrawRow(b.Row, fmt.Sprintf("%d", index), completeTime, paper.Name, paper.Norm, fmt.Sprintf("%s*%s", paper.Height, paper.Width), fmt.Sprintf("%d", paper.ConfirmCount), fmt.Sprintf("%.3f", paper.OrderPrice), realPrice, purchase.ProductName, record)
|
|
|
totalPrice += paper.OrderPrice * float64(paper.ConfirmCount)
|
|
|
totalCount += paper.ConfirmCount
|
|
|
b.Row++
|
|
@@ -172,7 +177,11 @@ func (b *ReportExcel) drawTableContent() error {
|
|
|
err = json.Unmarshal(data, &produce)
|
|
|
if err != nil {
|
|
|
log.Error(err)
|
|
|
- continue
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+ record := "否"
|
|
|
+ if *produce.IsRecord {
|
|
|
+ record = "是"
|
|
|
}
|
|
|
for _, pproduce := range produce.Produces {
|
|
|
index++
|
|
@@ -184,7 +193,7 @@ func (b *ReportExcel) drawTableContent() error {
|
|
|
// 实际金额
|
|
|
realPrice := fmt.Sprintf("%.3f", pproduce.OrderPrice*float64(pproduce.ConfirmCount))
|
|
|
b.FormatToEmpty(&realPrice)
|
|
|
- DrawRow(b.Row, fmt.Sprintf("%d", index), completeTime, pproduce.Name, pproduce.Norm, pproduce.PrintSize, fmt.Sprintf("%d", pproduce.ConfirmCount), fmt.Sprintf("%.3f", pproduce.OrderPrice), realPrice, produce.ProductName)
|
|
|
+ DrawRow(b.Row, fmt.Sprintf("%d", index), completeTime, pproduce.Name, pproduce.Norm, pproduce.PrintSize, fmt.Sprintf("%d", pproduce.ConfirmCount), fmt.Sprintf("%.3f", pproduce.OrderPrice), realPrice, produce.ProductName, record)
|
|
|
totalPrice += pproduce.OrderPrice * float64(pproduce.ConfirmCount)
|
|
|
totalCount += pproduce.ConfirmCount
|
|
|
b.Row++
|
|
@@ -195,7 +204,11 @@ func (b *ReportExcel) drawTableContent() error {
|
|
|
err = json.Unmarshal(data, &product)
|
|
|
if err != nil {
|
|
|
log.Error(err)
|
|
|
- continue
|
|
|
+ panic(err)
|
|
|
+ }
|
|
|
+ record := "否"
|
|
|
+ if *product.IsRecord {
|
|
|
+ record = "是"
|
|
|
}
|
|
|
for _, pproduct := range product.Products {
|
|
|
index++
|
|
@@ -207,7 +220,7 @@ func (b *ReportExcel) drawTableContent() error {
|
|
|
// 实际金额
|
|
|
realPrice := fmt.Sprintf("%.3f", pproduct.OrderPrice*float64(pproduct.ConfirmCount))
|
|
|
b.FormatToEmpty(&realPrice)
|
|
|
- DrawRow(b.Row, fmt.Sprintf("%d", index), completeTime, pproduct.Name, pproduct.Norm, "-", fmt.Sprintf("%d", pproduct.ConfirmCount), fmt.Sprintf("%.3f", pproduct.OrderPrice), realPrice, product.ProductName)
|
|
|
+ DrawRow(b.Row, fmt.Sprintf("%d", index), completeTime, pproduct.Name, pproduct.Norm, "-", fmt.Sprintf("%d", pproduct.ConfirmCount), fmt.Sprintf("%.3f", pproduct.OrderPrice), realPrice, product.ProductName, record)
|
|
|
totalPrice += pproduct.OrderPrice * float64(pproduct.ConfirmCount)
|
|
|
totalCount += pproduct.ConfirmCount
|
|
|
b.Row++
|