|
@@ -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"], "")
|
|
|
+ //国家税务局-增值税电子发票公共服务平台
|
|
|
+ //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:
|