汇总bug修正

master
zhengyongxing 4 years ago
parent b4bdcd24fc
commit 4210bb7bf0

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

@ -152,7 +152,26 @@ 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;
} else if ($company_info['collection'] == 2) {
$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);
$this->assign('first_channel_id',$company_info['first_company_id']);
$this->assign('second_company_id',$company_info['second_company_id']);
$statement_info = json_decode($info['statement_info'],true);
$this->assign('company_info',$company_info);
@ -198,7 +217,7 @@ 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("channel_id id,second_party_info")->where("id={$id}")->find();
$data = array();
$data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select();
@ -215,9 +234,10 @@ class AggregateFinanceStatementController extends ThinkController
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();
}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("channel_id={$CompanyId}")->find();
$info = json_decode($cpCompany['second_party_info'],true);
$relation = M("company_relation","tab_")->where("first_company_id={$cpCompany['channel_id']} or second_company_id = {$cpCompany['channel_id']}")->find();
// $info['link_man'] = $info['connection_person'];
// $info['link_phone'] = $info['phone'];
// $info['address'] = $info['send_address'];
@ -227,8 +247,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'] = "增值税专用发票";
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{
@ -504,7 +535,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(
@ -517,13 +548,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(
@ -781,7 +813,7 @@ class AggregateFinanceStatementController extends ThinkController
$optist = ["viewStatement","cancelVerify","addRemark","viewRemark","editRemark"];
break;
case '0':
$optist = ["viewStatement","createStatement"];
$optist = ["viewStatement"];
break;
case '1':
$optist = ["viewStatement","editStatement","cancelApply"];
@ -802,7 +834,7 @@ class AggregateFinanceStatementController extends ThinkController
$optist = ["viewStatement","addRemark","viewRemark","editRemark"];
break;
case "7":
$optist = ["viewStatement"];
$optist = ["viewStatement","createStatement"];
break;
default:
break;

@ -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;
@ -618,6 +634,7 @@
TPLSHOW.secondPartInfo(data.success);
})
})
//生成订单
// $("#getSpendStatement").on("click",function(){
// //获取开始结束时间
@ -760,6 +777,7 @@
// TPLSHOW.showStatementList(true);
})
$(".select_gallery").select2();
}
}
var CHECK = {
@ -846,6 +864,11 @@
$("#statement_type").html(str);
EVENT.changeStatementType();
}
var pay_company_id = "{$pay_company_id}";
console.log(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(){

@ -289,7 +289,7 @@
$("#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();
@ -331,7 +331,7 @@
$("#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();
@ -372,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") != 7){
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);
});

Loading…
Cancel
Save