Browse Source

wip:订单备注提交

wangkaiyue 1 year ago
parent
commit
7975e97025
1 changed files with 11 additions and 7 deletions
  1. 11 7
      internal/service/invoiceManager.go

+ 11 - 7
internal/service/invoiceManager.go

@@ -148,6 +148,7 @@ func (im *InvoiceManager) simpleMakeInvoice(ctx context.Context) (total, okNum i
 		var (
 		var (
 			orderCode = gconv.String(m["order_code"])
 			orderCode = gconv.String(m["order_code"])
 			iType     = gconv.String(m["invoice_type"])
 			iType     = gconv.String(m["invoice_type"])
+			remark    = gconv.String(m["remark"])
 			prices    float64
 			prices    float64
 		)
 		)
 
 
@@ -160,9 +161,10 @@ func (im *InvoiceManager) simpleMakeInvoice(ctx context.Context) (total, okNum i
 		}
 		}
 
 
 		c := MakeInvoiceData{
 		c := MakeInvoiceData{
-			Type: "2",
-			Id:   orderCode,
-			Fhr:  g.Cfg().MustGet(ctx, "company.hfr", "贺鹏飞").String(),
+			Type:  "2",
+			Id:    orderCode,
+			Notes: remark,
+			Fhr:   g.Cfg().MustGet(ctx, "company.hfr", "贺鹏飞").String(),
 			InvoiceArr: []MakeInvoiceItems{{
 			InvoiceArr: []MakeInvoiceItems{{
 				Xmmc:     g.Cfg().MustGet(ctx, "company.taxCode").String(), //开票项
 				Xmmc:     g.Cfg().MustGet(ctx, "company.taxCode").String(), //开票项
 				WhStatus: 1,                                                //开票项是否维护
 				WhStatus: 1,                                                //开票项是否维护
@@ -197,7 +199,7 @@ func (im *InvoiceManager) selfMakeInvoice(ctx context.Context) (total, okNum int
 	var (
 	var (
 		res gdb.Result
 		res gdb.Result
 	)
 	)
-	res, err = g.DB().Query(ctx, "SELECT a.invoice_money,a.only_Identifying,a.invoice_type,a.company_name,a.taxpayer_identnum FROM invoice a WHERE a.invoice_status=0 AND a.invoice_changed=0 AND  a.invoice_variety='电子普通发票' AND a.invoice_order_code is not NULL GROUP BY invoice_order_code")
+	res, err = g.DB().Query(ctx, "SELECT a.invoice_money,a.only_Identifying,a.invoice_type,a.company_name,a.taxpayer_identnum,a.remark FROM invoice a WHERE a.invoice_status=0 AND a.invoice_changed=0 AND  a.invoice_variety='电子普通发票' AND a.invoice_order_code is not NULL GROUP BY invoice_order_code")
 	if err != nil {
 	if err != nil {
 		return -1, -1, gerror.Wrap(err, "selfMakeInvoice-查询待开票异常")
 		return -1, -1, gerror.Wrap(err, "selfMakeInvoice-查询待开票异常")
 	}
 	}
@@ -213,11 +215,13 @@ func (im *InvoiceManager) selfMakeInvoice(ctx context.Context) (total, okNum int
 			orderCode = gconv.String(m["only_Identifying"])
 			orderCode = gconv.String(m["only_Identifying"])
 			iType     = gconv.String(m["invoice_type"])
 			iType     = gconv.String(m["invoice_type"])
 			prices    = gconv.String(m["invoice_money"])
 			prices    = gconv.String(m["invoice_money"])
+			remark    = gconv.String(m["remark"])
 		)
 		)
 		c := MakeInvoiceData{
 		c := MakeInvoiceData{
-			Type: "2",
-			Id:   orderCode,
-			Fhr:  g.Cfg().MustGet(ctx, "company.hfr", "贺鹏飞").String(),
+			Type:  "2",
+			Id:    orderCode,
+			Notes: remark,
+			Fhr:   g.Cfg().MustGet(ctx, "company.hfr", "贺鹏飞").String(),
 			InvoiceArr: []MakeInvoiceItems{{
 			InvoiceArr: []MakeInvoiceItems{{
 				Xmmc:     g.Cfg().MustGet(ctx, "company.taxCode").String(), //开票项
 				Xmmc:     g.Cfg().MustGet(ctx, "company.taxCode").String(), //开票项
 				WhStatus: 1,                                                //开票项是否维护
 				WhStatus: 1,                                                //开票项是否维护