Merge branch 'feature/aggregate_finance' of wmtx/platform into release

聚合财务结算单
master
廖金灵 5 years ago committed by Gogs
commit 4a472f2a6a

@ -784,6 +784,9 @@ function unCamelize($str, $separator = '_')
function convertAmountToCn($num) {
//判断$num是否存在
if(!$num) return '零圆';
if($num-0+1 == 1){
return '零圆';
}
//保留小数点后两位
$num = round($num, 2);
//将浮点转换为整数

@ -46,6 +46,9 @@ class AggregateFinanceSetController extends Controller {
}
public function setDailyCount($stime="now")
{
if(!IS_CLI){
die("只支持脚本访问");
}
if($stime=="now"){
$stime=time();
}else{
@ -70,13 +73,13 @@ class AggregateFinanceSetController extends Controller {
echo $nowdate."非周一和月初,无需任何处理".PHP_EOL;
}
}
public function setWeekCount($stime)//进行周结
protected function setWeekCount($stime)//进行周结
{
$begintime = mktime(0,0,0,date('m',$stime),date('d',$stime)-7,date('Y',$stime));
$endtime = mktime(0,0,0,date('m',$stime),date('d',$stime),date('Y',$stime))-1;
$this->getAndSaveData(0,$begintime,$endtime);
}
public function setMonthCount($stime)//进行周结
protected function setMonthCount($stime)//进行周结
{
$thismonth = date('m',$stime);
$thisyear = date('Y',$stime);

@ -64,10 +64,10 @@ class AggregateFinanceStatementController extends ThinkController
$map['create_time'] = ['ELT', strtotime($_REQUEST['time_end2']) + 86399];
}
if ($_REQUEST['verify_status']) {
if (isset($_REQUEST['verify_status'])) {
$map['verify_status'] = $_REQUEST['verify_status'];
}
if ($_REQUEST['channel_id']) {
if (isset($_REQUEST['channel_id'])){
$map['channel_id'] = $_REQUEST['channel_id'];
}
$typeflag = false;
@ -515,8 +515,13 @@ class AggregateFinanceStatementController extends ThinkController
$data['statement_info'] = json_decode($data['statement_info'], 1);//结算记录
//收款方
$big_pay_money = convertAmountToCn($data['ratio_money']);//大写
$data['receive_company'] = $data['pay_type'] ? $data['first_party_info'] : $data['second_party_info'];
$data['pay_company'] = $data['pay_type'] ? $data['second_party_info'] : $data['first_party_info'];
if($data['pay_type'] == 0){
//甲-乙
$data['pay_company'] = $data['second_party_info'];
}else{
$data['pay_company'] = $data['first_party_info'];
}
$this->doAddOperationLog($id,"导出");
$this->excelDownStreamTemplate($data,$big_pay_money);
}
@ -529,7 +534,7 @@ class AggregateFinanceStatementController extends ThinkController
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
date_default_timezone_set('Asia/Shanghai');
Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
@ -537,9 +542,9 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls");
$statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间
$objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单
{$statement_begin_time}-{$statement_end_time}");
$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单\n{$statement_begin_time}-{$statement_end_time}");
if ($data['withdraw_type'] == '2') {
$objPHPExcel->getActiveSheet()->setCellValue('D2','补点比例');
}
@ -577,9 +582,10 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+4), $data['second_party_info']['link_man']);//联系人
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+5), $data['second_party_info']['link_phone']);//联系电话
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+6), $data['second_party_info']['address']);//邮寄地址
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+8), $data['second_party_info']['payee_name']);//户名
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+9), $data['second_party_info']['bank_account']);//银行账号
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['second_party_info']['opening_bank']);//开户行
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+8), $data['pay_company']['payee_name']);//户名
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+9), $data['pay_company']['bank_account']);//银行账号
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['pay_company']['opening_bank']);//开户行
if($data['withdraw_type'] == 1){
$m = date('Y.m', $data['begintime']);
$fileName = "{$data['second_party_info']['partner']}&{$data['first_party_info']['partner']}-对账单{$m}";

@ -239,7 +239,7 @@
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要审核通过的结算单' + "</font>");
layer.msg("<font style='color:white'>" + '无需要审核通过的结算单,仅[已申请发票]状态可以进行审核通过' + "</font>");
return;
}
if(flag){
@ -280,7 +280,7 @@
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要审核拒绝的结算单' + "</font>");
layer.msg("<font style='color:white'>" + '无需要审核拒绝的结算单,仅[已申请发票]状态可以进行审核拒绝' + "</font>");
return;
}
if(flag){
@ -321,7 +321,7 @@
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行已开票的结算单' + "</font>");
layer.msg("<font style='color:white'>" + '无需要进行已开票的结算单,仅[审核同意]状态可以进行已开票' + "</font>");
return;
}
if(flag){
@ -362,7 +362,7 @@
}
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行已到账的结算单' + "</font>");
layer.msg("<font style='color:white'>" + '无需要进行已到账的结算单,仅[已开票][已上传凭证]状态可以进行已到账' + "</font>");
return;
}
if(flag){
@ -403,7 +403,7 @@
// return $(elem).val();
}).get().join(",");
if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行重新结算的结算单' + "</font>");
layer.msg("<font style='color:white'>" + '无需要进行重新结算的结算单,仅[未申请发票][申请开票][审核拒绝]状态可以进行重新结算' + "</font>");
return;
}
layer.confirm("重算结算金额会对结算单回退到未申请发票状态,请慎重处理,点击取消停止操作",{title:false}, function(index){
@ -429,80 +429,6 @@
});
}
})
$("#shenhe").click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get().join(",");
layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
}, function(index) {
if (!text) {
layer.msg("<em style='color:white'>" + '请选择后再进行操作' + "</em>");
return;
}
$.ajax({
url: "{:U('statementMangement/verifyStatementStatus')}",
type: "get",
data: {order: text},
dataType: 'json',
success: function (data) {
if (data.status == 0) {
layer.msg("<em style='color:white'>" + '审核通过失败' + "</em>");
} else {
layer.msg("<em style='color:white'>" + '审核通过成功' + "</em>")
setTimeout(function(){
window.parent.reload();
},1500);
}
}
});
})
})
$("#reject").click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get().join(",");
layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
}, function(index) {
if (!text) {
layer.msg("<em style='color:white'>" + '请选择后再进行操作' + "</em>");
return;
}
$.ajax({
url: "{:U('statementMangement/rejectStatementStatus')}",
type: "get",
data: {order: text},
dataType: 'json',
success: function (data) {
if (data.status == 0) {
layer.msg("<em style='color:white'>" + '审核拒绝失败' + "</em>");
} else {
layer.msg("<em style='color:white'>" + '审核拒绝成功' + "</em>")
setTimeout(function(){
window.parent.reload();
},1500);
}
}
});
})
})
//查看开票信息
$(".viewStatement").click(function () {
var id = $(this).data("id");
@ -521,7 +447,7 @@
layer.open({
type: 2,
title: "申请开票",
shadeClose: true,
shadeClose: false,
shade: 0.8,
area: ['70%', '80%'],
content:'/admin.php?s=/AggregateFinanceStatement/createStatement/id/'+id
@ -533,7 +459,7 @@
layer.open({
type: 2,
title: "开票编辑",
shadeClose: true,
shadeClose: false,
shade: 0.8,
area: ['70%', '80%'],
content:'/admin.php?s=/AggregateFinanceStatement/editStatement/id/'+id

@ -139,6 +139,7 @@
'timeend'=>$_GET['timeend'],
'sdk_type'=>$_GET['sdk_type'],
'game_name'=>$_GET['game_name'],
'game_type_id'=>$_GET['game_type_id'],
'game_id'=>$_REQUEST['game_id'],
'partner_id'=>$_REQUEST['partner_id'],
false))}"

@ -407,6 +407,9 @@
})
}
getPromotersByCompanyid();
$("#promote_id").change(function(){
promote_id = $("#promote_id option:selected").val();
})
$("#company_id").change(function(){
getPromotersByCompanyid();

@ -456,6 +456,9 @@
})
}
getPromotersByCompanyid();
$("#promote_id").change(function(){
promote_id = $("#promote_id option:selected").val();
})
$("#company_id").change(function(){
getPromotersByCompanyid();

@ -413,6 +413,9 @@
})
}
getPromotersByCompanyid();
$("#promote_id").change(function(){
promote_id = $("#promote_id option:selected").val();
})
$("#company_id").change(function(){
getPromotersByCompanyid();

@ -171,7 +171,7 @@
<tr>
<td class="l">最后登录时间</td>
<td class="r">
<input type="text" class="txt" name="login_time" value="{$data['login_time']|date=' Y-m-d H:i:s',###}" disabled>
<input type="text" class="txt" name="login_time" value="{:set_show_time($data['login_time'])}" disabled>
</td>
</tr>
<tr>

@ -1710,7 +1710,7 @@ CREATE TABLE `sys_kv` (
UNIQUE KEY `key_name` (`key`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='系统简单kv储存表';
INSERT INTO `platform`.`sys_kv` (`key`, `value`, `type`, `remark`) VALUES ('aggregate_finance_api', 'http://admin.cz.com/index.php?g=api&m=FinanceWeekCount&a=returnFinanceAccountsDataList', 'string', '聚合下游结算Api地址');
INSERT INTO `sys_kv` (`key`, `value`, `type`, `remark`) VALUES ('aggregate_finance_api', 'http://admin.wmtxkj.com/index.php?g=api&m=FinanceWeekCount&a=returnFinanceAccountsDataList', 'string', '聚合下游结算Api地址');
-- chenzhi 20200422
CREATE TABLE `tab_aggregate_statement` (

Loading…
Cancel
Save