|
@@ -420,13 +420,7 @@ func (this *Invoice) Callbackinvoice() {
|
|
|
if changed == "1" {
|
|
|
m := make(map[string]interface{})
|
|
|
query := make(map[string]interface{})
|
|
|
- if strings.Contains(order_code, "xx") {
|
|
|
- //自助开票
|
|
|
- query["only_Identifying"] = order_code
|
|
|
- } else {
|
|
|
- //系统开票
|
|
|
- query["order_code"] = order_code
|
|
|
- }
|
|
|
+ query["order_code"] = order_code
|
|
|
query["invoice_changed"] = 1
|
|
|
m["invoice_code"] = fpdm
|
|
|
m["invoice_number"] = fphm
|
|
@@ -454,26 +448,6 @@ func (this *Invoice) Callbackinvoice() {
|
|
|
}
|
|
|
emailHtml := emailHtml_gr
|
|
|
emailHtmls := fmt.Sprintf(emailHtml, (*res)["phone"], user_mail)
|
|
|
- if strings.Contains(order_code, "xx") {
|
|
|
- //自助开票
|
|
|
- orderCodeArr := util.Mysql.SelectBySql("select GROUP_CONCAT(order_code) as order_code from invoice where only_Identifying=?", order_code)
|
|
|
- if len(*orderCodeArr) > 0 {
|
|
|
- order_code = qutil.ObjToString((*orderCodeArr)[0]["order_code"])
|
|
|
- for _, v := range strings.Split(order_code, ",") {
|
|
|
- //订单信息保存
|
|
|
- updateData := map[string]interface{}{}
|
|
|
- if InvoiceStatusHandle(v) {
|
|
|
- updateData["applybill_status"] = 2
|
|
|
- } else {
|
|
|
- updateData["applybill_status"] = 3
|
|
|
- }
|
|
|
- util.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
|
- "order_code": v,
|
|
|
- }, updateData)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
html := fmt.Sprintf(email_format, order_code, "电子普通发票", fmt.Sprintf("<a href=\"%s\" download class=\"download\">下载发票</a>", url), "电子普通发票", emailHtmls)
|
|
|
InvoiceSendMail(user_mail, html, "电子发票")
|
|
|
}()
|
|
@@ -522,14 +496,28 @@ func (this *Invoice) Callbackinvoice() {
|
|
|
}
|
|
|
} else {
|
|
|
t := make(map[string]interface{})
|
|
|
- t["order_code"] = order_code
|
|
|
+
|
|
|
+ if strings.Contains(order_code, "xx") {
|
|
|
+ //自助开票
|
|
|
+ t["only_Identifying"] = order_code
|
|
|
+ } else {
|
|
|
+ //系统开票
|
|
|
+ t["order_code"] = order_code
|
|
|
+ }
|
|
|
t["invoice_changed"] = 0
|
|
|
user_info := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": order_code}, "user_nickname,user_mail", "")
|
|
|
res := util.Mysql.FindOne(dbname, t, "invoice_type,mail,taxpayer_identnum,company_name,phone,url", "")
|
|
|
if res != nil {
|
|
|
m := make(map[string]interface{})
|
|
|
query := make(map[string]interface{})
|
|
|
- query["order_code"] = order_code
|
|
|
+ if strings.Contains(order_code, "xx") {
|
|
|
+ //自助开票
|
|
|
+ query["only_Identifying"] = order_code
|
|
|
+ } else {
|
|
|
+ //系统开票
|
|
|
+ query["order_code"] = order_code
|
|
|
+ }
|
|
|
+ query["invoice_changed"] = 0
|
|
|
m["invoice_code"] = fpdm
|
|
|
m["invoice_number"] = fphm
|
|
|
m["url"] = "http://" + path
|
|
@@ -554,6 +542,26 @@ func (this *Invoice) Callbackinvoice() {
|
|
|
}
|
|
|
emailHtml := emailHtml_gr
|
|
|
emailHtmls := fmt.Sprintf(emailHtml, (*res)["phone"], user_mail)
|
|
|
+ if strings.Contains(order_code, "xx") {
|
|
|
+ //自助开票
|
|
|
+ orderCodeArr := util.Mysql.SelectBySql("select GROUP_CONCAT(order_code) as order_code from invoice where only_Identifying=?", order_code)
|
|
|
+ if len(*orderCodeArr) > 0 {
|
|
|
+ order_code = qutil.ObjToString((*orderCodeArr)[0]["order_code"])
|
|
|
+ for _, v := range strings.Split(order_code, ",") {
|
|
|
+ //订单信息保存
|
|
|
+ updateData := map[string]interface{}{}
|
|
|
+ if InvoiceStatusHandle(v) {
|
|
|
+ updateData["applybill_status"] = 2
|
|
|
+ } else {
|
|
|
+ updateData["applybill_status"] = 3
|
|
|
+ }
|
|
|
+ util.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
|
+ "order_code": v,
|
|
|
+ }, updateData)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
html := fmt.Sprintf(email_format, order_code, "电子普通发票", fmt.Sprintf("<a href=\"%s\" download class=\"download\">下载发票</a>", url), "电子普通发票", emailHtmls)
|
|
|
InvoiceSendMail(user_mail, html, "电子发票")
|
|
|
|
|
@@ -574,6 +582,26 @@ func (this *Invoice) Callbackinvoice() {
|
|
|
}
|
|
|
emailHtml := emailHtml_gs
|
|
|
emailHtmls := fmt.Sprintf(emailHtml, (*res)["company_name"], (*res)["taxpayer_identnum"], (*res)["phone"], company_mail)
|
|
|
+ if strings.Contains(order_code, "xx") {
|
|
|
+ //自助开票
|
|
|
+ orderCodeArr := util.Mysql.SelectBySql("select GROUP_CONCAT(order_code) as order_code from invoice where only_Identifying=?", order_code)
|
|
|
+ if len(*orderCodeArr) > 0 {
|
|
|
+ order_code = qutil.ObjToString((*orderCodeArr)[0]["order_code"])
|
|
|
+ for _, v := range strings.Split(order_code, ",") {
|
|
|
+ //订单信息保存
|
|
|
+ updateData := map[string]interface{}{}
|
|
|
+ if InvoiceStatusHandle(v) {
|
|
|
+ updateData["applybill_status"] = 2
|
|
|
+ } else {
|
|
|
+ updateData["applybill_status"] = 3
|
|
|
+ }
|
|
|
+ util.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
|
+ "order_code": v,
|
|
|
+ }, updateData)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
html := fmt.Sprintf(email_format, order_code, "电子普通发票", fmt.Sprintf("<a href=\"%s\" download class=\"download\">下载发票</a>", url), "电子普通发票", emailHtmls)
|
|
|
InvoiceSendMail((*res)["mail"].(string), html, "电子发票")
|
|
|
|
|
@@ -1049,7 +1077,7 @@ func (this *Invoice) InvoiceSubmit() {
|
|
|
now := time.Now()
|
|
|
onlyIdentifying := encrypt.SE.DecodeString(this.GetString("onlyIdentifying"))
|
|
|
invoiceMoney := encrypt.SE.DecodeString(this.GetString("invoiceMoney"))
|
|
|
- operator := encrypt.SE.DecodeString(this.GetString("operator"))
|
|
|
+ operator := encrypt.SE.Decode4HexByCheck(this.GetString("operator"))
|
|
|
if onlyIdentifying == "" || invoiceMoney == "" {
|
|
|
this.ServeJson(NewResult("", errors.New("传入参数不正确")))
|
|
|
return
|
|
@@ -1273,6 +1301,9 @@ func htjs(body map[string]interface{}, orderCode []string, invoiceType, companyN
|
|
|
}
|
|
|
defer response.Body.Close()
|
|
|
resData := (*resMap)["data"].(map[string]interface{})
|
|
|
+ if invoice_status == 1 {
|
|
|
+ sendMail(invoiceType, strings.Join(orderCode, ","), companyName, taxpayerIdentnum, mail, phone, qutil.InterfaceToStr(resData["path"]))
|
|
|
+ }
|
|
|
for _, v := range orderCode {
|
|
|
util.Mysql.Update(dbname, map[string]interface{}{"order_code": v, "invoice_status": 0}, map[string]interface{}{
|
|
|
"invoice_serialnum": resData["swno"],
|
|
@@ -1292,7 +1323,6 @@ func htjs(body map[string]interface{}, orderCode []string, invoiceType, companyN
|
|
|
"order_code": v,
|
|
|
}, updateData)
|
|
|
}
|
|
|
- sendMail(invoiceType, strings.Join(orderCode, ","), companyName, taxpayerIdentnum, mail, phone, qutil.InterfaceToStr(resData["path"]))
|
|
|
}
|
|
|
}
|
|
|
}
|