فهرست منبع

开票流程修改

WH01243 1 سال پیش
والد
کامیت
f7267ff1bf
1فایلهای تغییر یافته به همراه66 افزوده شده و 66 حذف شده
  1. 66 66
      src/jfw/modules/subscribepay/src/service/invoice.go

+ 66 - 66
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -1072,7 +1072,7 @@ func (this *Invoice) InvoiceSubmit() {
 				"invoice_type":        this.GetString("invoice_type"),
 				"invoice_content":     "信息技术服务-技术服务费",
 				"invoice_status":      0,
-				"invoice_changed":     1,
+				"invoice_changed":     0,
 				"company_phone":       this.GetString("company_phone"),
 				"taxpayer_identnum":   this.GetString("taxpayer_identnum"),
 				"create_time":         time.Now().Unix(),
@@ -1082,7 +1082,7 @@ func (this *Invoice) InvoiceSubmit() {
 				"operable_time":       FormatDate(&now, Date_Full_Layout),
 				"invoice_money":       Allmoney,
 				"invoice_order_money": money,
-				"invoicing_entity":    "money",
+				"invoicing_entity":    "北京剑鱼信息技术有限公司",
 				"remark":              this.GetString("remark"),
 				"source":              1,
 				"invoice_variety":     this.GetString("invoice_variety"),
@@ -1105,72 +1105,73 @@ func (this *Invoice) InvoiceSubmit() {
 				return false
 			}
 		}
+        if this.GetString("invoice_variety") == "电子普通发票" && Allmoney < 1000000 {
+            //走航天金税开票
+            var orders = []map[string]interface{}{}
+            var items = []map[string]interface{}{}
+            item := map[string]interface{}{
+                "name":        "技术服务费",
+                "code":        config.InvoiceConfig.Code,
+                "yhzcbs":      config.InvoiceConfig.Tax_policy,
+                "lineType":    config.InvoiceConfig.Invoice_nature,
+                "taxRate":     config.InvoiceConfig.Tax_rate,
+                "taxPrice":    Allmoney,
+                "totalAmount": Allmoney,
+                "quantity":    "1",
+            }
+            items = append(items, item)
+            order := map[string]interface{}{
+                "billNo": onlyIdentifying,
+                "items":  items,
+            }
+            orders = append(orders, order)
+            body := map[string]interface{}{
+                "Swno":      onlyIdentifying,
+                "custType":  "03",
+                "orders":    orders,
+                "custTaxNo": this.GetString("taxpayer_identnum"),
+                "changed":   "0",
+                "phone":     this.GetString("phone"),
+            }
+            if this.GetString("invoice_type") == "单位" {
+                body["custName"] = this.GetString("company_name")
+            } else {
+                body["custName"] = "个人"
+            }
+            htjs(body, orderArr, this.GetString("invoice_type"), this.GetString("company_name"), this.GetString("taxpayer_identnum"), this.GetString("mail"), this.GetString("phone"))
+        } else {
+            //给王航发信息
+            recipientStr := ""
+            deliveryAddressStr := ""
+            if this.GetString("invoice_variety") == "纸质普通发票" || this.GetString("invoice_variety") == "纸质专用发票" {
+                recipientStr = fmt.Sprintf("<p class=\"item\">\n      <span class=\"label\">收件人:</span>\n      <span class=\"value\">%s</span>\n    </p>", this.GetString("recipient"))
+                deliveryAddressStr = fmt.Sprintf("<p class=\"item\">\n      <span class=\"label\">收件地址:</span>\n      <span class=\"value\">%s</span>\n    </p>", this.GetString("delivery_address"))
+            }
+            html := fmt.Sprintf(email_format_new,
+                FormatDate(&now, Date_Full_Layout),
+                strings.Join(orderArr, ","),
+                Allmoney/100,
+                this.GetString("invoice_variety"),
+                qutil.InterfaceToStr(qutil.If(this.GetString("invoice_type") == "", "--", this.GetString("invoice_type"))),
+                qutil.InterfaceToStr(qutil.If(this.GetString("company_name") == "", "--", this.GetString("company_name"))),
+                qutil.InterfaceToStr(qutil.If(this.GetString("taxpayer_identnum") == "", "--", this.GetString("taxpayer_identnum"))),
+                qutil.InterfaceToStr(qutil.If(this.GetString("company_address") == "", "--", this.GetString("company_address"))),
+                qutil.InterfaceToStr(qutil.If(this.GetString("company_phone") == "", "--", this.GetString("company_phone"))),
+                qutil.InterfaceToStr(qutil.If(this.GetString("bank_name") == "", "--", this.GetString("bank_name"))),
+                qutil.InterfaceToStr(qutil.If(this.GetString("bank_account") == "", "--", this.GetString("bank_account"))),
+                qutil.InterfaceToStr(qutil.If(this.GetString("remark") == "", "--", this.GetString("remark"))),
+                recipientStr,
+                this.GetString("phone"),
+                deliveryAddressStr,
+            )
+            for _, v := range strings.Split(config.Config.FinanceMail, ",") {
+                InvoiceSendMail(v, html, fmt.Sprintf("客户申请开具%s", this.GetString("invoice_variety")))
+            }
+        }
 		return true
 	}) {
 		this.ServeJson(NewResult("", errors.New("发票信息保存失败")))
-	}
-	if this.GetString("invoice_variety") == "电子普通发票" && Allmoney < 1000000 {
-		//走航天金税开票
-		var orders = []map[string]interface{}{}
-		var items = []map[string]interface{}{}
-		item := map[string]interface{}{
-			"name":        "技术服务费",
-			"code":        config.InvoiceConfig.Code,
-			"yhzcbs":      config.InvoiceConfig.Tax_policy,
-			"lineType":    config.InvoiceConfig.Invoice_nature,
-			"taxRate":     config.InvoiceConfig.Tax_rate,
-			"taxPrice":    Allmoney,
-			"totalAmount": Allmoney,
-			"quantity":    "1",
-		}
-		items = append(items, item)
-		order := map[string]interface{}{
-			"billNo": onlyIdentifying,
-			"items":  items,
-		}
-		orders = append(orders, order)
-		body := map[string]interface{}{
-			"Swno":      onlyIdentifying,
-			"custType":  "03",
-			"orders":    orders,
-			"custTaxNo": this.GetString("taxpayer_identnum"),
-			"changed":   "1",
-			"phone":     this.GetString("phone"),
-		}
-		if this.GetString("invoice_type") == "单位" {
-			body["custName"] = this.GetString("company_name")
-		} else {
-			body["custName"] = "个人"
-		}
-		htjs(body, orderArr, this.GetString("invoice_type"), this.GetString("company_name"), this.GetString("taxpayer_identnum"), this.GetString("mail"), this.GetString("phone"))
-	} else {
-		//给王航发信息
-		recipientStr := ""
-		deliveryAddressStr := ""
-		if this.GetString("invoice_variety") == "纸质普通发票" || this.GetString("invoice_variety") == "纸质专用发票" {
-			recipientStr = fmt.Sprintf("<p class=\"item\">\n      <span class=\"label\">收件人:</span>\n      <span class=\"value\">%s</span>\n    </p>", this.GetString("recipient"))
-			deliveryAddressStr = fmt.Sprintf("<p class=\"item\">\n      <span class=\"label\">收件地址:</span>\n      <span class=\"value\">%s</span>\n    </p>", this.GetString("delivery_address"))
-		}
-		html := fmt.Sprintf(email_format_new,
-			FormatDate(&now, Date_Full_Layout),
-			strings.Join(orderArr, ","),
-			Allmoney/100,
-			this.GetString("invoice_variety"),
-			qutil.InterfaceToStr(qutil.If(this.GetString("invoice_type") == "", "--", this.GetString("invoice_type"))),
-			qutil.InterfaceToStr(qutil.If(this.GetString("company_name") == "", "--", this.GetString("company_name"))),
-			qutil.InterfaceToStr(qutil.If(this.GetString("taxpayer_identnum") == "", "--", this.GetString("taxpayer_identnum"))),
-			qutil.InterfaceToStr(qutil.If(this.GetString("company_address") == "", "--", this.GetString("company_address"))),
-			qutil.InterfaceToStr(qutil.If(this.GetString("company_phone") == "", "--", this.GetString("company_phone"))),
-			qutil.InterfaceToStr(qutil.If(this.GetString("bank_name") == "", "--", this.GetString("bank_name"))),
-			qutil.InterfaceToStr(qutil.If(this.GetString("bank_account") == "", "--", this.GetString("bank_account"))),
-			qutil.InterfaceToStr(qutil.If(this.GetString("remark") == "", "--", this.GetString("remark"))),
-			recipientStr,
-			this.GetString("phone"),
-			deliveryAddressStr,
-		)
-		for _, v := range strings.Split(config.Config.FinanceMail, ",") {
-			InvoiceSendMail(v, html, fmt.Sprintf("客户申请开具%s", this.GetString("invoice_variety")))
-		}
+        return
 	}
 	this.ServeJson(NewResult("保存信息成功", nil))
 }
@@ -1254,7 +1255,6 @@ func htjs(body map[string]interface{}, orderCode []string, invoiceType, companyN
 				util.Mysql.Update("dataexport_order", map[string]interface{}{
 					"order_code": v,
 				}, updateData)
-
 			}
 			sendMail(invoiceType, strings.Join(orderCode, ","), companyName, taxpayerIdentnum, mail, phone, qutil.InterfaceToStr(resData["path"]))
 		}