wuggemail@foxmail.com 4 bulan lalu
induk
melakukan
0646d0dd0c

+ 14 - 0
app/admin/controller/Consult.php

@@ -783,6 +783,9 @@ class Consult extends Base
 			 $spucode=makeNo('SSU');
 		}
 		$tax_id = isset($this->post['tax_id'])&&$this->post['tax_id']!==''? intval($this->post['tax_id']):'0';
+        $is_syscn_tax = isset($this->post['is_syscn_tax'])&&$this->post['is_syscn_tax']!==''? intval($this->post['is_syscn_tax']):'0';
+        $out_tax = isset($this->post['tax'])&&$this->post['tax']!==''? trim($this->post['tax']):'';
+        $out_tax_id = isset($this->post['out_tax_id'])&&$this->post['out_tax_id']!==''? intval($this->post['out_tax_id']):'0';
 		$cgd_tax_id = isset($this->post['cgd_tax_id'])&&$this->post['cgd_tax_id']!==''? intval($this->post['cgd_tax_id']):'0';
 		$cgd_tax = isset($this->post['cgd_tax'])&&$this->post['cgd_tax']!==''? trim($this->post['cgd_tax']):'';
         $open_type= isset($this->post['open_type'])&&$this->post['open_type']!==''? intval($this->post['open_type']):1;
@@ -796,6 +799,11 @@ class Consult extends Base
                 if($cgd_tax==='') return error_show(1004,'源头供应商开票税率不能为空');
             }
         }
+        if($is_syscn_tax==1){
+            $out_tax_id = $tax_id;
+            $out_tax = $tax;
+        }
+        $tax_status = $tax_id!=0 && $out_tax_id!=0? 1 : -1;
         //计算毛利率
         $budget = get_budget($zxinfo['cat_id'], $zx['companyNo'], $zx['platform_code']);
 		if($budget===false) $this->error('未找到业务公司有关的平台分类毛利信息');
@@ -922,8 +930,14 @@ class Consult extends Base
 	        'cgd_apply_id'=>$cgd_apply_id,//竞单人
 	        'cgd_apply_name'=>$cgd_apply_name,//竞单人
 	        "open_type"=>$open_type,
+            "is_syscn_tax"=>$is_syscn_tax,
+            "tax_exam_uname"=>$tax_status==1?'system':"",
+            "tax_exam_time"=>$tax_status==1?date("Y-m-d H:i:s"):null,
 	        "inv_good_name"=>$inv_good_name,//采购商品名称
 	        "tax_id"=>$tax_id,//税目id
+            'out_tax_id'=>$out_tax_id,//出口税目
+            'out_tax'=>$out_tax,//出口税率
+            'tax_status'=> $tax_status,//税目状态
 	        "cgd_tax"=>$cgd_tax,//税目
 	        "cgd_tax_id"=>$cgd_tax_id
         ];

+ 7 - 6
app/admin/controller/Sale.php

@@ -110,18 +110,13 @@ class Sale extends Base
         }
          $origin = Db::name('good_nake')->where([['spuCode', '=', $spuCode], ['min_num', '<=', $good_num], ['is_del', '=', 0]])->order('min_num desc')->find();
          $origin_price = $origin['nake_total']??0;
-          $cgd_origin_price = $origin['supplier_origin_price']??0;
+         $cgd_origin_price = $origin['supplier_origin_price']??0;
         if ($goodinfo['is_stock'] == 1) {
            $stock_num = Db::name("good")->where(["spuCode"=> $spuCode])->value("usable_stock",0);
             if($stock_num < $good_num){
                 return error_show(1003, "商品可用库存数量不足");
             }
             $origin_price = 0;
-        }else{
-        	
-           if ($origin == false) {
-              return error_show(1003, '未找到相关阶梯成本价格');
-           }
         }
 
         $sale_price = isset($this->post['good_price']) && $this->post['good_price'] !== "" ? floatval($this->post['good_price']) : '';
@@ -143,6 +138,9 @@ class Sale extends Base
                 $sale_price = $sale_price !== "" ? $sale_price : $act['activity_price'];
                 $origin_price = $act['cost_price'];
             } else {
+                if ($origin == false) {
+                    return error_show(1003, '未找到相关阶梯成本价格');
+                }
                 $good = Db::name("good_ladder")->where(["skuCode" => $skuCode, "is_del" => 0, "status" => 1])->where([["min_num", "<=", $good_num]])->order("min_num desc")->find();
                 if ($good == false) {
                     return error_show(1003, "未找到相关阶梯价格");
@@ -163,6 +161,9 @@ class Sale extends Base
             }
 
         } else {
+            if ($origin == false) {
+                return error_show(1003, '未找到相关阶梯成本价格');
+            }
             $sale_price = 0;
         }
         

+ 2 - 2
app/admin/controller/SaleReport.php

@@ -653,7 +653,7 @@ class SaleReport extends Base
     {
         $param = $this->request->only(['token', 'start_date' => '', 'end_date' => '', 'start_arrive_date' => '', 'end_arrive_date' => '', 'page' => 1, 'size' => 15], 'post', 'trim');
 
-        $where = [['s.is_del', '=', 0], ['out.status', '=', 1]];
+        $where = [['s.is_del', '=', 0], ['out.status', 'in', [0,1]]];
         if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['s.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
         if ($param['start_arrive_date'] != '' && $param['end_arrive_date'] != '') $where[] = ['s.arrive_time', 'between', [$param['start_arrive_date'] . ' 00:00:00', $param['end_arrive_date'] . ' 23:59:59']];
 
@@ -732,7 +732,7 @@ class SaleReport extends Base
     {
         $param = $this->request->only(['token', 'start_date' => '', 'end_date' => '', 'start_arrive_date' => '', 'end_arrive_date' => ''], 'post', 'trim');
 
-        $where = [['s.is_del', '=', 0], ['out.status', '=', 1]];
+        $where = [['s.is_del', '=', 0], ['out.status','in', [0,1]]];
         if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['s.addtime', 'between', [$param['start_date'] . ' 00:00:00', $param['end_date'] . ' 23:59:59']];
         if ($param['start_arrive_date'] != '' && $param['end_arrive_date'] != '') $where[] = ['s.arrive_time', 'between', [$param['start_arrive_date'] . ' 00:00:00', $param['end_arrive_date'] . ' 23:59:59']];
 

+ 2 - 0
app/txx/listener/WxPush.php

@@ -5,6 +5,8 @@ namespace app\txx\listener;
 
 use app\txx\model\Act;
 use think\facade\Cache;
+use think\facade\Log;
+
 class WxPush
 {
     public function handle($event)

+ 2 - 1
app/txx/middleware/CheckAuth.php

@@ -4,7 +4,8 @@ declare (strict_types = 1);
 namespace app\txx\middleware;
 
 use app\txx\common\Sign;
-use think\facade\Db;use think\Response;
+use think\facade\Db;
+use think\Response;
 use think\facade\Log;
 class CheckAuth
 {