Merge branch 'feature/add_item' of wmtx/platform into master

聚合重新汇总bug修正
master
廖金灵 4 years ago committed by Gogs
commit 004f641d60

@ -178,7 +178,7 @@ class AggregateFinanceSetController extends Controller {
}
$v['pay_type'] = $pay_type;
$v['verify_status'] = 3;
$v['verify_status'] = 0;
}
$Aggregate->add($v);
}
@ -311,7 +311,7 @@ class AggregateFinanceSetController extends Controller {
$v['pay_type'] = $pay_type;
$v['verify_status'] = 3;
$v['verify_status'] = 0;
}
// } else {
// $v['second_party_info'] =

@ -8,15 +8,17 @@ namespace Admin\Controller;
class AggregateFinanceStatementController extends ThinkController
{
public $verify_status = [
"-4"=>"汇总审批拒绝",
"-3"=>"撤销汇总",
"-1"=>"审批拒绝",
"0"=>"未申请开票",
"0"=>"未审批",
"1"=>"申请开票",
"2"=>"审批同意",
"3"=>"已开票",
"4"=>"已上传凭证",
"5"=>"已到账",
"6"=>"已汇总",
"7"=>"汇总审批同意",
];
public $admininfo;
public $OpAuthList=[];
@ -110,8 +112,12 @@ class AggregateFinanceStatementController extends ThinkController
$data[$key]['withdraw_type_1'] = ($value['withdraw_type'] == 1 ? "月结" :"周结");
$data[$key]['withdraw_type_2'] = ($value['withdraw_type'] == 2 ? "补点" :"正常结算");
$data[$key]['detail'] = json_decode($value['detail'],true);
$data[$key]['oplist'] = $this->OpAuth($value);
}
// dump($data);die();
$count = M("aggregate_statement","tab_")->field("count(id) count,SUM(ratio_money) ratio_money")->where($map)->find();
$map['withdraw_type'] = ["NEQ",2];
$pay_money_count = M("aggregate_statement","tab_")->field("SUM(pay_money) pay_money")->where($map)->find()['pay_money'];
@ -146,7 +152,29 @@ class AggregateFinanceStatementController extends ThinkController
}
$info = M("aggregate_statement","tab_")->field("statement_info,pay_money,ratio_money,channel_id")->where("id={$id}")->find();
$company_info = M("company_relation","tab_")->field("first_company_id,second_company_id,first_company_type")->where("first_company_id={$info['channel_id']} or second_company_id={$info['channel_id']}")->find();
$company_info = M("company_relation","tab_")->field("first_company_id,second_company_id,first_company_type,collection")->where("first_company_id={$info['channel_id']} or second_company_id={$info['channel_id']}")->find();
if($company_info['first_company_type'] == 3) {
$first_partner_type = 1;
} else {
$first_partner_type = 0;
}
$this->setAggregateDetail(2,1,'申请开票',$id);
if ($company_info['collection'] == 1) {
$pay_company_id = 0;
$this->assign('first_channel_id',$id);
$this->assign('second_company_id',$id);
} else if ($company_info['collection'] == 2) {
$this->assign('first_channel_id',$id);
$this->assign('second_company_id',$id);
$pay_company_id = 1;
}
// dump($pay_company_id);die();
$this->assign("pay_company_id",$pay_company_id);
$this->assign('first_partner_type',$first_partner_type);
$statement_info = json_decode($info['statement_info'],true);
$this->assign('company_info',$company_info);
@ -165,6 +193,15 @@ class AggregateFinanceStatementController extends ThinkController
$this->error("参数错误");
}
if (!$_REQUEST['first_party_info']['id']&&!$_REQUEST['first_partner_type']) {
$this->error("编辑失败,聚合公司绑定关系未添加,请添加公司绑定关系后重算");
}
if ($_REQUEST['is_edit']) {
$verify_status = 0;
} else {
$verify_status = 1;
}
//拼凑数据
$adddata = array(
"pay_money"=>$data_count['pay_money'],
@ -175,9 +212,10 @@ class AggregateFinanceStatementController extends ThinkController
"statement_info"=>json_encode($statement_info,JSON_UNESCAPED_UNICODE),
"admin_name"=>$admininfo['username'],
"admin_id"=>$admininfo['uid'],
"verify_status"=>1,
"verify_status"=>$verify_status,
"create_time"=>time()
);
$id = $_REQUEST['statement_id'];
$res = M("aggregate_statement","tab_")->where("id = '{$id}'")->save($adddata);
if($res !== false){
@ -192,11 +230,15 @@ class AggregateFinanceStatementController extends ThinkController
public function getCompanyList()
{
$id = $_REQUEST['id'];
$cpCompany = M("aggregate_statement","tab_")->field("id,second_party_info")->where("id={$id}")->find();
$cpCompany = M("aggregate_statement","tab_")->field("id,first_party_info,second_party_info")->where("id={$id}")->find();
$data = array();
$data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select();
$data['cpCompany']= [[
// $data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select();
$data['ptCompany']=[[
"id"=> $cpCompany['id'],
"partner"=>json_decode($cpCompany['first_party_info'],true)['partner']
]];
$data['cpCompany']= [[
"id"=> $cpCompany['id'],
"partner"=>json_decode($cpCompany['second_party_info'],true)['partner']
]];
@ -207,11 +249,16 @@ class AggregateFinanceStatementController extends ThinkController
$CompanyId = $_REQUEST['company_id'];
$company_type = $_REQUEST['company_type'];
if($company_type == 'pt'){
$info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find();
// $info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find();
$cpCompany = M("aggregate_statement","tab_")->field("channel_id id,first_party_info,channel_id")->where("id={$CompanyId}")->find();
$info = json_decode($cpCompany['first_party_info'],true);
}else{
$cpCompany = M("aggregate_statement","tab_")->field("id,second_party_info")->where("id={$CompanyId}")->find();
$cpCompany = M("aggregate_statement","tab_")->field("channel_id id,second_party_info,channel_id")->where("id={$CompanyId}")->find();
$info = json_decode($cpCompany['second_party_info'],true);
// $relation = M("company_relation","tab_")->where("(first_company_id={$cpCompany['channel_id']} and first_company_type=3) or (second_company_id = {$cpCompany['channel_id']} and first_company_type=3)")->find();
// $info['link_man'] = $info['connection_person'];
// $info['link_phone'] = $info['phone'];
// $info['address'] = $info['send_address'];
@ -221,8 +268,19 @@ class AggregateFinanceStatementController extends ThinkController
// $info['bank_account'] = $info['bank_card'];
// $info['company_tax_no'] = $info['tax_identification_number'];
}
$info['invoice_item'] = "信息技术服务费";
$info['invoice_type'] = "增值税专用发票";
// $info['invoice_item'] = "信息技术服务费";
// $info['invoice_type'] = "增值税专用发票";
//
// if ($relation['invoice_type'] == 1) {
// $info['invoice_type'] = "专票";
// } else if($relation['invoice_type'] == 2) {
// $info['invoice_type'] = "普票";
// }
// if($relation['invoice_content']) {
// $info['invoice_item'] = $relation['invoice_content'];
// }
if(empty($info)){
$this->ajaxReturn(array("error"=>"no find","code"=>2000));
}else{
@ -253,7 +311,8 @@ class AggregateFinanceStatementController extends ThinkController
"first_party_info"=>$first_party_info,
"second_party_info"=>$second_party_info,
"statement_info"=>$statement_info,
"statement_count"=>array("pay_money"=>$dbres['pay_money'],"ratio_money"=>$dbres['ratio_money'])
"statement_count"=>array("pay_money"=>$dbres['pay_money'],"ratio_money"=>$dbres['ratio_money']),
"is_edit"=>1,
);
$this->assign("data",$senddata);
@ -400,7 +459,22 @@ class AggregateFinanceStatementController extends ThinkController
//审批通过
public function agreeApply(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$aggregate_statement = M("aggregate_statement","tab_")->where("id in ({$ids})")->select();
foreach($aggregate_statement as $key => $value) {
if (!$value['first_party_info']) {
$this->ajaxReturn(array(
'status' => 1,
"info"=>"审批失败,聚合公司绑定关系未添加,请添加公司绑定关系后重算"
));
}
}
$savedata = ["verify_status"=>2,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata);
@ -418,6 +492,20 @@ class AggregateFinanceStatementController extends ThinkController
public function refuseApply(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$aggregate_statement = M("aggregate_statement","tab_")->where("id in ({$ids})")->select();
foreach($aggregate_statement as $key => $value) {
if (!$value['first_party_info']) {
$this->ajaxReturn(array(
'status' => 1,
"info"=>"审批失败,存在没有绑定关系的对账单,请绑定关系后重算"
));
}
}
$savedata = ["verify_status"=>-1,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id in ({$ids})")->save($savedata);
@ -431,8 +519,10 @@ class AggregateFinanceStatementController extends ThinkController
"info"=>"审批拒绝成功"
));
}
//已开票
public function Invoiced(){
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$savedata = ["verify_status"=>3,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
@ -440,6 +530,7 @@ class AggregateFinanceStatementController extends ThinkController
$ids = explode(",",$ids);
foreach($ids as $k=>$v){
$this->setAggregateDetail(2,1,'已开票',$v);
$this->doAddOperationLog($v,"已开票");
}
@ -457,9 +548,10 @@ class AggregateFinanceStatementController extends ThinkController
$ids = explode(",",$ids);
foreach($ids as $k=>$v){
$this->setAggregateDetail(3,1,'已到账',$v);
$this->doAddOperationLog($id,"已到账");
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"已到账成功"
@ -471,13 +563,16 @@ class AggregateFinanceStatementController extends ThinkController
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = explode(",",$_REQUEST['ids']);
foreach ($ids as $k => $v) {
$res = A("AggregateFinanceSet")->updateAggregateFinanceData($v);
if(!$res){
$this->ajaxReturn(array(
'status' => 0,
"info"=>"重算结算金额失败"
));
}else{
M("aggregate_statement","tab_")->where(['id'=>$v])->save(['detail'=>'']);
$this->doAddOperationLog($v,"重算结算金额");
}
}
@ -491,7 +586,7 @@ class AggregateFinanceStatementController extends ThinkController
public function cancelVerify(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$savedata = ["verify_status"=>1,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
$savedata = ["verify_status"=>0,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
M("aggregate_statement","tab_")->where("id ='{$id}'")->save($savedata);
$this->doAddOperationLog($id,"撤销审核");
$this->ajaxReturn(array(
@ -504,13 +599,14 @@ class AggregateFinanceStatementController extends ThinkController
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$data = M("aggregate_statement","tab_")->where("id = '{$id}'")->find();
$savedata = ["verify_status"=>0,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
$savedata = ["verify_status"=>7,"create_time"=>time(),"admin_name"=>$this->admininfo["username"],"admin_id"=>$this->admininfo["uid"]];
$first_party_info = json_decode($data['first_party_info'], 1);
if($first_party_info['partner'] == $data['channel_name']){
$savedata['second_party_info'] = $data['first_party_info'];
$savedata['first_party_info'] = $data['second_party_info'];
$savedata['pay_type'] =0;
}
$this->setAggregateDetail(2,0,'撤销申请',$id);
M("aggregate_statement","tab_")->where("id ='{$id}'")->save($savedata);
$this->doAddOperationLog($id,"撤销申请");
$this->ajaxReturn(array(
@ -758,17 +854,20 @@ class AggregateFinanceStatementController extends ThinkController
//操作对应菜单
$optist = [];
switch ($info['verify_status']) {
case '-4':
$optist = ["viewStatement"];
break;
case '-3':
$optist = ["viewStatement","editStatement","addRemark","viewRemark","editRemark"];
$optist = ["viewStatement","addRemark","viewRemark","editRemark"];
break;
case '-1':
$optist = ["viewStatement","cancelVerify","addRemark","viewRemark","editRemark"];
break;
case '0':
$optist = ["viewStatement","createStatement"];
$optist = ["viewStatement","editStatement"];
break;
case '1':
$optist = ["viewStatement","editStatement","cancelApply"];
$optist = ["viewStatement","cancelApply"];
break;
case '2':
$optist = ["viewStatement","cancelVerify","addRemark","viewRemark","editRemark"];
@ -785,6 +884,9 @@ class AggregateFinanceStatementController extends ThinkController
case "6":
$optist = ["viewStatement","addRemark","viewRemark","editRemark"];
break;
case "7":
$optist = ["viewStatement","createStatement"];
break;
default:
break;
}
@ -836,6 +938,7 @@ class AggregateFinanceStatementController extends ThinkController
}
}
}
return $resarr;
}
//操作日志
@ -906,6 +1009,7 @@ class AggregateFinanceStatementController extends ThinkController
$Pool = M("aggregate_statement_pool","tab_");
$Statemen = M("aggregate_statement","tab_");
foreach ($datas as $k => $v) {
if(count($v['company_list']) <= 0){continue;}
$v['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
//保存公司信息
@ -913,7 +1017,10 @@ class AggregateFinanceStatementController extends ThinkController
foreach ($company_list as $ke => $va) {
$this->addStatementInfo($va,$k,$v);
}
$get_statement_ids = $v['statement_ids'];
foreach ($get_statement_ids as $key => $value) {
$this->setAggregateDetail(0,1,'已汇总',$value);
}
if(empty($v['create_lack_ids']) && empty($v['del_lack_ids']) && empty($v['info_ids'])){ continue;}
$v['statement_ids'] = implode(",",$v['statement_ids']);
@ -925,8 +1032,8 @@ class AggregateFinanceStatementController extends ThinkController
unset($v['company_list']);
if($v['statement_money'] == 0){
$v['verify_status'] = 5;
$v['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y-m-d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y-m-d H:i:s")]);
// $v['verify_status'] = 5;
// $v['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y-m-d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y-m-d H:i:s")]);
}
//判断周月结
if(($v["statement_end_time"]-$v['statement_begin_time']) > 7*24*3600){
@ -935,9 +1042,14 @@ class AggregateFinanceStatementController extends ThinkController
$v["withdraw_type"] = 0;
}
$pool_id = $Pool->add($v);
if($pool_id == false){
$this->ajaxReturn(array('status' => 0,"info"=>"汇总失败"));
}
if(!empty($info)){
$save["pool_id"]=$pool_id;
M("aggregate_statement_info","tab_")->where("id in ({$info})")->save($save);
@ -1144,5 +1256,30 @@ class AggregateFinanceStatementController extends ThinkController
M("aggregate_statement","tab_")->save($v);
}
}
//type 0 汇总 1 审批 2 开票 3 到账
public function setAggregateDetail($type=0, $status = 1,$detail_info = "",$id = 0) {
$data = M("aggregate_statement","tab_")->where(['id'=>$id])->find();
$detail['detail'] = json_decode($data['detail'],true);
$adminInfo = $_SESSION['onethink_admin']['user_auth'];
if ($type == 0) {
$detail['detail']['pool'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['pool_status'] = $status;
} else if($type == 1) {
$detail['detail']['apply'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['apply_status'] = $status;
} else if($type == 2) {
$detail['detail']['invoiced'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['invoiced_status'] = $status;
} else if($type == 3) {
$detail['detail']['received'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['received_status'] = $status;
}
M("aggregate_statement","tab_")->where(['id'=>$id])->save(['detail'=>json_encode($detail['detail'])]);
}
}

@ -285,7 +285,9 @@ class AggregateStatementLackController extends ThinkController
//设定组合的子操作
protected function setDf(&$savedata,$v)
{
$savedata['del_lack_ids'][] = $v['id'];
$savedata['withdraw_type'] = $v['withdraw_type'];
unset($v['id']);
$v['statement_info'] = json_decode( $v['statement_info'],true);
$fine = $v['fine'];
@ -313,10 +315,11 @@ class AggregateStatementLackController extends ThinkController
"fine"=>$fine,
"reward"=>$reward,
"statement_info"=>$v['statement_info'],
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5)
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5),
];
$savedata['company_list'][$v['company_id']] = $tdata;
}
// $savedata['fine'] += $v['fine'];
// $savedata['reward'] += $v['reward'];
// $savedata['pay_amount'] += $v['pay_amount'];

@ -440,12 +440,55 @@ class AggregateStatementPoolController extends ThinkController
}
//type 0 汇总 1 审批 2 开票 3 到账
public function setAggregateDetail($type=0, $status = 1,$detail_info = "",$id = 0) {
$data = M("aggregate_statement","tab_")->where(['id'=>$id])->find();
$detail['detail'] = json_decode($data['detail'],true);
$adminInfo = $_SESSION['onethink_admin']['user_auth'];
if ($type == 0) {
$detail['detail']['pool'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['pool_status'] = $status;
} else if($type == 1) {
$detail['detail']['apply'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['apply_status'] = $status;
if ($status == 1) {
$verify_status = 7;
} else {
$verify_status = -4;
}
M("aggregate_statement","tab_")->where(['id'=>$id])->save(['verify_status'=>$verify_status]);
} else if($type == 2) {
$detail['detail']['invoiced'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['invoiced_status'] = $status;
} else if($type == 3) {
$detail['detail']['received'] = $detail_info."({$adminInfo["username"]})".date("Y-m-d H:i:s");
$detail['detail']['received_status'] = $status;
}
M("aggregate_statement","tab_")->where(['id'=>$id])->save(['detail'=>json_encode($detail['detail'])]);
}
protected function setVerifyStatus($old_status,$change_status,$op_pre)
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
$dbres = $this->DBModel->field("id,verify_status,verify_log,statement_ids")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){
$get_statement_ids = explode(',',$v['statement_ids']);
foreach ($get_statement_ids as $key => $value) {
$this->setAggregateDetail(1,$change_status==1?1:0,$change_status==1?'审批通过':'审批拒绝',$value);
}
if($v['verify_status'] != $old_status) continue;
$v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
@ -671,6 +714,7 @@ class AggregateStatementPoolController extends ThinkController
"is_payment"=>$pool['is_payment'],
"statement_pool_num"=>$pool['statement_num'],
"statement_info"=>$v['statement_info'],
"withdraw_type"=>$pool['withdraw_type'],
];
$l_id = M("aggregate_lack_statement_info","tab_")->add($lackcompany);
@ -815,17 +859,29 @@ class AggregateStatementPoolController extends ThinkController
M()->rollback();
$this->ajaxReturn(array('status' => 0,"info"=>"撤销汇总失败"));
}
//删除自己
$poolres = $this->DBModel->where("id = {$info['id']}")->delete();
if($poolres === false){
M()->rollback();
$this->ajaxReturn(array('status' => 0,"info"=>"撤销汇总失败"));
}
//修改结算单信息
$st_res = M("aggregate_statement","tab_")->field("id,verify_status")->where("id in ({$sids})")->select();
foreach($st_res as $k=>&$v){
if ($v['verify_status'] == 5) {
M()->rollback();
$this->ajaxReturn(array('status' => 0,"info"=>"拥有已到账的结算单,不能撤销汇总"));
}
$v['verify_status']=-3;
$v['detail']="";
$stres = M("aggregate_statement","tab_")->save($v);
if($stres === false){
M()->rollback();
$this->ajaxReturn(array('status' => 0,"info"=>"撤销汇总失败"));

@ -95,8 +95,8 @@
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_type" name="first_partner_type" class="select_gallery">
<option value="">请选择甲方公司类型</option>
<option value="0">合作公司</option>
<option value="1">平台归属公司</option>
<option value="0" <if condition="$first_partner_type eq 1">selected</if>>合作公司</option>
<option value="1" <if condition="$first_partner_type eq 0">selected</if>>平台归属公司</option>
</select>
</div>
</td>
@ -429,7 +429,9 @@
</tr>
</script>
<script>
$(function(){
TPLSHOW.juicerInit();
$(".select_gallery").select2();
$('#time_start').datetimepicker({
@ -573,14 +575,26 @@
}
$("#first_partner_id").select2();
$("#second_partner_id").select2();
var first_company_id = "{$first_channel_id}";
// $('#first_partner_id').val(first_company_id);
$('#first_partner_id').find('option[value='+first_company_id+']').prop('selected',true);
var second_company_id = "{$second_company_id}";
// $("#second_partner_id").val(second_company_id);
$('#second_partner_id').find('option[value='+second_company_id+']').prop('selected',true);
$("#first_partner_id").change();
$("#second_partner_id").change();
//重置数据
DATAOBJ.first_part_company=false;
DATAOBJ.second_part_company=false;
TPLSHOW.pushStatementTypeOption();
})
})
});
$("#first_partner_type").change();
$("#first_partner_id").on("change",function(){
//获取数据
var comid = $(this).find("option:selected").val();
//获取基础数据
@ -598,10 +612,12 @@
data.success.type = "first_party_info";
TPLSHOW.firstPartInfo(data.success);
})
})
});
$("#second_partner_id").on("change",function(){
//获取数据
var comid = $(this).find("option:selected").val();
//获取基础数据
var url = "{:U('getCpCompanyInfo')}";
var company_type;
@ -611,13 +627,16 @@
}else{
company_type = "cp";
}
console.log(comid)
PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
DATAOBJ.second_part_company = data.success.partner;
DATAOBJ.second_party_info = data.success;
data.success.type = "second_party_info";
TPLSHOW.secondPartInfo(data.success);
})
})
//生成订单
// $("#getSpendStatement").on("click",function(){
// //获取开始结束时间
@ -760,6 +779,7 @@
// TPLSHOW.showStatementList(true);
})
$(".select_gallery").select2();
}
}
var CHECK = {
@ -846,6 +866,11 @@
$("#statement_type").html(str);
EVENT.changeStatementType();
}
var pay_company_id = "{$pay_company_id}";
// $("#second_partner_id").val(second_company_id);
$('#statement_type').find('option[value='+pay_company_id+']').prop('selected',true);
$("#statement_type").change();
},
//支付信息显示
showPartPayInfo(){
@ -874,7 +899,7 @@
showStatementList(flag){
if(flag){
var data = {list:DATAOBJ.statement_info,count:DATAOBJ.statement_count,fine:DATAOBJ.fine};
console.log(DATAOBJ);
$("#statementInit").addClass("hidebox");
var tpl =$("#statementTpl").html();
var html = juicer(tpl, data);

@ -684,7 +684,7 @@
window.parent.reload();
},350);
}else{
alert("添加失败,请联系管理员")
alert(data.info)
}
});
//发送添加请求

