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

项目付款单

上级 797ca1b9
...@@ -254,7 +254,7 @@ class flow_projectfkClassModel extends flowModel ...@@ -254,7 +254,7 @@ class flow_projectfkClassModel extends flowModel
$sql = " mid ='$id' and `table`='c_projectfk' "; $sql = " mid ='$id' and `table`='c_projectfk' ";
$flow_bill = m('flow_bill')->getone($sql,'allcheckid'); $flow_bill = m('flow_bill')->getone($sql,'allcheckid');
$allcheckid=explode(',',$flow_bill['allcheckid']); $allcheckid=explode(',',$flow_bill['allcheckid']);
$optionid = m('option')->getone("num = 'em_manager' ",'id'); $optionid = m('option')->getone("num = 'oafk_manager' ",'id');
$optionid=$optionid['id']; $optionid=$optionid['id'];
$option = m('option')->getall("pid = '$optionid' and num =1 order by sort desc",'num,name,value,sort'); $option = m('option')->getall("pid = '$optionid' and num =1 order by sort desc",'num,name,value,sort');
...@@ -282,17 +282,16 @@ class flow_projectfkClassModel extends flowModel ...@@ -282,17 +282,16 @@ 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');
foreach ($data as $key => $vo) { foreach ($data as $key => $vo) {
$project=self::project(substr($vo['cbzxid'],0,strpos($vo['cbzxid'], "(")));
$cbzx_code= self::dept($project['data'][0]['jz_cur_dept']); $cbzx_code= self::dept($project['data'][0]['jz_cur_dept']);
$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['type']=='1'){
if(($cost['account_balance']-$cost['freeze_amount'])<$vo['amount']){ if(($cost['account_balance']-$cost['freeze_amount'])<$vo['amount']){
return $cost['name']."余额不足";die; return $cost['name']."余额不足";die;
} }
}
$id=$cost['id']; $id=$cost['id'];
$c_withhold = array( $c_withhold = array(
...@@ -322,11 +321,10 @@ class flow_projectfkClassModel extends flowModel ...@@ -322,11 +321,10 @@ class flow_projectfkClassModel extends flowModel
foreach ($withhold_cost as $key => $vo) { foreach ($withhold_cost as $key => $vo) {
//减去冻结金额 //减去冻结金额
$project=self::project($vo['cost_id']); $project=self::project(substr($vo['cbzxid'],0,strpos($vo['cbzxid'], "(")));
$cbzx_code= self::dept($project['data'][0]['jz_cur_dept']);
$cost_id= self::dept($project['data'][0]['jz_cur_dept']);
$sql = " cost_id='$cost_id' and status = 1 and is_default=1"; $sql = " cost_id='$cbzx_code' and status = 1 and is_default=1";
$fund_account_cost = m('c_fund_account')->getone($sql, 'id,freeze_amount'); $fund_account_cost = m('c_fund_account')->getone($sql, 'id,freeze_amount');
$id=$fund_account_cost['id']; $id=$fund_account_cost['id'];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论