Browse Source

Merge branch 'feature/v4.9.21' of https://jygit.jydev.jianyu360.cn/qmx/jy into dev/v4.9.21_wmh

wenmenghao321 1 year ago
parent
commit
18f81eb4b5

+ 21 - 12
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -452,7 +452,7 @@ func (this *Invoice) ShowinvoiceList() {
 	}
 	invoices := ShowList(order_code)
 	if invoices != nil && len(invoices) > 0 {
-		//isIos := util.IsMobileIOS(this.Request.UserAgent())
+		isIos := util.IsMobileIOS(this.Request.UserAgent())
 		var invoiceData []map[string]interface{}
 		for _, data := range invoices {
 			//是否换过票
@@ -467,13 +467,14 @@ func (this *Invoice) ShowinvoiceList() {
 			isJyEntity := data["invoicing_entity"] != nil && qutil.InterfaceToStr(data["invoicing_entity"]) != config.InvoiceConfig.SigningSubject
 			data["changed"] = qutil.If(isJyInvoice || isChanged || isJyEntity || timeLimit, true, false)
 			//if url := qutil.InterfaceToStr(data["url"]); url != "" {
-			//	//ios 移动端
-			//	if isIos {
-			//		//国家税务局-增值税电子发票公共服务平台
-			//		if strings.Contains(url, "tysl.beijing.chinatax") {
-			//			data["url"] = strings.ReplaceAll(url, "/preview.html?code=", "/web-reader/reader?file=")
-			//		}
-			//	}
+			//ios 移动端
+			if !isIos {
+				data["url"] = qutil.If(data["source_url"] != nil && qutil.ObjToString(data["source_url"]) != "", data["source_url"], data["url"])
+				//国家税务局-增值税电子发票公共服务平台
+				//if strings.Contains(url, "tysl.beijing.chinatax") {
+				//	data["url"] = strings.ReplaceAll(url, "/preview.html?code=", "/web-reader/reader?file=")
+				//}
+			}
 			//}
 			isReopen := timeLimit
 			//var isReopen bool
@@ -511,7 +512,7 @@ func (this *Invoice) ShowinvoiceList() {
 func ShowList(order_code string) []map[string]interface{} {
 	data := util.Mysql.SelectBySql(fmt.Sprintf(`SELECT *,(
   SELECT count(1) as count FROM invoice b WHERE b.order_code = a.order_code and  b.only_Identifying is not null and b.only_Identifying = a.only_Identifying
-) as isChanged FROM invoice a WHERE order_code = '%s' and invoice_status != -2 and invoice_variety is not null and invoice_variety not  LIKE '%s' ORDER BY create_time DESC`, order_code, "%纸质%"))
+) as isChanged FROM invoice a WHERE order_code = '%s' and invoice_status != -2 and invoice_variety is not null and invoice_variety is not null and invoice_variety not  LIKE '%s' ORDER BY create_time DESC`, order_code, "%纸质%"))
 	if data == nil {
 		return nil
 	}
@@ -526,9 +527,12 @@ func (this *Invoice) NewInvoiceShow() {
 	case "1": //订单回显金额
 		data["pay_money"] = ResidueMoney(code)
 	case "2": //发票信息回显
-		invoice := util.Mysql.FindOne("invoice", map[string]interface{}{"id": encrypt.SE.Decode4Hex(code)}, "id,only_Identifying,order_code,invoice_money,remark,invoice_type,invoice_content,invoice_variety,company_name,phone,mail,taxpayer_identnum,invoice_money,invoice_order_money,company_address,bank_name,recipient,delivery_address,bank_account,company_phone", "")
+		invoice := util.Mysql.FindOne("invoice", map[string]interface{}{"id": encrypt.SE.Decode4Hex(code)}, "id,only_Identifying,order_code,invoice_order_code,invoice_money,remark,invoice_type,invoice_content,invoice_variety,company_name,phone,mail,taxpayer_identnum,invoice_money,invoice_order_money,company_address,bank_name,recipient,delivery_address,bank_account,company_phone", "")
 		if invoice != nil {
 			(*invoice)["id"] = code
+			if (*invoice)["invoice_order_code"] != nil {
+				(*invoice)["order_code"] = (*invoice)["invoice_order_code"]
+			}
 			(*invoice)["only_Identifying"] = encrypt.SE.EncodeString(qutil.InterfaceToStr((*invoice)["only_Identifying"]))
 		}
 		data["invoice"] = invoice
@@ -1198,7 +1202,7 @@ func (this *Invoice) NewReplaceinvoice() {
 				}
 				if !isMail { //成功发邮件
 					isMail = true
-					sendMail(invoice_type, pCode, company_name, id_num, e_mail, phone, qutil.InterfaceToStr(data["url"]), invoiceContent)
+					sendMail(invoice_type, pCode, company_name, id_num, e_mail, phone, qutil.InterfaceToStr(data["source_url"]), invoiceContent)
 					//InvoiceSendMail(data["mail"].(string), html, "电子发票")
 				}
 			case false:
@@ -1401,6 +1405,9 @@ func IsAllowInvoice(res map[string]interface{}) bool {
 	if qutil.IntAll(res["applybill_status"]) > 0 {
 		return false
 	}
+	if qutil.Float64All(res["pay_money"]) == 0 {
+		return false
+	}
 	filter := qutil.ObjToString(res["filter"].(string))
 	filter_map := map[string]interface{}{}
 	_ = json.Unmarshal([]byte(filter), &filter_map)
@@ -1567,6 +1574,7 @@ func OpenInvoiceAgain(oldOnlyIdentifying string, data map[string]interface{}) er
 	if !ok {
 		return errors.New("插入失败记录出错")
 	}
+	delete(data, "invoice_changed")
 	if !util.Mysql.Update("invoice", map[string]interface{}{"only_Identifying": oldOnlyIdentifying, "invoice_status": -1}, data) {
 		return errors.New("再次开票更新发票信息出错")
 	}
@@ -1744,7 +1752,7 @@ func (this *Invoice) InvoiceQuery() {
 	}
 	invoiceOne := util.Mysql.FindOne("invoice", map[string]interface{}{
 		"only_Identifying": onlyIdentifying,
-	}, "id,invoice_changed,order_code, bank_account,invoice_code, create_time,invoice_number,company_phone,company_name, phone, mail,company_phone, invoice_type, invoice_content, url, invoice_status, invoice_serialnum, taxpayer_identnum,operator, operable_time, invoicing_entity, remark, invoice_variety, logistics_code, company_address, bank_name, recipient, delivery_address,only_Identifying", " create_time   DESC")
+	}, "id,invoice_changed,order_code, invoice_order_code,bank_account,invoice_code, create_time,invoice_number,company_phone,company_name, phone, mail,company_phone, invoice_type, invoice_content, url, invoice_status, invoice_serialnum, taxpayer_identnum,operator, operable_time, invoicing_entity, remark, invoice_variety, logistics_code, company_address, bank_name, recipient, delivery_address,only_Identifying", " create_time   DESC")
 	companyName := ""
 	if invoiceOne == nil {
 		//查询公司名称
@@ -1754,6 +1762,7 @@ func (this *Invoice) InvoiceQuery() {
 			companyName = qutil.ObjToString((*orderArr)[0]["company_name"])
 		}
 	} else {
+		(*invoiceOne)["order_code"] = qutil.If((*invoiceOne)["invoice_order_code"] != nil, (*invoiceOne)["invoice_order_code"], (*invoiceOne)["order_code"])
 		(*invoiceOne)["id"] = encrypt.SE.Encode2Hex(qutil.InterfaceToStr((*invoiceOne)["id"]))
 		timeLimit := qutil.Int64All((*invoiceOne)["create_time"]) <= config.InvoiceConfig.Order_createtime //24年之前的发票不让换票
 		switch qutil.IntAll((*invoiceOne)["invoice_status"]) {

+ 13 - 12
src/jfw/modules/subscribepay/src/util/util.go

@@ -1,25 +1,26 @@
 package util
 
 import (
-    qutil "app.yhyue.com/moapp/jybase/common"
-    "app.yhyue.com/moapp/jypkg/compatible"
-    "strings"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/compatible"
+	"strings"
 )
 
 var (
-    Compatible *compatible.Compatible
+	Compatible *compatible.Compatible
 )
 
 func ConfirmIntArr(arr []interface{}) []int {
-    tmp := make([]int, 0)
-    for _, v := range arr {
-        tmp = append(tmp, qutil.IntAll(v))
-    }
-    return tmp
+	tmp := make([]int, 0)
+	for _, v := range arr {
+		tmp = append(tmp, qutil.IntAll(v))
+	}
+	return tmp
 }
 
-//移动端ios
+// 移动端ios
 func IsMobileIOS(userAgent string) bool {
-    userAgent = strings.ToLower(userAgent)
-    return strings.Contains(userAgent, "iphone") || strings.Contains(userAgent, "ipad") || strings.Contains(userAgent, "ipod")
+	userAgent = strings.ToLower(userAgent)
+	return mobileReg.MatchString(userAgent)
+	//return strings.Contains(userAgent, "iphone") || strings.Contains(userAgent, "ipad") || strings.Contains(userAgent, "ipod")
 }

+ 4 - 0
src/web/staticres/electronic_invoice/css/check_invoice.css

@@ -71,6 +71,10 @@
   background: rgba(0, 0, 0, 0.12);
   border-radius: 50%;
 }
+.white_shadow .el-iconfont:hover{
+  background-color: #EAF8FA;
+  color: #2ABED1;
+}
 .el-icon-arrow-left, .el-icon-arrow-right{
   font-size: 20px;
 }

+ 1 - 0
src/web/staticres/electronic_invoice/css/invoice.css

@@ -69,6 +69,7 @@ input::placeholder, textarea::placeholder{
   width: 180px;
   height: 46px;
   background-color: #2ABED1;
+  border: none;
   color: #FFFFFF;
   font-size: 16px;
 }

+ 4 - 5
src/web/templates/pc/check_invoice.html

@@ -123,10 +123,10 @@
             <div class="btn-cells">
               <!-- <p class="backInvoice backP" style="display: none;padding-bottom: 8px;color: red;">系统问题,开票失败</p> -->
               <button class="btn btn-confirm" id="ing" disabled v-if="selectinvoice.invoice_status == 0 || selectinvoice.invoice_status == 2">开票中</button>
-              <button class="btn btn-confirm" @click="lookInvoice" id="look_invoice" v-if="selectinvoice.invoice_status == 1">查看发票</button>
+              <button class="btn btn-confirm" @click="lookInvoice" id="look_invoice" v-if="selectinvoice.invoice_status == 1 && selectinvoice.url">查看发票</button>
               <button class="btn btn-cancel" @click="againInvoice('replace')" id="again_invoice" v-if="selectinvoice.invoice_status == 1 && !selectinvoice.changed">换开申请</button>
               <button class="btn btn-confirm" @click="againInvoice('again')" v-if="selectinvoice.invoice_status == -1 && !selectinvoice.isReopen">再次开票</button>
-              <button class="btn btn-confirm" @click="concatKf" v-if="selectinvoice.isReopen">联系客服</button>
+              <button class="btn btn-confirm open-customer" @click="concatKf" v-if="selectinvoice.isReopen">联系客服</button>
               <p v-if="selectinvoice.invoice_status == 0 || selectinvoice.invoice_status == 2" style="text-align: center;font-size: 14px;color: #686868;padding: 12px 0">您申请的发票将在3个工作日内由平台开具并发送至您的邮箱,请注意查收。</p>
               <p v-if="selectinvoice.invoice_status == 1" style="text-align: center;font-size: 14px;color: #686868;padding: 12px 0">您申请的发票已由平台开具并发送至您的邮箱,请注意查收。</p>
             </div>
@@ -142,7 +142,8 @@
                         <div class="text" style="text-align:justify;">
                           1.平台提供电子普通发票、电子专用发票,发票内容为可选“信息技术服务-技术服务费”、“信息技术服务-会员费”、“信息技术服务-招投标数据服务”;<br>
                           2.您申请的电子发票将在3个工作日内由平台开具并发送至您的邮箱,请注意查收;<br>
-                          3.如有问题可联系客服,客服电话:400-108-6670。<br>
+                          3.新开具的数电发票共有3种格式:PDF、OFD、XML,手机端查看发票默认为PDF格式,如需OFD、XML格式,可前往邮箱或剑鱼标讯电脑端查看发票并下载;<br>
+                          4.如有问题可联系客服,客服电话:400-108-6670。<br>
                         </div>
                     </div>
                     <div class="modal-footer">
@@ -171,8 +172,6 @@
     <!-- footer -->
 	{{include "/common/pcbottom.html"}}
 	{{include "/common/baiducc.html"}}
-    <script src="{{Msg "seo" "cdn"}}/electronic_invoice/js/jquery-2.1.4.min.js"></script>
-    <script src="{{Msg "seo" "cdn"}}/electronic_invoice/js/bootstrap.min.js"></script>
     <script>
   $(function () {
       $('#ruleModal').on('show.bs.modal', function () {

+ 2 - 1
src/web/templates/pc/invoice.html

@@ -158,7 +158,8 @@
 	                <div class="text">
                     1.平台提供电子普通发票、电子专用发票,发票内容为可选“信息技术服务-技术服务费”、“信息技术服务-会员费”、“信息技术服务-招投标数据服务”;<br>
                     2.您申请的电子发票将在3个工作日内由平台开具并发送至您的邮箱,请注意查收;<br>
-                    3.如有问题可联系客服,客服电话:400-108-6670。<br>
+                    3.新开具的数电发票共有3种格式:PDF、OFD、XML,手机端查看发票默认为PDF格式,如需OFD、XML格式,可前往邮箱或剑鱼标讯电脑端查看发票并下载;<br>
+                    4.如有问题可联系客服,客服电话:400-108-6670。<br>
 	                </div>
 	            </div>
 	            <div class="modal-footer">