Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
78a46cb2
Commit
78a46cb2
authored
Dec 21, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实收汇总导出
parent
f4b58679
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
5 deletions
+51
-5
Finance.php
application/index/controller/Finance.php
+51
-5
No files found.
application/index/controller/Finance.php
View file @
78a46cb2
...
@@ -1430,7 +1430,7 @@ class Finance extends Basic
...
@@ -1430,7 +1430,7 @@ class Finance extends Basic
}
else
{
}
else
{
$pageNo
=
(
$this
->
params
[
'pageNo'
]
-
1
)
*
$pageSize
;
$pageNo
=
(
$this
->
params
[
'pageNo'
]
-
1
)
*
$pageSize
;
}
}
$where
=
' e.status in (10,11,13)
AND a.confirm_status = 1
'
;
$where
=
' e.status in (10,11,13) '
;
$operation_start_data
=
$operation_end_data
=
$income_date
=
$operation_date
=
''
;
$operation_start_data
=
$operation_end_data
=
$income_date
=
$operation_date
=
''
;
/**收佣日期 start**/
/**收佣日期 start**/
...
@@ -1474,11 +1474,17 @@ class Finance extends Basic
...
@@ -1474,11 +1474,17 @@ class Finance extends Basic
$fields
=
' d.store_id,d.district_id,a.agent_id,sum( a.practical_fee ) as practical_fee,sum( c.fee ) as fee,'
;
$fields
=
' d.store_id,d.district_id,a.agent_id,sum( a.practical_fee ) as practical_fee,sum( c.fee ) as fee,'
;
$fields
.=
'sum( a.real_fee ) as real_fee,sum( a.service_charge ) as service_charge,sum( a.charity_fund ) as charity_fund'
;
$fields
.=
'sum( a.real_fee ) as real_fee,sum( a.service_charge ) as service_charge,sum( a.charity_fund ) as charity_fund'
;
$m_partial
=
new
OPartialCommission
();
$m_partial
=
new
OPartialCommission
();
$m_store
=
new
AStore
();
$m_agent
=
new
AAgents
();
if
(
empty
(
$this
->
params
[
'excel'
])
&&
$this
->
params
[
'excel'
]
!=
1
)
{
if
(
empty
(
$this
->
params
[
'excel'
])
&&
$this
->
params
[
'excel'
]
!=
1
)
{
$
list
=
$m_partial
->
getCommissionTotalList
(
$pageNo
,
$pageSize
,
$fields
,
$where
,
$operation_start_data
,
$operation_end_data
);
$
data
[
'data'
][
'total_taxes'
]
=
$m_partial
->
getCommissionTotalInfo
(
'c.fee'
,
$where
);
$m_store
=
new
AStore
();
if
(
!
empty
(
$this
->
params
[
'confirm_date'
]))
{
$m_agent
=
new
AAgents
();
$where
.=
' AND a.confirm_date <= "'
.
$this
->
params
[
'confirm_date'
]
.
' 23:59:59" AND a.confirm_status = 1 '
;
}
$list
=
$m_partial
->
getCommissionTotalList
(
$pageNo
,
$pageSize
,
$fields
,
$where
,
$operation_start_data
,
$operation_end_data
);
foreach
(
$list
as
$k
=>
$v
)
{
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'income_date'
]
=
$income_date
;
$list
[
$k
][
'income_date'
]
=
$income_date
;
$list
[
$k
][
'operation_date'
]
=
$operation_date
;
$list
[
$k
][
'operation_date'
]
=
$operation_date
;
...
@@ -1491,7 +1497,47 @@ class Finance extends Basic
...
@@ -1491,7 +1497,47 @@ class Finance extends Basic
$data
[
'data'
][
'total'
]
=
$m_partial
->
getCommissionTotalListTotal
(
$where
);
$data
[
'data'
][
'total'
]
=
$m_partial
->
getCommissionTotalListTotal
(
$where
);
$data
[
'data'
][
'total_money'
]
=
$m_partial
->
getCommissionTotalInfo
(
'a.practical_fee'
,
$where
);
$data
[
'data'
][
'total_money'
]
=
$m_partial
->
getCommissionTotalInfo
(
'a.practical_fee'
,
$where
);
$data
[
'data'
][
'total_taxes'
]
=
$m_partial
->
getCommissionTotalInfo
(
'c.fee'
,
$where
);
}
else
{
//导出Excel
$pageSize
=
25000
;
$fields
.=
',sum(a.should_commission) as should_commission,sum(a.cash) as cash'
;
if
(
!
empty
(
$this
->
params
[
'confirm_date'
]))
{
$where
.=
' AND a.confirm_date <= "'
.
$this
->
params
[
'confirm_date'
]
.
' 23:59:59" AND a.confirm_status = 1 '
;
}
$result_data
=
$m_partial
->
getCommissionTotalList
(
$pageNo
,
$pageSize
,
$fields
,
$where
,
$operation_start_data
,
$operation_end_data
);
foreach
(
$result_data
as
$k
=>
$v
)
{
$excel_data
[
$k
][
'income_date'
]
=
$income_date
;
//收佣日期
$excel_data
[
$k
][
'operation_date'
]
=
$operation_date
;
//成交日期
$excel_data
[
$k
][
'district_store'
]
=
$m_store
->
getStoreDistrictName
(
$v
[
'store_id'
]);;
//所属部门/门店
$excel_data
[
$k
][
'name'
]
=
$m_agent
->
getAgentsById
(
$v
[
'agent_id'
],
'name'
);
//业务员
$excel_data
[
$k
][
'should_commission'
]
=
$v
[
'should_commission'
];
//应分佣金
$excel_data
[
$k
][
'service_charge'
]
=
$v
[
'service_charge'
];
//手续费
$excel_data
[
$k
][
'cash'
]
=
$v
[
'cash'
];
//现金奖
$excel_data
[
$k
][
'charity_fund'
]
=
$v
[
'charity_fund'
];
//慈善基金
$excel_data
[
$k
][
'practical_fee'
]
=
$v
[
'practical_fee'
];
//实收佣金
$excel_data
[
$k
][
'fee'
]
=
$v
[
'fee'
];
$excel_data
[
$k
][
'over_fee'
]
=
$v
[
'practical_fee'
]
-
$v
[
'fee'
];
}
$num
=
count
(
$excel_data
)
+
2
;
$excel_data
[
$num
][
'income_time'
]
=
'合计'
;
//收佣日期
$excel_data
[
$num
][
'create_time'
]
=
''
;
//成交日期
$excel_data
[
$num
][
'district_store'
]
=
''
;
//所属部门/门店
$excel_data
[
$num
][
'name'
]
=
''
;
//业务员
$excel_data
[
$num
][
'should_commission'
]
=
"=SUM(E3:E
{
$num
}
)"
;
//应分佣金
$excel_data
[
$num
][
'service_charge'
]
=
"=SUM(F3:F
{
$num
}
)"
;
//手续费
$excel_data
[
$num
][
'cash'
]
=
"=SUM(G3:G
{
$num
}
)"
;
//现金奖
$excel_data
[
$num
][
'charity_fund'
]
=
"=SUM(H3:H
{
$num
}
)"
;
//慈善基金
$excel_data
[
$num
][
'money'
]
=
"=SUM(I3:I
{
$num
}
)"
;
//实收佣金
$excel_data
[
$num
][
'fee'
]
=
"=SUM(J3:J
{
$num
}
)"
;
//税费
$excel_data
[
$num
][
'over_fee'
]
=
"=SUM(K3:K
{
$num
}
)"
;
$export
=
new
ExportExcelUntil
();
$title
=
[
'收佣日期/开票日期'
,
'成交日期/开票日期'
,
'所属部门/门店'
,
'业务员'
,
'应分佣金(元)'
,
'手续费(元)'
,
'现金奖(元)'
,
'慈善基金(元)'
,
'实收佣金(元)'
,
'税费(元)'
,
'最终实收(元)'
];
$export
->
exportTable
(
'分佣提成汇总表'
,
$excel_data
,
10
,
'分佣提成汇总表'
,
$title
);
}
}
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment