提交 4cfb71bc authored 作者: fengzy's avatar fengzy

费用报销脚本

上级 dc46a56d
......@@ -275,10 +275,7 @@ class flow_projectfkClassModel extends flowModel
if($flowid['nowcheckid']==$checkid){
$data = m('c_projectfk_details')->getall('mid='.$this->rs['id'], 'id,cbzxid,amount');
$sumamount=0;
foreach ($data as $ve) {
$sumamount += (int) $ve['amount'];
}
foreach ($data as $key => $vo) {
$project=self::project(substr($vo['cbzxid'],0,strpos($vo['cbzxid'], "(")));
......@@ -286,10 +283,15 @@ class flow_projectfkClassModel extends flowModel
$sql = " cost_id='$cbzx_code' and status = 1 and is_default=1";
$cost = m('c_fund_account')->getone($sql, 'id,type,name,freeze_amount,account_balance');//查询账户表成本中心id
if(($cost['account_balance']-$cost['freeze_amount'])<$sumamount){
if(($cost['account_balance']-$cost['freeze_amount'])<$vo['amount']){
return $cost['name']."余额不足";die;
}else{
echo 11;
}
}
foreach ($data as $key => $vo) {
$id=$cost['id'];
$c_withhold = array(
......@@ -310,9 +312,6 @@ class flow_projectfkClassModel extends flowModel
m('c_fund_account')->update($freeze, "`id`='$id'");
}
}
}
}else{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论