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

测试付款单

上级 1510916a
......@@ -74,35 +74,34 @@ class flow_oafkClassModel extends flowModel
$data = m('c_fund_details_fk')->getall('mid='.$this->rs['id'], 'id,cbzx_code,charge_amount');
foreach ($data as $key => $vo) {
$docnum=$this->rs['docnum'];
$withhold_cost = m('c_withhold')->getall("docnum='$docnum'", 'id,amount');
foreach ($withhold_cost as $key => $vo) {
//将单据状态作废余额
$status = array(
'status' => 0,
);
$docnum=$this->rs['docnum'];
m('c_withhold')->update($status, "docnum='$docnum'");
m('c_withhold')->update($status, "docnum='$docnum'");
//减去冻结金额
$cbzx_code=$vo['cbzx_code'];
$withhold_cost = m('c_withhold')->getall("docnum='$docnum'", 'id,amount');
var_dump($withhold_cost);
$sql = " cost_id='$cbzx_code' and status = 1 and is_default=1";
$cost_id=$vo['cost_id'];
$sql = " cost_id='$cost_id' and status = 1 and is_default=1";
$fund_account_cost = m('c_fund_account')->getone($sql, 'id,freeze_amount');
$id=$fund_account_cost['id'];
$freeze = array(
'freeze_amount' => $fund_account_cost['freeze_amount'] - $withhold_cost['amount'],
'freeze_amount' => $fund_account_cost['freeze_amount'] - $vo['amount'],
);
m('c_fund_account')->update($freeze, "`id`='$id'");
}
}
}
}
//流程全部完成后调用
// protected function flowcheckfinsh($zt){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论