@ -49,7 +49,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">聚合渠道结算单管理</h3>
<p class="description_text">流程说明:结算自动生成对账单--->发起人申请开票--->财务审批开票--->寄发票--->发起人上传收款凭证--->财务确认到账</p>
<p class="description_text">流程说明:结算自动生成对账单--->管理员审批--->发起汇总--->财务审批汇总--->申请开票--->财务确认到账</p>
</div>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
@ -135,8 +135,12 @@
<th>结算流水</th>
<th>结算金额</th>
<th>审批状态</th>
<th>操作人</th>
<th>操作时间</th>
<th>汇总状态</th>
<th>汇总审批状态</th>
<th>开票状态</th>
<th>到账状态</th>
<!-- <th>操作人</th>-->
<!-- <th>操作时间</th>-->
<th>操作</th>
</tr>
</thead>
@ -160,8 +164,12 @@
<td>{$data.pay_money}</td>
<td>{$data.ratio_money}</td>
<td>{$data.verify_status_str}</td>
<td>{$data.admin_name}</td>
<td>{$data.create_time}</td>
<td><if condition="$data['detail']['pool_status'] eq 1 or empty($data['detail']['pool']) eq TRUE">{$data['detail']['pool']|default="-------"}<else/><span style="color: red">{$data['detail']['pool']|default="-------"}</span></if></td>
<td><if condition="$data['detail']['apply_status'] eq 1 or empty($data['detail']['apply']) eq TRUE">{$data['detail']['apply']|default="-------"}<else/><span style="color: red">{$data['detail']['apply']|default="-------"}</span></if></td>
<td><if condition="$data['detail']['invoiced_status'] eq 1 or empty($data['detail']['invoiced']) eq TRUE">{$data['detail']['invoiced']|default="-------"}<else/><span style="color: red">{$data['detail']['invoiced']|default="-------"}</span></if></td>
<td><if condition="$data['detail']['received_status'] eq 1 or empty($data['detail']['received']) eq TRUE">{$data['detail']['received']|default="-------"}<else/><span style="color: red">{$data['detail']['received']|default="-------"}</span></if></td>
<!-- <td>{$data.admin_name}</td>-->
<!-- <td>{$data.create_time}</td>-->
<td>
<foreach name="data.oplist" item="vo" >
{$vo}
@ -170,7 +178,7 @@
</tr>
</volist>
<tr><td>合计</td><td colspan="10">结算总流水:{$pay_money}元(补点单据不重复计算在内)&#12288;&#12288;&#12288;&#12288;结算总金额:{$total}元 </td></tr>
<tr><td>合计</td><td colspan="12">结算总流水:{$pay_money}元(补点单据不重复计算在内)&#12288;&#12288;&#12288;&#12288;结算总金额:{$total}元 </td></tr>
</notemtpy>
</tbody>
</table>
@ -234,18 +242,18 @@
$("#pool").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") == -1||$(elem).data("status") == 0 || $(elem).data("status") == 6){
if($(elem).data("status") != 2 && $(elem).data("status") != -3){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要汇总的结算单,[审核拒绝,系统生成结算单,已汇总]状态不可以进行审批通过' + "</font>");
layer.msg("<font style='color:white'>" + '无需要汇总的结算单,[审批同意,撤销汇总]状态才进行汇总' + "</font>");
return;
}
if(flag){
layer.confirm("发起汇总不会对 [审核拒绝,系统生成结算单,已汇总] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
layer.confirm("发起汇总仅对 [审批同意,撤销汇总] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doPoolApply();
layer.close(index);
});
@ -281,18 +289,18 @@
$("#agreeApply").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") != 1){
if($(elem).data("status") != 0){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要审批通过的结算单,仅[申请发票]状态可以进行审批通过' + "</font>");
layer.msg("<font style='color:white'>" + '无需要审批通过的结算单,仅[申请发票]状态可以进行审批通过' + "</font>");
return;
}
if(flag){
layer.confirm("审批成功仅会对 [申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
layer.confirm("审批成功仅会对 [申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doAgreeApply();
layer.close(index);
});
@ -323,18 +331,18 @@
$("#refuseApply").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") != 1){
if($(elem).data("status") != 0){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要批拒绝的结算单,仅[申请发票]状态可以进行审批拒绝' + "</font>");
layer.msg("<font style='color:white'>" + '无需要批拒绝的结算单,仅[申请发票]状态可以进行审批拒绝' + "</font>");
return;
}
if(flag){
layer.confirm("审批拒绝仅会对 [申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
layer.confirm("审批拒绝仅会对 [申请发票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doRefuseApply();
layer.close(index);
});
@ -364,18 +372,18 @@
$("#Invoiced").on("click",function(){
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") != 2){
if($(elem).data("status") != 1){
flag = true;
}else{
return $(elem).val();
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行已开票的结算单,仅[审批同意]状态可以进行已开票' + "</font>");
layer.msg("<font style='color:white'>" + '无需要进行已开票的结算单,仅[申请开票]状态可以进行已开票' + "</font>");
return;
}
if(flag){
layer.confirm("已开票仅会对 [审批同意] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
layer.confirm("已开票仅会对 [申请开票] 结算单处理,选择中包含其他的状态的结算单将被忽略,点击取消停止操作",{title:false}, function(index){
_doInvoiced();
layer.close(index);
});
@ -453,7 +461,7 @@
// return $(elem).val();
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行重新结算的结算单,仅[未申请发票][申请开票][审批拒绝]状态可以进行重新结算' + "</font>");
layer.msg("<font style='color:white'>" + '无需要进行重新结算的结算单,仅[未申请发票][申请开票][审批拒绝][汇总审批撤回]状态可以进行重新结算' + "</font>");
return;
}
layer.confirm("重算结算金额会对结算单回退到未申请发票状态,请慎重处理,点击取消停止操作",{title:false}, function(index){

@ -2661,3 +2661,6 @@ CREATE TABLE `tab_promote_grade_setting` (
`update_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='推广评级设定';
ALTER TABLE `tab_aggregate_statement`
ADD COLUMN `detail` longtext NULL COMMENT '审批详情' AFTER `remark`;
Loading…
Cancel
Save