|
@@ -28,6 +28,7 @@ type (
|
|
|
OrderCode string `json:"order_code"`
|
|
|
InvoiceVariety string `json:"invoice_variety"`
|
|
|
InvoiceContent string `json:"invoice_content"`
|
|
|
+ InvoiceOrderCode string `json:"invoice_order_code"`
|
|
|
}
|
|
|
)
|
|
|
|
|
@@ -178,7 +179,7 @@ func SendInvoiceSuccessMail(ctx context.Context, callBackId string) error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- res, err := g.DB().GetOne(ctx, fmt.Sprintf("SELECT invoice_type,mail,taxpayer_identnum,company_name,phone,url,order_code,invoice_variety,invoice_content FROM invoice WHERE %s = ? ", queryItem), queryValue)
|
|
|
+ res, err := g.DB().GetOne(ctx, fmt.Sprintf("SELECT invoice_type,mail,taxpayer_identnum,company_name,phone,url,order_code,invoice_variety,invoice_content,invoice_order_code FROM invoice WHERE %s = ? ", queryItem), queryValue)
|
|
|
if err != nil {
|
|
|
return gerror.Wrapf(err, "未查询到订单发票信息 %s:%s", queryItem, queryValue)
|
|
|
}
|
|
@@ -198,6 +199,7 @@ func (ir *invoiceRecord) GetMailHtmlContext() string {
|
|
|
var (
|
|
|
tType = "电子普通发票"
|
|
|
invoiceContext = "信息技术服务-技术服务费"
|
|
|
+ showOrderCode = ir.OrderCode
|
|
|
)
|
|
|
if strings.Contains(ir.InvoiceVariety, "专用") {
|
|
|
tType = "电子专用发票"
|
|
@@ -205,12 +207,15 @@ func (ir *invoiceRecord) GetMailHtmlContext() string {
|
|
|
if ir.InvoiceContent != "" {
|
|
|
invoiceContext = ir.InvoiceContent
|
|
|
}
|
|
|
+ if ir.InvoiceOrderCode != "" {
|
|
|
+ showOrderCode = ir.InvoiceOrderCode
|
|
|
+ }
|
|
|
g.Dump(ir, strings.Contains(ir.InvoiceVariety, "专用"))
|
|
|
switch ir.InvoiceType {
|
|
|
case "单位":
|
|
|
- return fmt.Sprintf(emailHtml_header+emailHtml_gs, ir.OrderCode, tType, fmt.Sprintf("<a href=\"%s\" download class=\"download\">查看发票</a>", ir.Url), invoiceContext, tType, ir.CompanyName, ir.TaxpayerIdentnum, ir.Phone, ir.Mail)
|
|
|
+ return fmt.Sprintf(emailHtml_header+emailHtml_gs, showOrderCode, tType, fmt.Sprintf("<a href=\"%s\" download class=\"download\">查看发票</a>", ir.Url), invoiceContext, tType, ir.CompanyName, ir.TaxpayerIdentnum, ir.Phone, ir.Mail)
|
|
|
case "个人":
|
|
|
- return fmt.Sprintf(emailHtml_header+emailHtml_gr, ir.OrderCode, tType, fmt.Sprintf("<a href=\"%s\" download class=\"download\">查看发票</a>", ir.Url), invoiceContext, tType, ir.Phone, ir.Mail)
|
|
|
+ return fmt.Sprintf(emailHtml_header+emailHtml_gr, showOrderCode, tType, fmt.Sprintf("<a href=\"%s\" download class=\"download\">查看发票</a>", ir.Url), invoiceContext, tType, ir.Phone, ir.Mail)
|
|
|
}
|
|
|
return ""
|
|
|
}
|