聚合财务结算单ok

master
chenzhi 5 years ago
parent 8137778ec1
commit 21a985ae82

@ -110,7 +110,7 @@ class AggregateFinanceStatementController extends ThinkController
$data[$key]['oplist'] = $this->OpAuth($value);
}
$count = M("aggregate_statement","tab_")->field("count(id) count,SUM(ratio_money) ratio_money")->where($map)->find();
$count = M("aggregate_statement","tab_")->field("count(id) count,SUM(ratio_money) ratio_money,SUM(pay_money) pay_money")->where($map)->find();
//分页
$parameter['p'] = $page;
@ -123,6 +123,7 @@ class AggregateFinanceStatementController extends ThinkController
$this->assign('menubtn',$this->menuAuth());
$this->assign('data',$data);
$this->assign('total',$count['ratio_money']);
$this->assign('pay_money',$count['pay_money']);
$this->assign('channel',$this->getAggChannel());
$this->assign('verify_status',$this->verify_status);
$this->display();
@ -347,11 +348,21 @@ class AggregateFinanceStatementController extends ThinkController
public function delVoucher(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$info = M("aggregate_statement","tab_")->field("id,ext_field")->where("id = '{$id}'")->find();
$info = M("aggregate_statement","tab_")->field("id,ext_field,verify_status")->where("id = '{$id}'")->find();
if(!empty($info['ext_field'])){
unlink("./".$info['ext_field']);
}
M("aggregate_statement","tab_")->where("id = '{$id}'")->save(['ext_field'=>'']);
$save = [
"ext_field"=>'',
];
//如果是已上传凭证状态就回退到审核通过
if($info["verify_status"] == 4){
$save['verify_status'] = 3;
$save['create_time'] = time();
$save["admin_name"]=$this->admininfo["username"];
$save["admin_id"]=$this->admininfo["uid"];
}
M("aggregate_statement","tab_")->where("id = '{$id}'")->save($save);
$this->doAddOperationLog($id,"删除凭证");
$this->ajaxReturn(array(
'status' => 1,

@ -168,7 +168,7 @@
</tr>
</volist>
<tr><td>合计</td><td colspan="10">对账金额:{$total}</td></tr>
<tr><td>合计</td><td colspan="10">结算总流水:{$pay_money}元&#12288;&#12288;&#12288;&#12288;结算金额:{$total}元 </td></tr>
</notemtpy>
</tbody>
</table>
@ -176,9 +176,6 @@
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/promote_list',array_merge(['xlsname'=>'推广员管理_推广员列表'.((I('type',1)==2)?'_混服申请':'_推广员列表')],I('get.')))}">导出</a>
</if>
{$_page|default=''}
</div>
</block>

Loading…
Cancel
Save