Commit acff90d9 authored by hujun's avatar hujun

最终实收计算

parent 9a069bce
...@@ -1069,13 +1069,14 @@ class Finance extends Basic ...@@ -1069,13 +1069,14 @@ class Finance extends Basic
if (empty($this->params['excel']) && $this->params['excel'] != 1) { if (empty($this->params['excel']) && $this->params['excel'] != 1) {
$fields = 'f.income_time,a.create_time,a.id,a.agent_id,sum(b.fee) as fee,sum(c.practical_fee) as practical_fee,sum(c.cash) as cash,'; $fields = 'f.income_time,a.create_time,a.id,a.agent_id,sum(b.fee) as fee,sum(c.practical_fee) as practical_fee,sum(c.cash) as cash,';
$fields .= 'sum(c.service_charge) as service_charge,sum(b.fee) as fee,sum(c.real_fee) as real_fee,'; $fields .= 'sum(b.fee) as fee,sum(c.real_fee) as real_fee,';
$fields .= 'd.name,d.phone'; $fields .= 'd.name,d.phone';
$data['data']['list'] = $m_bargain->getCommissionTotalList($pageNo, $pageSize, 'a.id desc', $fields, $where, $whereOr); $data['data']['list'] = $m_bargain->getCommissionTotalList($pageNo, $pageSize, 'a.id desc', $fields, $where, $whereOr);
foreach ($data['data']['list'] as $k=>$v) { foreach ($data['data']['list'] as $k=>$v) {
$data['data']['list'][$k]['income_date'] = $income_date; $data['data']['list'][$k]['income_date'] = $income_date;
$data['data']['list'][$k]['operation_date'] = $operation_date; $data['data']['list'][$k]['operation_date'] = $operation_date;
$data['data']['list'][$k]['over_fee'] = $v['practical_fee'] - $v['fee'];
} }
$data['data']['total'] = $m_bargain->getCommissionTotalListTotal($where, $whereOr); $data['data']['total'] = $m_bargain->getCommissionTotalListTotal($where, $whereOr);
...@@ -1084,7 +1085,7 @@ class Finance extends Basic ...@@ -1084,7 +1085,7 @@ class Finance extends Basic
//导出Excel //导出Excel
$fields = 'f.income_time,a.create_time,sum(b.fee) as fee,sum(f.money) as money,sum(c.cash) as cash,'; $fields = 'f.income_time,a.create_time,sum(b.fee) as fee,sum(f.money) as money,sum(c.cash) as cash,';
$fields .= 'sum(c.service_charge) as service_charge,a.agent_id,'; $fields .= 'sum(c.service_charge) as service_charge,a.agent_id,sum(c.practical_fee) as practical_fee,';
$fields .= 'd.name,d.phone,sum(c.charity_fund) as charity_fund, sum(should_commission) as should_commission'; $fields .= 'd.name,d.phone,sum(c.charity_fund) as charity_fund, sum(should_commission) as should_commission';
$pageSize = 25000; $pageSize = 25000;
...@@ -1101,7 +1102,7 @@ class Finance extends Basic ...@@ -1101,7 +1102,7 @@ class Finance extends Basic
$excel_data[$k]['charity_fund'] = $v['charity_fund']; //慈善基金 $excel_data[$k]['charity_fund'] = $v['charity_fund']; //慈善基金
$excel_data[$k]['money'] = $v['money']; //实收佣金 $excel_data[$k]['money'] = $v['money']; //实收佣金
$excel_data[$k]['fee'] = $v['fee']; //税费 $excel_data[$k]['fee'] = $v['fee']; //税费
$excel_data[$k]['over_fee'] = $v['real_fee'] - $v['charity_fund']; $excel_data[$k]['over_fee'] = $v['practical_fee'] - $v['fee'];
} }
$num = count($excel_data) + 2; $num = count($excel_data) + 2;
......
...@@ -457,9 +457,6 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs ...@@ -457,9 +457,6 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
}); });
}, },
exportList: function(pageNo) { exportList: function(pageNo) {
console.log(2);
business.pageNo = pageNo;
var excel_two = 1;
var name = $('#user_name').val(); var name = $('#user_name').val();
var phone = $('#user_phone').val(); var phone = $('#user_phone').val();
var income_start_date = $('#create_time').val(); var income_start_date = $('#create_time').val();
...@@ -469,10 +466,52 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs ...@@ -469,10 +466,52 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
var operation_start_date = $('#create_ticketTime').val(); var operation_start_date = $('#create_ticketTime').val();
var operation_end_date = $('#end_ticketTime').val(); var operation_end_date = $('#end_ticketTime').val();
var district_id = $("#qx-store option:selected").val(); //部门id 添加字段 var district_id = $("#qx-store option:selected").val(); //部门id 添加字段
var store_name = $('#store_name').val(); var store_id = $('#store_name').val();
window.open('/index/getCommissionTotalList?' +
'excel=' + excel_two + '&name=' + name + '&phone=' + phone + '&income_start_date=' + income_start_date + '&income_end_date=' + income_end_date + '&bargain_start_date=' + bargain_start_date + '&bargain_end_date=' + bargain_end_date + '&operation_start_date=' + operation_start_date + '&operation_end_date=' + operation_end_date + '&district_id=' + district_id + '&store_name=' + store_name); var str = '/index/getCommissionTotalList?excel=1';
},
if (name) {
str += '&name=' + name;
}
if (phone) {
str += '&phone=' + phone;
}
if (income_start_date) {
str += '&income_start_date=' + income_start_date;
}
if (income_end_date) {
str += '&income_end_date=' + income_end_date;
}
if (bargain_start_date) {
str += '&bargain_start_date=' + bargain_start_date;
}
if (bargain_end_date) {
str += '&bargain_end_date=' + bargain_end_date;
}
if (operation_start_date) {
str += '&operation_start_date=' + operation_start_date;
}
if (operation_end_date) {
str += '&operation_end_date=' + operation_end_date;
}
if (district_id) {
str += '&district_id=' + district_id;
}
if (store_id) {
str += '&store_name=' + store_name;
}
window.open(str)
}
}; };
return business; return business;
}); });
\ No newline at end of file
...@@ -8,14 +8,9 @@ ...@@ -8,14 +8,9 @@
<td>[%= it[item]['name'] %]</td> <td>[%= it[item]['name'] %]</td>
<td>[%= it[item]['practical_fee'] %]</td> <td>[%= it[item]['practical_fee'] %]</td>
<td>[%= it[item]['cash'] %]</td> <td>[%= it[item]['cash'] %]</td>
<td>[%= it[item]['service_charge'] %]</td>
<td>[%= it[item]['practical_fee'] %]</td> <td>[%= it[item]['practical_fee'] %]</td>
<td>[%= it[item]['fee'] %]</td> <td>[%= it[item]['fee'] %]</td>
<!--<td>[%= it[item]['service_charge'] %]</td>--> <td>[%= it[item]['over_fee'] %]</td>
<!--<td>
<a class="btn1 btn-info edit" href="#modal-details" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详情</a>
<a class="btn1 btn-info timeline" href="#modal-linetime" data-toggle="modal" data-id='[%= it[item]["id"] %]'>时间轴</a>
</td>-->
</tr> </tr>
[% } %] [% } %]
[% }else{ %] [% }else{ %]
...@@ -23,5 +18,5 @@ ...@@ -23,5 +18,5 @@
<td colspan="9" style="text-align:center;"> 暂无数据</td> <td colspan="9" style="text-align:center;"> 暂无数据</td>
</tr> </tr>
[% } %] [% } %]
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment