123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <?php
- namespace app\cxinv\controller;
- use think\App;
- class FinancialManager extends Base{
- public function __construct(App $app) {
- parent::__construct($app);
- $this->model=new \app\cxinv\model\FinancialManager();
- }
- public function List(){
- $param = $this->request->param(["code"=>"","type"=>"","seller_code"=>"","buyer_code"=>"","orderCode"=>"","cxCode"=>"",
- "goodNo"=>"","inv_number"=>"","inv_buyer_code"=>"","start"=>"","end"=>"","page"=>1,"size"=>15],"post","trim");
- $where=[];
- if($param['code']!="") $where[]= ["code","=","%{$param['code']}%"];
- if($param['type']!="") $where[]= ["type","=",$param['type']];
- if($param['start']!="") $where[]= ["create_time",">=",startTime($param['start'])];
- if($param['end']!="") $where[]= ["create_time","<=",endTime($param['end'])];
- if($param['seller_code']!="") $where[]= ["seller_code","=",$param['seller_code']];
- if($param['buyer_code']!="") $where[]= ["buyer_code","=",$param['buyer_code']];
- if($param['orderCode']!="") $where[]= ["orderCode","=",$param['orderCode']];
- if($param['cxCode']!="") $where[]= ["cxCode","=",$param['cxCode']];
- if($param['goodNo']!="") $where[]= ["goodNo","=",$param['goodNo']];
- if($param['inv_number']!="") $where[]= ["inv_number","=",$param['inv_number']];
- if($param['inv_buyer_code']!="") $where[]= ["inv_buyer_code","=",$param['inv_buyer_code']];
- $list = $this->model
- ->where($where)
- ->order("id desc")
- ->paginate(['page'=>$param['page'],'list_rows'=>$param['size']]);
- return success('获取成功',['list'=>$list->items(),'count'=>$list->total()]);
- }
- //'code'=>'string',//订单或记录的唯一标识符
- // 'type'=>'int',//记录类型 1入库2出库
- // 'source'=>'int',//数据来源,1结算 2 线下订单
- // 'seller_code'=>'string',//卖方代码
- // 'seller_name'=>'string',//卖方名称
- // 'buyer_code'=>'string',//买方代码
- // 'buyer_name'=>'string',//买方名称
- // 'orderCode'=>'string',//订单编号
- // 'cxCode'=>'string',//客户编号
- // 'poCode'=>'string',//采购订单编号
- // 'platform_type'=>'int',//平台类型,1ToB 2ToC
- // 'goodNo'=>'string',//商品编号
- // 'goodName'=>'string',//商品名称
- // 'unit'=>'string',//商品单位
- // 'num'=>'int',//商品数量
- // 'goodPrice'=>'decimal',//商品单价
- // 'totalPrice'=>'decimal',//商品总价
- // 'cat_code'=>'string',//商品分类代码
- // 'cat_name'=>'string',//商品分类名称
- // 'tax'=>'decimal',//税率或税费
- // 'inv_fee'=>'decimal',//发票费用
- // 'inv_seller_code'=>'string',//发票卖方代码
- // 'inv_seller_name'=>'string',//发票卖方名称
- // 'inv_buyer_code'=>'string',//发票买方代码
- // 'inv_buyer_name'=>'string',//发票买方名称
- // 'inv_number'=>'string',//发票编号
- // 'inv_type'=>'string',//发票类型
- // 'inv_item_id'=>'int',//发票项目ID
- // 'inv_good_name'=>'string',//发票商品名称
- // 'inv_cat_code'=>'string',//发票商品分类代码
- // 'inv_spec'=>'string',//发票商品规格
- // 'inv_unit'=>'string',//发票商品单位
- // 'inv_num'=>'int',//发票商品数量
- // 'inv_subprice'=>'decimal',//发票商品子项单价
- // 'inv_subtotal'=>'decimal',//发票商品子项总价
- // 'inv_tax'=>'decimal',//发票税额
- // 'inv_tax_total'=>'decimal',//发票总税额
- // 'inv_price'=>'decimal',//发票单价
- // 'inv_total'=>'decimal',//发票总价
- // 'cat_diff'=>'int',//分类差异
- // 'tax_diff'=>'int',//税费差异
- // 'remark'=>'string',//备注或说明
- public function create(){
- $list=$this->request->post("list",[],"trim");
- $valid = $this->validate($list,[
- 'code|单据编号'=>'require|max:255',
- 'type|单据类型'=>'require|in:1,2,3',
- "source|单据来源"=>'require|in:1,2',
- 'seller_code|卖方公司纳税识别号'=>'require|max:255',
- 'seller_name|卖方公司名称'=>'require|max:255',
- 'buyer_code|买方公司纳税识别号'=>'require|max:255',
- 'buyer_name|买方公司名称'=>'require|max:255',
- 'orderCode|订单号'=>'max:255',
- 'cxCode|核销单号'=>'max:255',
- 'poCode|采购订单号'=>'max:255',
- 'platform_type|平台类型'=>'require|in:1,2',
- 'goodNo|商品编号'=>'require|max:255',
- 'goodName|商品名称'=>'require|max:255',
- 'unit|商品单位'=>'require|max:255',
- 'num|商品数量'=>'require|integer',
- 'goodPrice|商品单价'=>'require|float',
- 'totalPrice|商品总价'=>'require|float',
- 'cat_code|商品分类代码'=>'require|max:255',
- 'cat_name|商品分类名称'=>'require|max:255',
- 'tax|税率或税费'=>'require|float',
- 'inv_fee|发票费用'=>'float',
- 'inv_seller_code|发票卖方代码'=>'max:255',
- 'inv_seller_name|发票卖方名称'=>'max:255',
- 'inv_buyer_code|发票买方代码'=>'max:255',
- 'inv_buyer_name|发票买方名称'=>'max:255',
- 'inv_number|发票编号'=>'max:255',
- 'inv_type|发票类型'=>'max:255',
- 'inv_item_id|发票项目ID'=>'integer',
- 'inv_good_name|发票商品名称'=>'max:255',
- 'inv_cat_code|发票商品分类代码'=>'max:255',
- 'inv_spec|发票商品规格'=>'max:255',
- 'inv_unit|发票商品单位'=>'max:255',
- 'inv_num|发票商品数量'=>'integer',
- 'inv_subprice|发票商品子项单价'=>'float',
- 'inv_subtotal|发票商品子项总价'=>'float',
- 'inv_tax|发票税额'=>'float',
- 'inv_tax_total|发票总税额'=>'float',
- 'inv_price|发票单价'=>'float',
- 'inv_total|发票总价'=>'float',
- 'cat_diff|分类差异'=>'integer',
- 'tax_diff|税费差异'=>'integer',
- 'remark|备注'=>'max:255',
- ]);
- }
- }
|