wugg 1 年之前
父節點
當前提交
0388400217
共有 3 個文件被更改,包括 11 次插入7 次删除
  1. 5 5
      app/admin/controller/OrderInv.php
  2. 2 2
      app/command/companyStats.php
  3. 4 0
      app/command/reportTips.php

+ 5 - 5
app/admin/controller/OrderInv.php

@@ -55,10 +55,10 @@ class OrderInv extends BaseController{
        if($company==false){
            return error_show(1004,"销售方信息未找到");
        }
-       $supplier = Db::name("supplier_info")->where(["code"=>$companyNo])->find();
-       if($supplier==false){
-           return error_show(1004,"业务公司信息未找到");
-       }
+//       $supplier = Db::name("supplier_info")->where(["code"=>$companyNo])->find();
+//       if($supplier==false){
+//           return error_show(1004,"业务公司信息未找到");
+//       }
        $invtype = isset($this->post['invtype'])&&$this->post['invtype']!=='' ? trim($this->post['invtype']):"";
         if($invtype==''){
            return error_show(1004,"参数 invtype 不能为空");
@@ -195,7 +195,7 @@ class OrderInv extends BaseController{
             "invNo"=>$invNo,
             "inv_value"=>$invfee,
             "inv_out"=> $companyNo,
-            "inv_company"=> $supplier['name']??"",
+            "inv_company"=> $company['invoice_title']??"",
             "apply_id"=>$this->uid,
             "apply_name"=>$this->uname,
             "inv_type"=>$invtype,//发票类型  专用 普通 电子专用 电子普通 全电子票

+ 2 - 2
app/command/companyStats.php

@@ -26,6 +26,7 @@ class companyStats extends Command
 	    if($sttime==1) return '';
 	    Cache::set("compTips",1,1800);
       $supplier = ["GS2302231124114965","GS2302231125079621","GS2302231323386950",'GS2203161855277894',"GS2304031312553746"];
+      
       try{
 	      foreach ($supplier as $sp){
 		      $this->checkData($sp);
@@ -33,13 +34,12 @@ class companyStats extends Command
       }catch (\Exception $e){
       	echo $e->getMessage();
       }
-
     }
 
 	/**
 	 * @param $supplierNo
 	 */
-    public function checkData($supplierNo):void {
+    public function checkData($supplierNo,$dateArr=[]):void {
         $sup=Db::connect("mysql_sys")->name("headquarters")->where(["code"=>$supplierNo])->field("code,name,relation_code")->findOrEmpty();
         if (empty($sup)) return;
         $date=date("Y-m-d");

+ 4 - 0
app/command/reportTips.php

@@ -38,10 +38,14 @@ class reportTips extends Command
 		foreach ($depart as $item=>$name){
 			$uidArr =getUidByDepartId($item);
 			$where=["ownerid"=>$uidArr,"companyNo"=>$companyNo,"platform_type"=>1];
+			
 			$tem=[
 				"depart"=>$name,
 				"wpay_fee"=>Db::name("qrd_info")->where($where)->sum('wpay_fee'),
 				"wpay_ainv_fee"=>Db::name("qrd_info")->where($where)->where(["inv_status"=>[2,3]])->sum('wpay_fee'),
+				"ainv_fee"=>Db::name("qrd_info")->where($where)->whereOr([["inv_status","<>",3],['pay_status','<>',3]])->sum('ainv_fee'),
+				"apay_fee"=>Db::name("qrd_info")->where($where)->whereOr([['inv_status','<>',3],['pay_status','<>',3]])->sum('apay_fee'),
+				"ainv_apay_fee"=>Db::name("qrd_info")->where($where)->whereOr([['inv_status','<>',3],['pay_status','<>',3]])->sum(Db::raw("ainv_fee - apay_fee")),
 				"wpay_send_fee"=>Db::name("qrd_info")->where($where)->where(["sendStatus"=>1])->sum('wpay_fee'),
 				"winv_fee"=>Db::name("qrd_info")->where($where)->sum('winv_fee'),
 				"inv_fee"=>Db::name("qrd_info")->where($where)->sum('inv_fee'),