wuggemail@foxmail.com 3 months ago
parent
commit
aa9fdfc12c
1 changed files with 26 additions and 3 deletions
  1. 26 3
      app/cxinv/controller/FinancialManager.php

+ 26 - 3
app/cxinv/controller/FinancialManager.php

@@ -311,7 +311,7 @@ class FinancialManager extends Base{
     //导出数据manager异常数据
     public function export(){
      $param = $this->request->param(["code"=>"","type"=>[],"seller_code"=>"","buyer_code"=>"","orderCode"=>"","cxCode"=>"",
-            "goodNo"=>"","inv_number"=>"","inv_buyer_code"=>"",'inv_seller_code'=>"",'channel'=>[],'status'=>"","start"=>"","end"=>"",
+            "goodNo"=>"","inv_number"=>"","inv_buyer_code"=>"",'inv_seller_code'=>"",'channel'=>1,'status'=>"","start"=>"","end"=>"",
             "page"=>1,"size"=>15],"post","trim");
     $where=[];
     if($param['code']!="") $where[]= ["code","=","%{$param['code']}%"];
@@ -328,11 +328,34 @@ class FinancialManager extends Base{
     if($param['inv_number']!="") $where[]= ["inv_number","like","%{$param['inv_number']}%"];
     if($param['inv_buyer_code']!="") $where[]= ["inv_buyer_code","=",$param['inv_buyer_code']];
     if($param['inv_seller_code']!="") $where[]= ["inv_seller_code","=",$param['inv_seller_code']];
+    $heade=[
+        ["业务编号","类型","订单来源","订单购买方纳税号","订单购买方公司名称","订单销售方纳税号","订单销售方公司名称","订单编号","订单主单号",
+        "商品类型","商品编号","商品名称","订单单位","商品数量","商品单价","订单总金额","税目","税目名称","订单税率","关联金额","购买方纳税号",
+        "购买方名称","发票号码","开票日期","发票类型","销售方纳税号","销售方公司","发票明细ID","货物或应税劳务、服务名称","类目编号","规格型号",
+        "单位","数量","税前单价","税前总价","税率","税额","税后单价","税后总额","类目编号状态","税率状态","备注"],
+        ["业务编号","类型","订单来源","购买方公司纳税号","购买方公司","发票号码","开票日期","发票类型","销售方公司纳税号","销售方公司","发票明细ID",
+        "货物或应税劳务、服务名称","类目编号","规格型号","单位","数量","税前单价","税前总价","税率","税额","税后单价","税后总额"],
+        ["业务编号","类型","订单来源","订单购买方纳税号","订单购买方公司名称","订单销售方纳税号","订单销售方公司名称","订单编号","订单主单号",
+        "商品类型","商品编号","商品名称","订单单位","商品数量","商品单价","订单总金额","税目","税目名称","订单税率"]
+    ];
+    $fields=[
+        ["invoiceCode","type",'source','seller_code','seller_name','buyer_code','buyer_name','orderCode','cxCode','goodType',
+        'goodNo','goodName','unit','num','goodPrice','totalPrice','cat_code','cat_name','tax','inv_fee','inv_buyer_code',
+        'inv_buyer_name','inv_number','inv_open_date','inv_type','inv_seller_code','inv_seller_name','inv_item_id','inv_good_name',
+        'inv_cat_code','inv_spec','inv_unit','inv_num','inv_subprice','inv_subtotal','inv_tax','inv_tax_total','inv_price','inv_total',
+        'cat_diff','tax_diff','remark'],
+        ["invoiceCode","type",'source','seller_code','seller_name','inv_number','inv_open_date','inv_type','inv_seller_code','inv_seller_name',
+        'inv_item_id','inv_good_name','inv_cat_code','inv_spec','inv_unit','inv_num','inv_subprice','inv_subtotal','inv_tax','inv_tax_total'],
+        [
+         "invoiceCode","type",'source','seller_code','seller_name','buyer_code','buyer_name','orderCode','cxCode','goodType',
+        'goodNo','goodName','unit','num','goodPrice','totalPrice',"cat_code","cat_name","tax"]
+        ];
+
     $list = $this->model
-        ->field("id")
+        ->field($fields[$param['channel']-1])
         ->where($where)
         ->order("id desc")
         ->select();
-    exportExcel($list,['id'],"manager");
+    exportExcel($list,$heade[$param['channel']-1],"manager");
     }
 }