|
@@ -56,11 +56,9 @@ class FinancialManager extends Base{
|
|
|
'tax_diff'=>'int',//税费差异
|
|
|
'remark'=>'string',//备注或说明
|
|
|
'error_remark'=>'string',//备注或说明
|
|
|
- 'status'=>'int',//1 待处理 2 正常 3计提 4 异常
|
|
|
+ 'status'=>'int',//1 待处理 2 正常 3计提 4 异常 5 取消数据
|
|
|
'balance_num'=>'decimal',//库存数量
|
|
|
'total_num'=>'decimal',//总库存数量,
|
|
|
- 'check_fee'=>'decimal',
|
|
|
- 'is_checkOrder'=>'int',
|
|
|
'fz_date'=>'varchar',
|
|
|
'apply_id'=>'int',
|
|
|
'apply_name'=>'string',
|
|
@@ -74,7 +72,7 @@ class FinancialManager extends Base{
|
|
|
public static $ManagerType=[1=>'入库',2=>'出库',3=>'入库红冲',4=>'出库红冲'];
|
|
|
public static $ManagerSource=[1=>'结算',2=>'线下订单'];
|
|
|
public static $PlatformType=[1=>'ToB',2=>'ToC'];
|
|
|
- public static $StatusCn=[1=>'待处理',2=>'正常',3=>'计提',4=>'异常'];
|
|
|
+ public static $StatusCn=[1=>'待处理',2=>'正常',3=>'计提',4=>'异常' ,5=>'取消数据'];
|
|
|
|
|
|
public function ProductRela(){
|
|
|
return $this->hasMany(ManagerProduct::class,'manager_id','id');
|
|
@@ -116,35 +114,6 @@ class FinancialManager extends Base{
|
|
|
$temp['status'] = 0;
|
|
|
return $temp;
|
|
|
},$data['idArr']);
|
|
|
-// self::startTrans();
|
|
|
-// try{
|
|
|
-// if($data['inv_num']==0) throw new \Exception('发票商品数量不能为0');
|
|
|
-// if($data['type']==1){
|
|
|
-// $product= $this->inProduct($data);
|
|
|
-// $data['error_remark'] = $data['balance_num']!='0'?'入库数量不正确':'';
|
|
|
-// }
|
|
|
-// if($data['type']==2){
|
|
|
-// $product= $this->outProduct($data);
|
|
|
-// $data['error_remark'] = $data['balance_num']!='0'?'出库数量不正确':'';
|
|
|
-// }
|
|
|
-// if($data['balance_num']!=$data['total_num'] && $data['balance_num']!='0') throw new \Exception($data['error_remark']);
|
|
|
-// $data['status']=$data['balance_num']==$data['total_num']?1:2;
|
|
|
-// self::commit();
|
|
|
-// }catch (\Exception $e){
|
|
|
-// self::rollback();
|
|
|
-// if(!empty($data['idArr'])) $product=array_map(function ($item) use($data){
|
|
|
-// $temp=[];
|
|
|
-// $temp['product_id']=$item['id'];
|
|
|
-// $temp['type']=$data['type'];
|
|
|
-// $temp['num']=$item['num'];
|
|
|
-// $temp['apply_id'] = $data['apply_id'];
|
|
|
-// $temp['apply_name'] = $data['apply_name'];
|
|
|
-// $temp['status'] = 0;
|
|
|
-// return $temp;
|
|
|
-// },$data['idArr']);
|
|
|
-// $data['status'] =4;
|
|
|
-// $data['error_remark'] = $e->getMessage();
|
|
|
-// }
|
|
|
$info=$this->create($data);
|
|
|
if($info->isEmpty()) throw new \Exception('添加失败');
|
|
|
if (isset($product)) ManagerProduct::AddProduct($info->id,$product);
|
|
@@ -326,34 +295,6 @@ class FinancialManager extends Base{
|
|
|
$temp['status'] = 0;
|
|
|
return $temp;
|
|
|
},$data['idArr']);
|
|
|
-// self::startTrans();
|
|
|
-// try{
|
|
|
-// if($data['type']==1){
|
|
|
-// $product=$this->inProduct($data);
|
|
|
-// $data['error_remark'] = $data['balance_num']!='0'?'入库数量不正确':'';
|
|
|
-// }
|
|
|
-// if($data['type']==2){
|
|
|
-// $product=$this->outProduct($data);
|
|
|
-// $data['error_remark'] = $data['balance_num']!='0'?'出库数量不正确':'';
|
|
|
-// }
|
|
|
-// if($data['balance_num']!=$data['total_num'] && $data['balance_num']!='0') throw new \Exception($data['error_remark']);
|
|
|
-// $data['status']=$data['balance_num']==$data['total_num']?1:2;
|
|
|
-// self::commit();
|
|
|
-// }catch (\Exception $e){
|
|
|
-// self::rollback();
|
|
|
-// if(!empty($data['idArr'])) $product=array_map(function ($item) use($data){
|
|
|
-// $temp=[];
|
|
|
-// $temp['product_id']=$item['id'];
|
|
|
-// $temp['type']=$data['type'];
|
|
|
-// $temp['num']=$item['num'];
|
|
|
-// $temp['apply_id'] = $data['apply_id'];
|
|
|
-// $temp['apply_name'] = $data['apply_name'];
|
|
|
-// $temp['status'] = 0;
|
|
|
-// return $temp;
|
|
|
-// },$data['idArr']);
|
|
|
-// $data['status'] =4;
|
|
|
-// $data['error_remark'] = $e->getMessage();
|
|
|
-// }
|
|
|
$info=$this->create($data);
|
|
|
if($info->isEmpty()) throw new \Exception('添加失败');
|
|
|
if(isset($product) && !empty($product))ManagerProduct::AddProduct($info->id,$product);
|
|
@@ -372,35 +313,7 @@ class FinancialManager extends Base{
|
|
|
$temp['status'] = 0;
|
|
|
return $temp;
|
|
|
},$data['idArr']);
|
|
|
-// self::startTrans();
|
|
|
-// try{
|
|
|
-// if($data['type']==1){
|
|
|
-// $product=$this->inProduct($data);
|
|
|
-// $data['error_remark'] = $data['balance_num']!='0'?'入库数量不正确':'';
|
|
|
-// }
|
|
|
-// if($data['type']==2){
|
|
|
-// $product=$this->outProduct($data);
|
|
|
-// $data['error_remark'] = $data['balance_num']!='0'?'出库数量不正确':'';
|
|
|
-// }
|
|
|
-// if($data['balance_num']!=$data['total_num'] && $data['balance_num']!='0') throw new \Exception($data['error_remark']);
|
|
|
-// $data['status']=$data['balance_num']==$data['total_num']?1:2;
|
|
|
-// self::commit();
|
|
|
-// }catch (\Exception $e){
|
|
|
-// self::rollback();
|
|
|
-// if(!empty($data['idArr'])) $product=array_map(function ($item) use($data){
|
|
|
-// $temp=[];
|
|
|
-// $temp['product_id']=$item['id'];
|
|
|
-// $temp['type']=$data['type'];
|
|
|
-// $temp['num']=$item['num'];
|
|
|
-// $temp['apply_id'] = $data['apply_id'];
|
|
|
-// $temp['apply_name'] = $data['apply_name'];
|
|
|
-// $temp['status'] = 0;
|
|
|
-// return $temp;
|
|
|
-// },$data['idArr']);
|
|
|
-// $data['status'] =4;
|
|
|
-// $data['error_remark'] = $e->getMessage();
|
|
|
-// }
|
|
|
- $info=$this->create($data);
|
|
|
+ $info=$this->create($data);
|
|
|
if($info->isEmpty()) throw new \Exception('添加失败');
|
|
|
if(isset($product) && !empty($product))ManagerProduct::AddProduct($info->id,$product);
|
|
|
}
|