提交 cca804d2 authored 作者: fengzy's avatar fengzy

费用报销脚本

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