|
@@ -346,14 +346,17 @@ func (d *DataExport) CancelOrder() error {
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
|
|
-// 查询订单最后开票状态
|
|
|
|
-func QmxInvoice(res map[string]interface{}) bool {
|
|
|
|
- if res["is_backstage_order"] == 1 && res["order_channel"] != "xdqd04" {
|
|
|
|
- if res["return_status"] == 1 && public.Mysql.Count("invoice", map[string]interface{}{
|
|
|
|
|
|
+// 是否可开票
|
|
|
|
+func IsAllowInvoice(res map[string]interface{}) bool {
|
|
|
|
+ filter := util.ObjToString(res["filter"].(string))
|
|
|
|
+ filter_map := map[string]interface{}{}
|
|
|
|
+ _ = json.Unmarshal([]byte(filter), &filter_map)
|
|
|
|
+ if res["order_status"] == 1 && filter_map["badge"] != "exchange" && res["applybill_status"] == 1 &&
|
|
|
|
+ //用户下单|| 代用户下单|| qmx下单 已全额回款 发票企业为剑鱼
|
|
|
|
+ (res["is_backstage_order"] == 0 || res["order_channel"] == "xdqd04" || (res["return_status"] == 1 && public.Mysql.Count("invoice", map[string]interface{}{
|
|
"order_code": res["order_code"],
|
|
"order_code": res["order_code"],
|
|
- }) == 0 && res["signing_subject"] == "北京剑鱼信息技术有限公司" {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
|
|
+ }) == 0 && res["signing_subject"] == "北京剑鱼信息技术有限公司")) {
|
|
|
|
+ return true
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
@@ -420,14 +423,15 @@ func (d *DataExport) ToOrderDetail(orderCode string) error {
|
|
orderDetail = *public.Mysql.FindOne(tableName_order, queryMap, "", "")
|
|
orderDetail = *public.Mysql.FindOne(tableName_order, queryMap, "", "")
|
|
//最后一次开票查询
|
|
//最后一次开票查询
|
|
//orderDetail["source"] = LastInvoiceSource(orderCode)
|
|
//orderDetail["source"] = LastInvoiceSource(orderCode)
|
|
- //如果是管理后台的单子 是否满足可开票
|
|
|
|
- orderDetail["qmx_invoice"] = QmxInvoice(orderDetail)
|
|
|
|
- //剩余可开票金额
|
|
|
|
- var invoicePrice bool
|
|
|
|
- if util.Int64All(orderDetail["create_time"]) > 1704038400 {
|
|
|
|
- invoicePrice = InvoicePrice(orderDetail) > 0
|
|
|
|
|
|
+ //是否满足可开票
|
|
|
|
+ var isCanInvoic bool
|
|
|
|
+ create_time_str := util.ObjToString(orderDetail["create_time"])
|
|
|
|
+ create_time, _ := time.ParseInLocation(Date_Full_Layout, create_time_str, time.Local)
|
|
|
|
+ if create_time.Unix() > 1704038400 {
|
|
|
|
+ //剩余可开票金额
|
|
|
|
+ isCanInvoic = IsAllowInvoice(orderDetail) && InvoicePrice(orderDetail) > 0
|
|
}
|
|
}
|
|
- orderDetail["invoice_price"] = invoicePrice
|
|
|
|
|
|
+ orderDetail["is_can_invoice"] = isCanInvoic
|
|
//是否存在可查看发票
|
|
//是否存在可查看发票
|
|
orderDetail["invoice_show"] = len(ShowList(util.InterfaceToStr(orderDetail["order_code"]))) > 0
|
|
orderDetail["invoice_show"] = len(ShowList(util.InterfaceToStr(orderDetail["order_code"]))) > 0
|
|
}
|
|
}
|