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

'调整费用报销与借款单逻辑'

上级 cbdd31ce
......@@ -21,15 +21,38 @@ class flow_finfybxClassModel extends flowModel
if($this->rs['dikouid']){
$dikouid = $this->rs['dikouid'];
if(strpos($dikouid,',') !== false){
$jk_num=explode(",",$dikouid);
foreach ($jk_num as $key => $value ){
if($this->rs['money'] ==0 ){
break;
}
$jk_num=substr($value,0,strrpos($value,'金'));
$sql = " docnum ='$jk_num' ";
$fininfom_jk = m('c_fininfom_jk')->getone($sql,'amount');//金额
$docnum=$this->rs['docnum'];
if($this->rs['money'] >= $fininfom_jk['amount']){
$jkbalance = array(
'balance' => 0,
);
$dk_amount=$fininfom_jk['amount'];
}else{
$jkbalance = array(
'balance' => $fininfom_jk['amount']-$this->rs['money'],
);
$dk_amount=$this->rs['money'];
}
$this->rs['money']=$this->rs['money']-$dk_amount;
$jkbalance = array(
'balance' => $fininfom_jk['amount']-$this->rs['money'],
);
......@@ -39,7 +62,7 @@ class flow_finfybxClassModel extends flowModel
$deduct_detail = array(
'jk_num' => $jk_num,
'bx_num' => $docnum,
'dk_amount' => $this->rs['money'],
'dk_amount' =>$dk_amount,
'status' =>0,
'create_time' => date("Y-m-d H:i:s"),
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论