Browse Source

fix:发票缺陷问题修改

duxin 1 year ago
parent
commit
108d373aaa

+ 3 - 0
src/jfw/front/dataExport.go

@@ -348,6 +348,9 @@ func (d *DataExport) CancelOrder() error {
 
 
 // 是否可开票
 // 是否可开票
 func IsAllowInvoice(res map[string]interface{}) bool {
 func IsAllowInvoice(res map[string]interface{}) bool {
+	if util.IntAll(res["applybill_status"]) > 0 {
+		return false
+	}
 	filter := util.ObjToString(res["filter"].(string))
 	filter := util.ObjToString(res["filter"].(string))
 	filter_map := map[string]interface{}{}
 	filter_map := map[string]interface{}{}
 	_ = json.Unmarshal([]byte(filter), &filter_map)
 	_ = json.Unmarshal([]byte(filter), &filter_map)

+ 5 - 0
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -1398,6 +1398,9 @@ func LastInvoiceSource(orderCode string) int64 {
 
 
 // 是否可开票
 // 是否可开票
 func IsAllowInvoice(res map[string]interface{}) bool {
 func IsAllowInvoice(res map[string]interface{}) bool {
+	if qutil.IntAll(res["applybill_status"]) > 0 {
+		return false
+	}
 	filter := qutil.ObjToString(res["filter"].(string))
 	filter := qutil.ObjToString(res["filter"].(string))
 	filter_map := map[string]interface{}{}
 	filter_map := map[string]interface{}{}
 	_ = json.Unmarshal([]byte(filter), &filter_map)
 	_ = json.Unmarshal([]byte(filter), &filter_map)
@@ -1773,12 +1776,14 @@ func (this *Invoice) InvoiceQuery() {
 			}
 			}
 		}
 		}
 	}
 	}
+
 	this.ServeJson(NewResult(map[string]interface{}{
 	this.ServeJson(NewResult(map[string]interface{}{
 		"orderCodes":   strings.Join(orderArr, ","),
 		"orderCodes":   strings.Join(orderArr, ","),
 		"money":        money,
 		"money":        money,
 		"invoice":      &invoiceOne,
 		"invoice":      &invoiceOne,
 		"operator":     operator,
 		"operator":     operator,
 		"company_name": companyName,
 		"company_name": companyName,
+		"isFollowWx":   1,
 	}, nil))
 	}, nil))
 }
 }
 
 

+ 15 - 12
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -627,6 +627,19 @@ func (o *OrderListDetails) Datas(sql string, pageNum, pagesize_max int) (haveNex
 					}
 					}
 				}
 				}
 			}
 			}
+			//超时关闭订单
+			create_time_str := qutil.ObjToString(result[i]["create_time"])
+			create_time, _ := time.ParseInLocation(Date_Full_Layout, create_time_str, time.Local)
+
+			//是否满足可开票
+			var isCanInvoic bool
+			if create_time.Unix() > config.InvoiceConfig.Order_createtime {
+				//剩余可开票金额
+				isCanInvoic = IsAllowInvoice(result[i])
+			}
+			result[i]["is_can_invoice"] = isCanInvoic
+			//是否存在可查看发票
+			result[i]["invoice_show"] = len(ShowList(qutil.InterfaceToStr(result[i]["order_code"]))) > 0
 			if qutil.ObjToString(result[i]["pay_way"]) == "transferAccounts" {
 			if qutil.ObjToString(result[i]["pay_way"]) == "transferAccounts" {
 				if qutil.IntAll(result[i]["course_status"]) == 2 || qutil.IntAll(result[i]["course_status"]) == 4 {
 				if qutil.IntAll(result[i]["course_status"]) == 2 || qutil.IntAll(result[i]["course_status"]) == 4 {
 					continue
 					continue
@@ -637,9 +650,7 @@ func (o *OrderListDetails) Datas(sql string, pageNum, pagesize_max int) (haveNex
 				result[i]["userLotteryId"] = encrypt.SE.Encode2Hex(qutil.ObjToString(result[i]["d_relation_id"]))
 				result[i]["userLotteryId"] = encrypt.SE.Encode2Hex(qutil.ObjToString(result[i]["d_relation_id"]))
 			}
 			}
 			delete(result[i], "d_relation_id")
 			delete(result[i], "d_relation_id")
-			//超时关闭订单
-			create_time_str := qutil.ObjToString(result[i]["create_time"])
-			create_time, _ := time.ParseInLocation(Date_Full_Layout, create_time_str, time.Local)
+
 			var create_time_stamp int64 = 0
 			var create_time_stamp int64 = 0
 			order_countdown := config.Config.OrderCountdown //配置文件读取
 			order_countdown := config.Config.OrderCountdown //配置文件读取
 			if strings.Contains(qutil.ObjToString(order_countdown), "h") {
 			if strings.Contains(qutil.ObjToString(order_countdown), "h") {
@@ -663,15 +674,7 @@ func (o *OrderListDetails) Datas(sql string, pageNum, pagesize_max int) (haveNex
 			}
 			}
 			//新增最后开票
 			//新增最后开票
 			//result[i]["source"] = LastInvoiceSource(qutil.InterfaceToStr(result[i]["order_code"])) p537 用户可查看所有发票
 			//result[i]["source"] = LastInvoiceSource(qutil.InterfaceToStr(result[i]["order_code"])) p537 用户可查看所有发票
-			//是否满足可开票
-			var isCanInvoic bool
-			if create_time.Unix() > config.InvoiceConfig.Order_createtime {
-				//剩余可开票金额
-				isCanInvoic = IsAllowInvoice(result[i])
-			}
-			result[i]["is_can_invoice"] = isCanInvoic
-			//是否存在可查看发票
-			result[i]["invoice_show"] = len(ShowList(qutil.InterfaceToStr(result[i]["order_code"]))) > 0
+
 		}
 		}
 	}
 	}
 	haveNextPage = len(result) >= pagesize_max
 	haveNextPage = len(result) >= pagesize_max