|
|
|
@ -655,6 +655,62 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
|
'info' => "删除成功"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
//不结算
|
|
|
|
|
public function cancelStatement()
|
|
|
|
|
{
|
|
|
|
|
if(!isset($_REQUEST['id'])) $this->error("参数错误");
|
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
|
//获取结算信息
|
|
|
|
|
$v = M("company_statement_info","tab_")->where("id = '{$id}'")->find();
|
|
|
|
|
if(empty($v)){
|
|
|
|
|
$this->error("请勿重复操作");
|
|
|
|
|
}
|
|
|
|
|
$pool = M("company_statement_pool","tab_")->where("id = {$v['pool_id']}")->find();
|
|
|
|
|
// dump($pool);
|
|
|
|
|
//保存未结算
|
|
|
|
|
$lackcompany =[
|
|
|
|
|
"company_id"=>$v['company_id'],
|
|
|
|
|
"company_type"=>$v['company_type'],
|
|
|
|
|
"company_name"=>$v['company_name'],
|
|
|
|
|
"company_info"=>$v['company_info'],
|
|
|
|
|
"statement_money"=>$v['statement_money'],
|
|
|
|
|
"pay_amount"=>$v['pay_amount'],
|
|
|
|
|
"platform_amount"=>$v['platform_amount'],
|
|
|
|
|
"fine"=>$v['fine'],
|
|
|
|
|
"reward"=>$v['reward'],
|
|
|
|
|
"statement_begin_time"=>$v['statement_begin_time'],
|
|
|
|
|
"statement_end_time"=>$v['statement_end_time'],
|
|
|
|
|
"is_payment"=>$pool['is_payment'],
|
|
|
|
|
"statement_pool_num"=>$pool['statement_num'],
|
|
|
|
|
"statement_info"=>$v['statement_info'],
|
|
|
|
|
];
|
|
|
|
|
$l_id = M("company_lack_statement_info","tab_")->add($lackcompany);
|
|
|
|
|
|
|
|
|
|
//汇总表
|
|
|
|
|
$pool_data = [
|
|
|
|
|
"id"=>$pool['id'],
|
|
|
|
|
'statement_money'=>$pool['statement_money']-$v['statement_money'],
|
|
|
|
|
'pay_amount'=>$pool['pay_amount']-$v['pay_amount'],
|
|
|
|
|
'fine'=>$pool['fine']-$v['fine'],
|
|
|
|
|
'reward'=>$pool['reward']-$v['reward'],
|
|
|
|
|
'lack_statement_money'=>$pool['lack_statement_money']+$v['statement_money'],
|
|
|
|
|
'lack_platform_amount'=>$pool['lack_platform_amount']-0+$v['platform_amount']
|
|
|
|
|
];
|
|
|
|
|
//
|
|
|
|
|
if(empty($pool_data['create_lack_ids'])){
|
|
|
|
|
$pool_data['create_lack_ids'] = $l_id;
|
|
|
|
|
}else{
|
|
|
|
|
$pool_data['create_lack_ids'] = $pool_data['create_lack_ids'].",".$l_id;
|
|
|
|
|
}
|
|
|
|
|
$info_ids = explode(",",$pool['info_ids']);
|
|
|
|
|
$pool_data['info_ids'] =implode(",",array_diff($info_ids,[$id]));
|
|
|
|
|
M("company_statement_pool","tab_")->save($pool_data);
|
|
|
|
|
M("company_statement_info","tab_")->where("id='{$id}'")->delete();
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 1,
|
|
|
|
|
"info"=>"不结算成功"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//撤销汇总
|
|
|
|
|
public function cancelPool(){
|
|
|
|
|