Prechádzať zdrojové kódy

Merge branch 'dev/v4.9.21_rjj' of qmx/jy into feature/v4.9.21

renjiaojiao 1 rok pred
rodič
commit
f11c071ab9

+ 7 - 6
src/jfw/modules/subscribepay/src/config/config.go

@@ -236,12 +236,13 @@ type Invoice struct {
 		Time  string
 	}
 	Invoice_switch     bool
-	Red_invoice_switch bool   //红冲发票是否可用开关
-	Red_invoice_msg    string //提示信息
-	Third_party_switch bool   //第三方开票开关
-	Order_createtime   int64  //24年之前的订单不能开票
-	SigningSubject     string `json:"signing_subject"` //管理后台订单发票签约主体配置
-	SubmitNum          int64  `json:"submit_num"`
+	Red_invoice_switch bool            //红冲发票是否可用开关
+	Red_invoice_msg    string          //提示信息
+	Third_party_switch bool            //第三方开票开关
+	Order_createtime   int64           //24年之前的订单不能开票
+	SigningSubject     string          `json:"signing_subject"` //管理后台订单发票签约主体配置
+	SubmitNum          int64           `json:"submit_num"`
+	Invoice_type       map[string]bool //发票类型
 }
 
 type entnicheConfig struct {

+ 6 - 1
src/jfw/modules/subscribepay/src/invoice.json

@@ -15,5 +15,10 @@
   "third_party_switch": false,
   "order_createtime": 1704038400,
   "submit_num": 3,
-  "signing_Subject":"北京剑鱼信息技术有限公司"
+  "signing_Subject":"北京剑鱼信息技术有限公司",
+  "invoice_type": {
+    "电子普通发票": true,
+    "电子专用发票": true,
+    "普通发票(电子发票)": true
+  }
 }

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

@@ -1451,37 +1451,37 @@ func (this *Invoice) InvoiceSubmit() {
 		this.ServeJson(NewResult("", errors.New("缺少参数")))
 		return
 	}
+	if !config.InvoiceConfig.Invoice_type[this.GetString("invoice_variety")] {
+		this.ServeJson(NewResult("", errors.New("发票类型有误")))
+		return
+	}
+	if this.GetString("invoice_type") != "个人" && this.GetString("invoice_type") != "单位" {
+		this.ServeJson(NewResult("", errors.New("发票抬头有误")))
+		return
+	}
 	now := time.Now()
 	again, _ := this.GetInteger("again")                       //是否是失败重新开票 0 首次提交  1 再此提交
 	oldOnlyIdentifying := this.GetString("oldOnlyIdentifying") //最后一次失败的发票信息唯一标识
 	data := map[string]interface{}{
-		//"order_code":          orderCode,
-		"company_name":    this.GetString("company_name"),
-		"phone":           this.GetString("phone"),
-		"mail":            this.GetString("mail"),
-		"invoice_type":    this.GetString("invoice_type"),
-		"invoice_content": this.GetString("invoiceContent"),
-		"invoice_status":  0,
-		"invoice_changed": 0,
-		//"invoice_order_code":  orderCode,
+		"company_name":      this.GetString("company_name"),
+		"phone":             this.GetString("phone"),
+		"mail":              this.GetString("mail"),
+		"invoice_type":      this.GetString("invoice_type"),
+		"invoice_content":   this.GetString("invoiceContent"),
+		"invoice_status":    0,
+		"invoice_changed":   0,
 		"company_phone":     this.GetString("company_phone"),
 		"taxpayer_identnum": this.GetString("taxpayer_identnum"),
 		"create_time":       time.Now().Unix(),
-		//"user_id":           userId,
-		"operable_time": FormatDate(&now, Date_Full_Layout),
-		//"invoice_money":       payMoney,
-		//"invoice_order_money": payMoney,
-		"invoicing_entity": "北京剑鱼信息技术有限公司",
-		"remark":           this.GetString("remark"),
-		//"source":           0,
-		"invoice_variety": this.GetString("invoice_variety"),
-		"bank_account":    this.GetString("bank_account"),
-		//"only_Identifying":    onlyIdentifying,
-		"company_address":  this.GetString("company_address"),
-		"bank_name":        this.GetString("bank_name"),
-		"recipient":        this.GetString("recipient"),
-		"delivery_address": this.GetString("delivery_address"),
-		//"product_type":        qutil.ObjToString((*orderInfo)["product_type"]),
+		"operable_time":     FormatDate(&now, Date_Full_Layout),
+		"invoicing_entity":  "北京剑鱼信息技术有限公司",
+		"remark":            this.GetString("remark"),
+		"invoice_variety":   this.GetString("invoice_variety"),
+		"bank_account":      this.GetString("bank_account"),
+		"company_address":   this.GetString("company_address"),
+		"bank_name":         this.GetString("bank_name"),
+		"recipient":         this.GetString("recipient"),
+		"delivery_address":  this.GetString("delivery_address"),
 	}
 	if again == 1 {
 		err := OpenInvoiceAgain(oldOnlyIdentifying, data)