wugg 5 months ago
parent
commit
646032fb86
2 changed files with 7 additions and 38 deletions
  1. 5 1
      app/cxinv/command/CheckInvoice.php
  2. 2 37
      app/cxinv/controller/Invoice.php

+ 5 - 1
app/cxinv/command/CheckInvoice.php

@@ -3,7 +3,11 @@ declare (strict_types = 1);
 
 namespace app\cxinv\command;
 
-use app\cxinv\model\Invoice;use app\cxinv\model\InvoiceInfo;use app\user\model\Business;use app\user\model\Supplier;use think\console\Command;
+use app\cxinv\model\Invoice;
+use app\cxinv\model\InvoiceInfo;
+use app\user\model\Business;
+use app\user\model\Supplier;
+use think\console\Command;
 use think\console\Input;
 use think\console\input\Argument;
 use think\console\input\Option;

+ 2 - 37
app/cxinv/controller/Invoice.php

@@ -66,7 +66,7 @@ class Invoice extends Base{
         $this->model->saveAll($param['list']);
         return success("添加成功");
     }
-    //0待验证 1待确认公司信息 2 待关联数据 3 关联中 4 关联完成
+    //0待验证 1待确认公司信息 2 待关联数据 3 关联中 4 关联完成
     public function save(){
         $param= $this->request->param([
             "id"=>"",
@@ -116,41 +116,6 @@ class Invoice extends Base{
         $invoice->save();
         return success("保存成功");
     }
-    //0待验证 1待关联订单 2订单部分关联 3订单完全关联
-//    public function status(){
-//        $param= $this->request->param(["InvCode"=>"","status"=>"","remark"=>"",'ItemRemark'=>[]],"post","trim");
-//        $valide=Validate::rule([
-//            "InvCode|回票编号"=>"require|max:255",
-//            "status|状态"=>"require|in:3,4,5,6,7,8"
-//        ]);
-//        if(!$valide->check($param)) return error($valide->getError());
-//        $info=$this->model->where("InvCode",$param['InvCode'])->findOrEmpty();
-//        if($info->isEmpty()) return error("回票编号不存在");
-//        if($param['status']==3) $info->check_time=date('Y-m-d H:i:s');
-//        if(in_array($info['invoice_type'],['normal','electronic','toll','roll']) && $param['status']==3){
-//          $param['status']=4; //普票无需认证
-//        }
-//        $info->status=$param['status'];
-//        $info->remark=$param['remark'];
-//        $this->model->startTrans();
-//        try{
-//            $save=$info->save();
-//            if(!$save) throw new \Exception("修改失败");
-//            if($param['status']==3){
-//                if (!empty($param['ItemRemark'])){
-//                     (new InvoiceOrder)->saveAll($param['ItemRemark']);
-//                    };
-//            }
-//             if(in_array($param['status'],[5,6,7])){
-//                    InvoiceItem::rmInvoice($param['hpNo']);
-//              }
-//            $this->model->commit();
-//        }catch (\Exception $e){
-//            $this->model->rollback();
-//            return error($e->getMessage());
-//        }
-//        return success("修改成功");
-//    }
 
     public function delete(){
         $param= $this->request->param(["InvCode"=>""],"post","trim");
@@ -160,7 +125,7 @@ class Invoice extends Base{
         if(!$valide->check($param)) return error($valide->getError());
         $info=$this->model->where("InvCode",$param['InvCode'])->findOrEmpty();
         if($info->isEmpty()) return error("发票编号不存在");
-        if(in_array($info->status,[2,3,4])) return error("发票状态不允许删除");
+        if(in_array($info->status,[3,4])) return error("发票状态不允许删除");
         $info->delete();
        return success("删除成功");
     }