Commit 4a053768 authored by hujun's avatar hujun

导出计算

parent 955fce64
...@@ -930,7 +930,7 @@ class Finance extends Basic ...@@ -930,7 +930,7 @@ class Finance extends Basic
$where['e.id'] = $this->params['partial_id']; $where['e.id'] = $this->params['partial_id'];
} }
$field = 'a.id,a.confirm_date,a.practical_fee,b.scale_fee,b.scale,b.role,d.internal_address,b.agent_id,cash,service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission'; $field = 'a.id,a.confirm_date,a.practical_fee,b.scale_fee,b.scale,b.role,d.internal_address,b.agent_id,cash,service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission,d.internal_address';
$m_commission = new OPartialCommission(); $m_commission = new OPartialCommission();
try { try {
...@@ -947,7 +947,7 @@ class Finance extends Basic ...@@ -947,7 +947,7 @@ class Finance extends Basic
$result[$k]['district_store'] = $agent_data['store_name'] . '-' . $agent_data['store_name']; $result[$k]['district_store'] = $agent_data['store_name'] . '-' . $agent_data['store_name'];
$result[$k]['agent'] = $agent_data['name'] . '-' . $agent_data['phone']; $result[$k]['agent'] = $agent_data['name'] . '-' . $agent_data['phone'];
} }
$result[$k]['internal_address'] = $v['internal_address'];
switch ($v['role']) { switch ($v['role']) {
case 1: case 1:
$result[$k]['role'] = '盘方'; $result[$k]['role'] = '盘方';
...@@ -986,8 +986,8 @@ class Finance extends Basic ...@@ -986,8 +986,8 @@ class Finance extends Basic
return '<script>alert("导出分佣提成明细列表失败");window.close();</script>'; return '<script>alert("导出分佣提成明细列表失败");window.close();</script>';
} }
$export = new ExportExcelUntil(); $export = new ExportExcelUntil();
$title = [ '收佣日期', '所属部门/门店', '业务员','分佣角色', '分佣比例(%)','应分佣金(元)', '预分佣金(元)', '手续费(元)', '慈善基金(元)', '现金奖(元)', '实收佣金(元)' ]; $title = [ '收佣日期', '所属部门/门店', '业务员','商铺地址','分佣角色', '分佣比例(%)','应分佣金(元)', '预分佣金(元)', '手续费(元)', '慈善基金(元)', '现金奖(元)', '实收佣金(元)' ];
$export->exportTable('实收明细表', $result, 10, '实收明细表', $title); $export->exportTable('实收明细表', $result, 11, '实收明细表', $title);
return ''; return '';
} }
...@@ -1426,7 +1426,7 @@ class Finance extends Basic ...@@ -1426,7 +1426,7 @@ class Finance extends Basic
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$operation_start_data = $operation_end_data = $income_date = $operation_date = ''; $operation_start_data = $operation_end_data = $income_date = $operation_date = '';
$where = [];
/**收佣日期 start**/ /**收佣日期 start**/
if (!empty($this->params['income_start_date']) && empty($this->params['income_end_date'])) { if (!empty($this->params['income_start_date']) && empty($this->params['income_end_date'])) {
$where[0] = ['EXP', "b.income_time > '{$this->params['income_start_date']}' OR c.operation_date > '{$this->params['income_start_date']}'"]; $where[0] = ['EXP', "b.income_time > '{$this->params['income_start_date']}' OR c.operation_date > '{$this->params['income_start_date']}'"];
...@@ -1487,7 +1487,7 @@ class Finance extends Basic ...@@ -1487,7 +1487,7 @@ class Finance extends Basic
/**经纪人手机号**/ /**经纪人手机号**/
if (!empty($this->params['agent_id'])) { if (!empty($this->params['agent_id'])) {
$where['a.agent_id'] = $this->params['agent_id']; $where['a.agent_id'] = $taxes_where['a.agent_id'] = $this->params['agent_id'];
} }
$fields = 'sum( a.practical_fee ) as practical_fee,sum( a.real_fee ) as real_fee,'; $fields = 'sum( a.practical_fee ) as practical_fee,sum( a.real_fee ) as real_fee,';
...@@ -1499,7 +1499,7 @@ class Finance extends Basic ...@@ -1499,7 +1499,7 @@ class Finance extends Basic
if (empty($this->params['excel']) && $this->params['excel'] != 1) { if (empty($this->params['excel']) && $this->params['excel'] != 1) {
$m_tax = new OTaxes(); $m_tax = new OTaxes();
$taxes_where['a.father_id'] = ['>', 0]; $taxes_where['a.father_id'] = ['>', 0];
$taxes_where['is_del'] = 0; $taxes_where['a.is_del'] = 0;
// $taxes_where['b.status'] = ['IN', '10,11,13']; // $taxes_where['b.status'] = ['IN', '10,11,13'];
$taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]]; $taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]];
$data['data']['total_taxes'] = $m_tax->sumBargainFee('a.fee', $taxes_where);; $data['data']['total_taxes'] = $m_tax->sumBargainFee('a.fee', $taxes_where);;
......
...@@ -240,7 +240,7 @@ class OPartialCommission extends BaseModel ...@@ -240,7 +240,7 @@ class OPartialCommission extends BaseModel
if (in_array($v['status'], [10,11,13])) { if (in_array($v['status'], [10,11,13])) {
$partial_where['a.agent_id'] =$v['agent_id']; $partial_where['a.agent_id'] =$v['agent_id'];
$partial_where['c.income_time'] = $taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]]; $partial_where['c.income_time'] = ['between', [$operation_start_data, $operation_end_data]];
$result[$k] = $this->getSumMoney($field, $partial_where); $result[$k] = $this->getSumMoney($field, $partial_where);
} else { } else {
$result[$k]['practical_fee'] = 0; $result[$k]['practical_fee'] = 0;
...@@ -249,7 +249,7 @@ class OPartialCommission extends BaseModel ...@@ -249,7 +249,7 @@ class OPartialCommission extends BaseModel
$result[$k]['charity_fund'] = 0; $result[$k]['charity_fund'] = 0;
} }
$taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]];
$taxes_where['a.agent_id'] = $v['agent_id']; $taxes_where['a.agent_id'] = $v['agent_id'];
$result[$k]['fee'] = $m_tax->sumBargainFee('a.fee', $taxes_where); $result[$k]['fee'] = $m_tax->sumBargainFee('a.fee', $taxes_where);
$result[$k]['agent_id'] = $v['agent_id']; $result[$k]['agent_id'] = $v['agent_id'];
......
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