上下游聚合打款信息修改

master
zhengyongxing 4 years ago
parent 9000533644
commit 9265d7c9b6

@ -487,6 +487,22 @@ class CompanyStatementController extends ThinkController
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$dbres = $this->DBModel->field("*")->where("id in ({$ids})")->select();
$check = [];
$is_complement = 0;
foreach($dbres as $key => $value) {
$check[$value['withdraw_type']] = 1;
if ($value['withdraw_type'] == 3) {
$is_complement = 1;
}
}
if (count($check)>1&&$is_complement) {
$this->error("特殊补点不能与其他结算单一起汇总");
}
//分单
$basedata = [
"pay_amount"=>0,
@ -507,7 +523,7 @@ class CompanyStatementController extends ThinkController
"op_time"=>time(),
"company_list"=>[]
];
$datas = ["up","down"];
$datas = ["up","down","complement_down","complement_user"];
//初始化数据
foreach($datas as $k=>$v){
if($v =="up"){
@ -518,6 +534,14 @@ class CompanyStatementController extends ThinkController
$basedata['company_type']=1;
$basedata['is_payment']=1;
}
if($v =="complement_down") {
$basedata['company_type']=1;
$basedata['is_payment']=1;
}
if($v =="complement_user") {
$basedata['company_type']=2;
$basedata['is_payment']=1;
}
$datas[$v]=$basedata;
unset($datas[$k]);
}
@ -527,10 +551,15 @@ class CompanyStatementController extends ThinkController
if($v['company_belong'] == 9){
//上游
$this->setDf($datas['up'],$v);
}else{
} elseif($v['withdraw_type'] == 3&&$v['company_type']==1){
$this->setDf($datas['complement_down'],$v);
} elseif($v['withdraw_type'] == 3&&$v['company_type']==2){
$this->setDf($datas['complement_user'],$v);
} else {
$this->setDf($datas['down'],$v);
}
}
$Pool = M("company_statement_pool","tab_");
$Statemen = M("company_statement","tab_");
foreach ($datas as $k => $v) {
@ -561,6 +590,11 @@ class CompanyStatementController extends ThinkController
}else{
$v["withdraw_type"] = 0;
}
if ($is_complement) {
$v["withdraw_type"] = 3;
}
$pool_id = $Pool->add($v);
if($pool_id == false){
$this->ajaxReturn(array('status' => 0,"info"=>"汇总失败"));
@ -599,6 +633,9 @@ class CompanyStatementController extends ThinkController
protected function addStatementInfo($va,$k,&$v){
$StatementInfo = M("company_statement_info","tab_");
$company_info = $va['company_info'];
$LackStatement = M("company_lack_statement_info","tab_");
$no_pool_money = 300;
//统一比例字段
@ -621,9 +658,10 @@ class CompanyStatementController extends ThinkController
$is_payment = 2;
$verify_status = 2;
}
//创建基础未满基础信息
if($va['platform_amount'] < $no_pool_money){
if($va['platform_amount'] < $no_pool_money && $va['withdraw_type']!=3){
$lackcompany =[
"company_id"=>$company_info['id'],
"company_type"=>$v['company_type'],
@ -642,8 +680,15 @@ class CompanyStatementController extends ThinkController
];
}
//整合数据
$lsres = $LackStatement->where("company_id={$company_info['id']} and is_pool = 0")->select();
if ($k!='complement_down' && $k != 'complement_user') {
$lsres = $LackStatement->where("company_id={$company_info['id']} and is_pool = 0")->select();
} else {
$lsres = $LackStatement->where("company_id={$company_info['id']} and is_pool = 0 and withdraw_type = 3")->select();
}
$del_lack_ids = [];
if(count($lsres) > 0){
//进行聚合
foreach($lsres as $key=>$val){
@ -658,14 +703,18 @@ class CompanyStatementController extends ThinkController
array_multisort($last_names,SORT_DESC,SORT_STRING,$va['statement_info']);
}
}
if($va['platform_amount'] < $no_pool_money){
//依旧小于不结算金额存旧版
if($lackcompany['pay_amount'] != 0){
$lask_id = $LackStatement->add($lackcompany);
$v['create_lack_ids'][] =$lask_id;
$v['lack_statement_money'] +=$lackcompany['statement_money'];
$v['lack_platform_amount'] +=$lackcompany['platform_amount'];
if (($k!='complement_down' && $k != 'complement_user')) {
if($lackcompany['pay_amount'] != 0){
$lask_id = $LackStatement->add($lackcompany);
$v['create_lack_ids'][] =$lask_id;
$v['lack_statement_money'] +=$lackcompany['statement_money'];
$v['lack_platform_amount'] +=$lackcompany['platform_amount'];
}
}
}else{
if($va['pay_amount'] != 0){
//存成功
@ -680,13 +729,14 @@ class CompanyStatementController extends ThinkController
"statement_money"=>$va['statement_money'],
"pay_amount"=>$va['pay_amount'],
"platform_amount"=>$va['platform_amount'],
"statement_money"=>$va['statement_money'],
"statement_begin_time"=>$v['statement_begin_time'],
"statement_end_time"=>$v['statement_end_time'],
"statement_info"=>json_encode($va['statement_info'],JSON_UNESCAPED_UNICODE),
"statement_num"=>$va['statement_num'],
"verify_status"=>$verify_status
"verify_status"=>$verify_status,
"withdraw_type"=>$va['withdraw_type'],
];
$companyid = $StatementInfo->add($company);
$v['info_ids'][] =$companyid;
$v['del_lack_ids'] =array_merge($v['del_lack_ids'],$del_lack_ids);
@ -720,24 +770,43 @@ class CompanyStatementController extends ThinkController
}
}
if(isset($savedata['company_list'][$v['company_id']])){
//存在游戏合并
$a = &$savedata['company_list'][$v['company_id']];
$a['fine'] += $fine;
$a['reward'] += $reward;
$a['statement_info'] = array_merge($a['statement_info'],$v['statement_info']);
// dump($a['statement_info']);
$a['platform_amount'] += $v['platform_amount'];
$a['pay_amount'] += $v['pay_amount'];
$a['statement_money'] += $v['statement_money'];
//存在游戏合并
$a = &$savedata['company_list'][$v['company_id']];
$a['fine'] += $fine;
$a['reward'] += $reward;
$a['statement_info'] = array_merge($a['statement_info'],$v['statement_info']);
// dump($a['statement_info']);
$a['platform_amount'] += $v['platform_amount'];
$a['pay_amount'] += $v['pay_amount'];
$a['statement_money'] += $v['statement_money'];
}else{
if($v['pay_type'] == 2){
//乙方收款
$v['company_info'] =json_decode($v['second_party_info'],ture);
$v['company_info'] =json_decode($v['second_party_info'],true);
$v['company_info']['pay_type'] = 2;
}else{
$v['company_info'] = json_decode($v['first_party_info'],ture);
$v['company_info'] = json_decode($v['first_party_info'],true);
$v['company_info']['pay_type'] = 1;
}
if (isset($v['company_info']['company_type'])) {
if($v['company_info']['company_type'] == 1) {
$v['company_info']['company_type_str'] = '公司';
} elseif($v['company_info']['company_type'] == 2){
$v['company_info']['company_type_str'] = '个人';
}
}
if (isset($v['company_info']['company_belong'])) {
if($v['company_info']['company_belong'] == '0') {
$v['company_info']['company_relation_str'] = '内团';
} elseif($v['company_info']['company_belong'] == '1') {
$v['company_info']['company_relation_str'] = '外团';
}elseif($v['company_info']['company_belong'] == '2') {
$v['company_info']['company_relation_str'] = '分发联盟';
}elseif($v['company_info']['company_belong'] == '3') {
$v['company_info']['company_relation_str'] = '无';
}
}
//先分配好订单号,防止重复提交
$tdata = [
"company_info"=>$v['company_info'],
@ -749,10 +818,12 @@ class CompanyStatementController extends ThinkController
"reward"=>$reward,
"statement_info"=>$v['statement_info'],
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5),
"is_payment"=>$v['is_payment']
"is_payment"=>$v['is_payment'],
"withdraw_type"=>$v['withdraw_type'],
];
$savedata['company_list'][$v['company_id']] = $tdata;
}
// $savedata['pay_amount'] += $v['pay_amount'];
// $savedata['statement_money'] += $v['statement_money'];
// $savedata['platform_amount'] += $v['platform_amount'];
@ -1065,9 +1136,10 @@ class CompanyStatementController extends ThinkController
->where($amount_time)
->find();
$handleData[$key]['pay_amount'][$k] = $pay_amount['pay_amount']?$pay_amount['pay_amount']:0;
$handleData[$key]['pay_amount'][$k] = $pay_amount['pay_amount']?$pay_amount['pay_amount']:"0.00";
$handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * (((int)$value['ratio'][$k])/100),2,'.','');
// $handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * (((int)$value['ratio'][$k])/100),2,'.','');
$handleData[$key]['withdraw_amount'][$k] = "0.00";
foreach($turnover_ratio as $ke=>$va){
@ -1076,15 +1148,18 @@ class CompanyStatementController extends ThinkController
if($va['instanceof']=='1'&&$pay_amount['pay_amount']>=$va['turnover']){
$handleData[$key]['ratio'] = $va["ratio"];
$handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * ($va["ratio"]/100),2,'.','');
// $handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * ($va["ratio"]/100),2,'.','');
$handleData[$key]['withdraw_amount'][$k] = "0.00";
}elseif($pay_amount['pay_amount']>$va['turnover']){
$handleData[$key]['ratio'] = $va["ratio"];
$handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * ($va["ratio"]/100),2,'.','');
// $handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * ($va["ratio"]/100),2,'.','');
$handleData[$key]['withdraw_amount'][$k] = "0.00";
}
}else{
if ($pay_amount['pay_amount']>=$va['turnover']) {
$handleData[$key]['ratio'] = $va["ratio"];
$handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * ($va["ratio"]/100),2,'.','');
// $handleData[$key]['withdraw_amount'][$k] = number_format($pay_amount['pay_amount'] * ($va["ratio"]/100),2,'.','');
$handleData[$key]['withdraw_amount'][$k] = "0.00";
}
}
@ -1184,14 +1259,6 @@ class CompanyStatementController extends ThinkController
$insert['statement_money'] = $statement_money;
$insert['op_time'] = time();
if ($company_type['first_company_id'] == $value['company_id']) {
$insert['first_party_info'] = json_encode($proCompany_info);
$insert['second_party_info'] = json_encode($secord_info);
} elseif ($company_type['second_company_id'] == $value['company_id']) {
$insert['second_party_info'] = json_encode($proCompany_info);
$insert['first_party_info'] = json_encode($secord_info);
}
foreach($statement_info as $k => $v) {
$statement_info[$k]['statement_type'] = 0;
@ -1240,12 +1307,12 @@ class CompanyStatementController extends ThinkController
$game_list['pay_amount'] = $aval['pay_amount'];
$game_list['relation_game_id'] = $aval['relation_game_id'];
$game_list['game_name'] = $aval['relation_game_name'];
$game_list['game_type_name'] = $aval['relation_game_id'];
$game_list['game_type_name'] = $aval['game_type_name'];
$game_list['ratio'] = $v['ratio'];
$game_list['fax_ratio'] = $company_data['fax_ratio'];
$game_list['sum_money'] = number_format(($aval['pay_amount']*($v['ratio']+$v['increment_ratio']))/100,2,'.','');
$game_list['increment_ratio'] = $v['increment_ratio'];
$game_list['sum_money'] = number_format(($aval['pay_amount']*($v['increment_ratio']))/100,2,'.','');
$game_list['increment_ratio'] = number_format($v['increment_ratio'],2,'.','');
$game_list['statement_begin_time'] = $v['statement_begin_time'];
$game_list['statement_end_time'] = $v['statement_end_time'];
$game_list['statement_type'] = '0';
@ -1253,13 +1320,12 @@ class CompanyStatementController extends ThinkController
$statement_data[$aval['account']."-".$aval['real_name']][] = $game_list;
// $statement_insert[] = $statement_data;
}
}
foreach ($statement_data as $k => $v) {
$strKey = explode('-',$k);
$proCompany_info['nickname'] = $strKey[1];
$statement['account'] = $strKey[0];
$statement['real_name'] = $strKey[1];
$statement['game_list'] = $v;
@ -1271,11 +1337,18 @@ class CompanyStatementController extends ThinkController
}
$insert['statement_info'] = json_encode($statement_insert);
} else {
$insert['statement_info'] = json_encode($statement_info);
}
if ($company_type['first_company_id'] == $value['company_id']) {
$insert['first_party_info'] = json_encode($proCompany_info);
$insert['second_party_info'] = json_encode($secord_info);
} elseif ($company_type['second_company_id'] == $value['company_id']) {
$insert['second_party_info'] = json_encode($proCompany_info);
$insert['first_party_info'] = json_encode($secord_info);
}
$is_save = M('company_statement','tab_')->add($insert);
if (!$is_save) {
M()->rollback();
@ -1329,7 +1402,7 @@ class CompanyStatementController extends ThinkController
if ($withdraw_type == 3) {
$optist = array_diff($optist, ["editStatement"]);
}
//
$resarr = [];
foreach ($optist as $k => $v) {
if(IS_ROOT){

@ -20,7 +20,8 @@ class CompanyStatementPoolController extends ThinkController
"0"=>"周结",
"1"=>"月结",
"2"=>"下游个人补点",
"3"=>"其他",
"3"=>"特殊补点",
"4"=>"其他"
];
public $VerifyStatus=[
"-2"=>"拒绝打款",
@ -207,7 +208,7 @@ class CompanyStatementPoolController extends ThinkController
//获取基本信息
$infolist = M("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select();
//获取母单
$pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment')->where("id={$id}")->find();
$pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type')->where("id={$id}")->find();
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();
@ -223,14 +224,14 @@ class CompanyStatementPoolController extends ThinkController
$this->viewCpPool($infolist,$is_export);
}elseif($infolist[0]['company_type'] == 1){
//下游公司
$this->viewPcPool($infolist,$is_export);
$this->viewPcPool($infolist,$is_export,$pool_info['withdraw_type']);
}else{
$this->viewPuPool($infolist,$is_export);
$this->viewPuPool($infolist,$is_export,$pool_info['withdraw_type']);
}
}
//个人汇总结算查看
public function viewPuPool(&$infolist,$is_export){
public function viewPuPool(&$infolist,$is_export,$withdraw = 0){
$line = 1;
$count = [];
//获取对接人
@ -258,14 +259,21 @@ class CompanyStatementPoolController extends ThinkController
foreach($va['game_list'] as $key=>&$val){
$line ++;
if(isset($val['ratio'])){
$val['increment_ratio'] = 0;
}else{
$val['ratio'] = 0;
if($withdraw != 3) {
if(isset($val['ratio'])){
$val['increment_ratio'] = 0;
}else{
$val['ratio'] = 0;
}
}
if($is_export){
$val['sum_money'] = "=J{$line}*(K{$line}+L{$line})";
if($withdraw != 3) {
$val['sum_money'] = "=J{$line}*(K{$line}+L{$line})";
} else {
$val['sum_money'] = "=J{$line}*(L{$line})";
}
// $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})";
$v['statement_money'] .= "M{$line}+";
}else{
$count['platform_amount'] += $val['pay_amount'];
@ -289,17 +297,19 @@ class CompanyStatementPoolController extends ThinkController
$v['statement_money'] .="N{$cline}-O{$cline}";
}
}
if($is_export){
$count["platform_amount"] = "=SUM(J2:J".$line.")";
$count["sum_money"] = "=SUM(P2:P".$line.")";
}
$this->assign("data",$infolist);
$this->assign("count",$count);
$this->assign("is_export",$is_export);
$this->display("CompanyStatementPool/viewPuPool");
}
//下游汇总结算查看
public function viewPcPool(&$infolist,$is_export){
public function viewPcPool(&$infolist,$is_export,$withdraw = 0){
$line = 1;
$count = [];
//获取对接人
@ -311,7 +321,9 @@ class CompanyStatementPoolController extends ThinkController
$Partner[$v['id']] = $v['settlement_contact'];
}
unset($pl);
foreach($infolist as $k=>&$v){
$v['statement_info'] = json_decode($v['statement_info'],true);
$v['company_info'] = json_decode($v['company_info'],true);
$v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
@ -329,16 +341,21 @@ class CompanyStatementPoolController extends ThinkController
}
foreach($v['statement_info'] as $ke=>&$va){
$line ++;
if(isset($va['ratio'])){
$va['increment_ratio'] = 0;
}else{
$va['ratio'] = 0;
if($withdraw != 3) {
if (isset($va['ratio'])) {
$va['increment_ratio'] = 0;
} else {
$va['ratio'] = 0;
}
}
if($is_export){
$v['statement_money_exp'] .= "H{$line}+";
$va['d_statement_money'] = "=D{$line}*(1-G{$line})*(E{$line}+F{$line})";
if($withdraw != 3) {
$va['d_statement_money'] = "=D{$line}*(1-G{$line})*(E{$line}+F{$line})";
} else {
$va['d_statement_money'] = "=D{$line}*(F{$line})";
}
}else{
$va['d_statement_money'] = round($va['pay_amount']*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2);
@ -350,8 +367,12 @@ class CompanyStatementPoolController extends ThinkController
$v['settlement_contact'] = $Partner[$v['company_id']];
if($is_export){
$v['statement_money_exp'] .= "J{$cline}-I{$cline}";
$v['statement_money'] = $v['statement_money_exp'];
if ($withdraw != 3) {
$v['statement_money_exp'] .= "J{$cline}-I{$cline}";
$v['statement_money'] = $v['statement_money_exp'];
}
}else{
$count['fine'] += $v['fine'];
$count['reward'] += $v['reward'];
@ -699,6 +720,14 @@ class CompanyStatementPoolController extends ThinkController
}
$pool = M("company_statement_pool","tab_")->where("id = {$v['pool_id']}")->find();
// dump($pool);
if ($v['verify_status'] == 2) {
$is_payment = 2;
} else {
$is_payment = 1;
}
//保存未结算
$lackcompany =[
"company_id"=>$v['company_id'],
@ -712,9 +741,10 @@ class CompanyStatementPoolController extends ThinkController
"reward"=>$v['reward'],
"statement_begin_time"=>$v['statement_begin_time'],
"statement_end_time"=>$v['statement_end_time'],
"is_payment"=>$pool['is_payment'],
"is_payment"=>$is_payment,
"statement_pool_num"=>$pool['statement_num'],
"statement_info"=>$v['statement_info'],
"withdraw_type"=>$v['withdraw_type'],
];
$l_id = M("company_lack_statement_info","tab_")->add($lackcompany);
@ -989,6 +1019,10 @@ class CompanyStatementPoolController extends ThinkController
}else{
$optist = array_diff($optist, ["cancelPool","reCount"]);
}
if ($info['withdraw_type'] == "特殊补点") {
$optist = ['viewPool','cancelPool'];
}
if(empty($info['ext_file'])){
//未上传凭证

@ -563,10 +563,10 @@
}else{
ratio = td['ratio'];
}
console.log(td['pay_amount']*(ratio+td['increment_ratio']))
DATAOBJ.statement_money = PUBLIC.floatCut(DATAOBJ.statement_money,td['sum_money']);
td['sum_money'] = td['pay_amount']*(parseFloat(ratio)+parseFloat(td['increment_ratio']))/100;
td['sum_money'] = (td['sum_money']).toFixed(2);
td['sum_money'] = td['pay_amount']*(parseFloat(td['increment_ratio']))/100;
td['sum_money'] = parseFloat(td['sum_money']).toFixed(2);
DATAOBJ.statement_money=PUBLIC.floatAdd(DATAOBJ.statement_money,td['sum_money']);
TPLSHOW.showStatementList(true);
})

@ -380,7 +380,7 @@
<script type="text/html" id="statementTpl">
{@each statement_info as it,index}
<tr>
<td>${it.account}</td>
<td rowspan="${it.row}">${it.account}</td>
<td>${it['game_list'][0]['statement_begin_time']}~${it['game_list'][0]['statement_end_time']}</td>
<td>${it['game_list'][0]['game_name']}</td>
{@if it.statement_type==1}
@ -400,12 +400,45 @@
<td></td>
<td></td>
{@/if}
{@if it['game_list'][0]['statement_type']==1}
<td>-${it['game_list'][0]['sum_money']}元</td>
{@else}
<td>${it['game_list'][0]['sum_money']}元</td>
{@/if}
</tr>
{@each it.game_list as it_g,index_g}
{@if index_g!=0}
<tr>
<td>${it_g['statement_begin_time']}~${it_g['statement_end_time']}</td>
<td>${it_g['game_name']}</td>
{@if it_g.statement_type==1}
<td>-${it_g['pay_amount']}元</td>
{@else}
<td>${it_g['pay_amount']}元</td>
{@/if}
{@if it_g['statement_type']==0}
{@if withdraw_type==2}
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="it_g['fax_ratio']" value="${it_g['fax_ratio']}" style="width: 40px;">%</td>
{@else}
<td><input type="text" class="txt statementchange" name="ratio" data-index ="${index}" data-change="it_g['ratio']" value="${it_g['ratio']}" style="width: 40px;" disabled="disabled">%</td>
{@/if}
<td><input type="text" class="txt statementchange" name="increment_ratio" data-index ="${index}" data-change="it_g['increment_ratio']" value="${it_g['increment_ratio']}" style="width: 40px;">%</td>
{@else}
<td></td>
<td></td>
{@/if}
{@if it_g['statement_type']==1}
<td>-${it_g['sum_money']}元</td>
{@else}
<td>${it_g['sum_money']}元</td>
{@/if}
{@/if}
</tr>
{@/each}
{@/each}
<tr>
@ -566,10 +599,22 @@
ratio = td['ratio'];
}
var gamelist = td['game_list'];
td['sum_money'] = 0;
for (var item in gamelist) {
td['sum_money'] += (gamelist[item]['pay_amount'] * parseInt(val))/100;
console.log(td['sum_money'])
}
console.log(td['sum_money']);return
DATAOBJ.statement_money = PUBLIC.floatCut(DATAOBJ.statement_money,td['sum_money']);
td['sum_money'] = td['pay_amount']*(parseFloat(ratio)+parseFloat(td['increment_ratio']))/100;
td['sum_money'] = td['pay_amount']*(parseFloat(ratio))/100;
td['sum_money'] = (td['sum_money']).toFixed(2);
DATAOBJ.statement_money=PUBLIC.floatAdd(DATAOBJ.statement_money,td['sum_money']);
TPLSHOW.showStatementList(true);
})
}

@ -200,6 +200,9 @@
</if>
<th style="border-right: solid 1px #b6cad2;">税费费率</th>
<if condition="$data['withdraw_type'] eq 3">
<th>特殊补点比例</th>
</if>
<th >结算金额(元)</th>
</tr>
</thead>
@ -220,6 +223,9 @@
<td>{$it.ratio|showNumPercent}</td>
</if>
<td>{$it.fax_ratio|showNumPercent}</td>
<if condition="$data['withdraw_type'] eq 3">
<td>{$it.increment_ratio|showNumPercent}</td>
</if>
<else />
<td></td>
<td></td>
@ -236,13 +242,14 @@
<tr>
<td>合计</td>
<td></td>
<td></td>
<td>{$data['statement_count']['pay_amount']-0}</td>
<td></td>
<td></td>
<td>{$data['statement_count']['statement_money']-0}</td>
</tr>
<tr>
<td colspan=5>本月分成总金额(人民币大写):</td>
<td colspan=6>本月分成总金额(人民币大写):</td>
<td>{$data.statement_count.big_ratio_money}</td>
</tr>
</tbody>

@ -136,6 +136,7 @@
<else />
<th style="border-right: solid 1px #b6cad2;">分成比例</th>
</if>
<th>特殊补点比例</th>
<th >结算金额(元)</th>
</tr>
</thead>
@ -153,6 +154,7 @@
<else />
<td>{$it['game_list'][0]['ratio']}%</td>
</if>
<td>{$it['game_list'][0]['increment_ratio']}%</td>
<td>{$it['game_list'][0]['sum_money']}</td>
<foreach name="it.game_list" item="game_list" key="game_key">
<if condition="$game_key neq 0">
@ -166,6 +168,7 @@
<else />
<td>{$game_list['ratio']}%</td>
</if>
<td>{$game_list['increment_ratio']}%</td>
<td>{$game_list['sum_money']}</td>
</tr>
</if>
@ -173,7 +176,7 @@
</tr>
</foreach>
<tr>
<td colspan="3">合计</td>
<td colspan="4">合计</td>
<td></td>
<td></td>
<td>{$data.statement_count.pay_amount}</td>
@ -181,7 +184,7 @@
<td>{$data.statement_count.statement_money}</td>
</tr>
<tr>
<td colspan="6">本月分成总金额(人民币大写):</td>
<td colspan="8">本月分成总金额(人民币大写):</td>
<td>{$data.statement_count.big_ratio_money}</td>
</tr>
</tbody>

@ -460,7 +460,7 @@
"<td class='relation_game_name'>"+data[item]['relation_game_name'][item_sec]+"</td>" +
"<td class='pay_amount'>"+data[item]['pay_amount'][item_sec]+"</td>" +
"<td>"+data[item]['ratio'][item_sec]+"%</td>" +
"<td><input value='0' style='width: 20px;text-align: center' class='complement'/>%</td>" +
"<td><input oninput='if($(this).val()>100){$(this).val(100);}' value='0' type='number' style='width: 50px;text-align: center' class='complement'/>%</td>" +
"<td class='withdraw_amount'>"+data[item]['withdraw_amount'][item_sec]+"</td>" +
"<td><a data-value='"+data[item]['company_name']+"' class='delete' data-game_id='"+data[item]['relation_game_id'][item_sec]+"'>删除</a></td></tr>";
}
@ -489,7 +489,7 @@
"<td class='relation_game_name'>"+data[item]['relation_game_name'][0]+"</td>" +
"<td class='pay_amount'>"+data[item]['pay_amount'][0]+"</td>" +
"<td>"+data[item]['ratio'][0]+"%</td>" +
"<td><input value='0' style='width: 20px;text-align: center' class='complement'/>%</td>" +
"<td><input oninput='if($(this).val()>100){$(this).val(100);}' value='0' type='number' style='width: 50px;text-align: center' class='complement'/>%</td>" +
"<td class='withdraw_amount'>"+data[item]['withdraw_amount'][0]+"</td>" +
"<td><a data-value='"+data[item]['company_name']+"' data-game_id='"+data[item]['relation_game_id'][0]+"' class='delete'>删除</a></td></tr>";
for(var item_sec in data[item]['begin_time']) {
@ -499,7 +499,7 @@
"<td class='relation_game_name'>"+data[item]['relation_game_name'][item_sec]+"</td>" +
"<td class='pay_amount'>"+data[item]['pay_amount'][item_sec]+"</td>" +
"<td>"+data[item]['ratio'][item_sec]+"%</td>" +
"<td><input value='0' style='width: 20px;text-align: center' class='complement'/>%</td>" +
"<td><input oninput='if($(this).val()>100){$(this).val(100);}' value='0' type='number' style='width: 50px;text-align: center' class='complement'/>%</td>" +
"<td class='withdraw_amount'>"+data[item]['withdraw_amount'][item_sec]+"</td>" +
"<td><a data-value='"+data[item]['company_name']+"' class='delete' data-game_id='"+data[item]['relation_game_id'][item_sec]+"'>删除</a></td></tr>";
}
@ -546,10 +546,15 @@
//获取总流水
var pay_amount = parseFloat($(this).parent().prev().prev().text());
//计算最终分配比率
var ratio = ($(this).parent().prev().text());
var ratio = parseFloat($(this).val());
if (ratio>100) {
$(this).val(100);
ratio = 100;
}
ratio = parseFloat(ratio.slice(0, -1))+parseFloat($(this).val());
//最终的分配金额
var withdraw_amount = ((pay_amount * ratio)/100).toFixed(2);
@ -574,7 +579,7 @@
var html = "<td class='company_id' rowspan='"+(first_row-1)+"' data-company_id='"+company_id+"'>"+is_first+"</td>";
var next_company = $(this).parent().parent().next().find(".company_id").text();
console.log(next_company)
//判断接下来还有没有该公司的比例,如有增添加公司名称行
if (!next_company&&next_company!="合计") {
$(this).parent().parent().next().prepend(html);

Loading…
Cancel
Save