|
|
@ -118,6 +118,9 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
$v['company_type_str'] = $this->CompanyType[$v['company_type']];
|
|
|
|
$v['company_type_str'] = $this->CompanyType[$v['company_type']];
|
|
|
|
$v['is_payment_str'] = $this->IsPayment[$v['is_payment']];
|
|
|
|
$v['is_payment_str'] = $this->IsPayment[$v['is_payment']];
|
|
|
|
$v['can_export'] = $v['statement_money'] == 0 ? "0" : '1';
|
|
|
|
$v['can_export'] = $v['statement_money'] == 0 ? "0" : '1';
|
|
|
|
|
|
|
|
if($v['company_type'] == 2){
|
|
|
|
|
|
|
|
$v['can_export'] = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$v['op_time'] = date('Y-m-d H:i:s',$v['op_time']);
|
|
|
|
$v['op_time'] = date('Y-m-d H:i:s',$v['op_time']);
|
|
|
|
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
|
|
|
|
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
|
|
|
@ -201,9 +204,11 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
$is_export = true;
|
|
|
|
$is_export = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取基本信息
|
|
|
|
//获取基本信息
|
|
|
|
$infolist = M("company_statement_info","tab_")->where("pool_id = '{$id}'")->select();
|
|
|
|
$infolist = M("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select();
|
|
|
|
//获取母单
|
|
|
|
//获取母单
|
|
|
|
$statement_num = M("company_statement_pool","tab_")->field('statement_num')->where("id={$id}")->find()['statement_num'];
|
|
|
|
$statement_num =
|
|
|
|
|
|
|
|
$pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids')->where("id={$id}")->find();
|
|
|
|
|
|
|
|
$statement_num = $pool_info['statement_num'];
|
|
|
|
$this->assign("title",$statement_num);
|
|
|
|
$this->assign("title",$statement_num);
|
|
|
|
|
|
|
|
|
|
|
|
if($infolist[0]['company_type'] == 3){
|
|
|
|
if($infolist[0]['company_type'] == 3){
|
|
|
@ -213,12 +218,20 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
//下游公司
|
|
|
|
//下游公司
|
|
|
|
$this->viewPcPool($infolist,$is_export);
|
|
|
|
$this->viewPcPool($infolist,$is_export);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
|
|
|
|
//获取母单
|
|
|
|
|
|
|
|
if(!empty($pool_info['create_lack_ids'])){
|
|
|
|
|
|
|
|
$l_ids = $pool_info['create_lack_ids'];
|
|
|
|
|
|
|
|
$lack_info = M("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$infolist += $lack_info;
|
|
|
|
|
|
|
|
}
|
|
|
|
$this->viewPuPool($infolist,$is_export);
|
|
|
|
$this->viewPuPool($infolist,$is_export);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//个人汇总结算查看
|
|
|
|
//个人汇总结算查看
|
|
|
|
public function viewPuPool(&$infolist,$is_export){
|
|
|
|
public function viewPuPool(&$infolist,$is_export){
|
|
|
|
|
|
|
|
// dd($infolist);
|
|
|
|
$line = 1;
|
|
|
|
$line = 1;
|
|
|
|
$count = [];
|
|
|
|
$count = [];
|
|
|
|
//获取对接人
|
|
|
|
//获取对接人
|
|
|
@ -246,14 +259,17 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
|
|
|
|
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if($v['st'] == 1){
|
|
|
|
$count['sum_money_exp'] .= "O{$line}+";
|
|
|
|
$count['sum_money_exp'] .= "O{$line}+";
|
|
|
|
$count['platform_amount_exp'] .= "J{$line}+";
|
|
|
|
$count['platform_amount_exp'] .= "J{$line}+";
|
|
|
|
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
|
|
|
|
if($v['st'] == 1){
|
|
|
|
$count['platform_amount'] += $va['pay_amount'];
|
|
|
|
$count['platform_amount'] += $va['pay_amount'];
|
|
|
|
$count['sum_money'] += $va['sum_money'];
|
|
|
|
$count['sum_money'] += $va['sum_money'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
$v['statement_count'] = count($v['statement_info']);
|
|
|
|
$v['statement_count'] = count($v['statement_info']);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -868,7 +884,7 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//
|
|
|
|
//
|
|
|
|
if($info['platform_amount'] <= 0){
|
|
|
|
if($info['platform_amount'] <= 0 && $info['company_type'] != 2){
|
|
|
|
$optist = array_diff($optist, ["viewPool"]);
|
|
|
|
$optist = array_diff($optist, ["viewPool"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//个人重算,上游撤销
|
|
|
|
//个人重算,上游撤销
|
|
|
|