提交 3ac7d192 authored 作者: fengzy's avatar fengzy

oa付款单

上级 f2336aa6
......@@ -36,8 +36,36 @@ class flow_oafkClassModel extends flowModel
//zt 1代表同意
if($zt==1){
$flowid=$this->getflow();
if($explain){
if($flowid['nowcheckid']==$checkid && $flowid['nowcourseid']==$explain){
$data = m('c_fund_details_fk')->getall('mid='.$this->rs['id'], 'id,cbzx_code,charge_amount');
foreach ($data as $key => $vo) {
$cbzx_code=$vo['cbzx_code'];
$sql = " cost_id='$cbzx_code' and status = 1 and is_default=1";
$cost = m('c_fund_account')->getone($sql, 'id,freeze_amount');//查询账户表成本中心id
$id=$cost['id'];
$c_withhold = array(
'fund_account_id' => $id,
'docnum' => $this->rs['docnum'],
'cost_id' => $vo['cbzx_code'],
'amount' => $vo['charge_amount'],
'status' => 1,
'create_time' => date("Y-m-d H:i:s"),
'uid' => $this->rs['uid'],
);
m('c_withhold')->insert($c_withhold);
if($flowid['nowcheckid']==$checkid && $flowid['nowcourseid']==$explain){
//修改冻结余额
$freeze = array(
'freeze_amount' => $cost['freeze_amount'] + $vo['charge_amount'],
);
m('c_fund_account')->update($freeze, "`id`='$id'");
}
}
}else{
if($flowid['nowcheckid']==$checkid){
$data = m('c_fund_details_fk')->getall('mid='.$this->rs['id'], 'id,cbzx_code,charge_amount');
foreach ($data as $key => $vo) {
$cbzx_code=$vo['cbzx_code'];
......@@ -64,6 +92,7 @@ class flow_oafkClassModel extends flowModel
m('c_fund_account')->update($freeze, "`id`='$id'");
}
}
}
}else{
$docnum=$this->rs['docnum'];
//将单据状态作废余额
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论