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

测试付款单

上级 9ea24d4f
...@@ -41,34 +41,15 @@ class flow_oafkClassModel extends flowModel ...@@ -41,34 +41,15 @@ class flow_oafkClassModel extends flowModel
} }
} }
// $flowid=$this->getflow(); // $flowid=$this->getflow();
// $flowid['nowcheckname']//
// array(8) { if($flowid['nowcheckname']==$num){
// ["allcheckid"]=>
// string(25) "828,1081,997,737,989,1085"
// ["nowcourseid"]=>
// string(3) "601"
// ["nowcheckid"]=>
// string(3) "828"
// ["nowcheckname"]=>
// string(9) "杨振元"
// ["nstatustext"]=>
// string(18) "待杨振元处理"
// ["nstatus"]=>
// string(1) "0"
// ["status"]=>
// string(1) "0"
// ["isturn"]=>
// string(1) "1"
// }
// echo "<pre>";
// var_dump($this->rs);
$data = m('c_fund_details_fk')->getall('mid='.$this->rs['id'], 'id,cbzx_code,charge_amount'); $data = m('c_fund_details_fk')->getall('mid='.$this->rs['id'], 'id,cbzx_code,charge_amount');
foreach ($data as $key => $vo) { foreach ($data as $key => $vo) {
$cbzx_code=$vo['cbzx_code']; $cbzx_code=$vo['cbzx_code'];
$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,account_balance,freeze_amount');//查询账户表成本中心id $cost = m('c_fund_account')->getone($sql, 'id,account_balance,freeze_amount');//查询账户表成本中心id
$id=$cost['id']; $id=$cost['id'];
$c_withhold = array( $c_withhold = array(
'fund_account_id' => $id, 'fund_account_id' => $id,
'docnum' => $this->rs['docnum'], 'docnum' => $this->rs['docnum'],
...@@ -97,7 +78,7 @@ class flow_oafkClassModel extends flowModel ...@@ -97,7 +78,7 @@ class flow_oafkClassModel extends flowModel
} }
}
} }
} }
...@@ -106,60 +87,60 @@ class flow_oafkClassModel extends flowModel ...@@ -106,60 +87,60 @@ class flow_oafkClassModel extends flowModel
// protected function flowcheckfinsh($zt){ // protected function flowcheckfinsh($zt){
// $mid= $this->rs['id']; // $mid= $this->rs['id'];
// $datafk = m('c_fund_details_fk')->getall('mid='.$mid); // $datafk = m('c_fund_details_fk')->getall('mid='.$mid);
// foreach ($datafk as $key => $value) { // foreach ($datafk as $key => $value) {
// // 扣除账户余额 c_fund_account account_balance // // 扣除账户余额 c_fund_account account_balance
// $cbzxid= $value['cbzx_code']; // $cbzxid= $value['cbzx_code'];
// $model = 'c_fund_account'; // $model = 'c_fund_account';
// $sql = " cost_id ='$cbzxid' and status = 1 and is_default=1"; // $sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
// $data = m($model)->getone($sql,'id,name,account_balance'); // $data = m($model)->getone($sql,'id,name,account_balance');
// $zfarr = array( // $zfarr = array(
// 'account_balance' =>$data['account_balance']-$value['charge_amount'], // 'account_balance' =>$data['account_balance']-$value['charge_amount'],
// ); // );
// $id=$data['id']; // $id=$data['id'];
// m('c_fund_account')->update($zfarr,"`id`='$id'"); // m('c_fund_account')->update($zfarr,"`id`='$id'");
// // 成本中心 amount 变更 // // 成本中心 amount 变更
// $cbzx = substr($cbzxid,0,strrpos($cbzxid,"(")); // $cbzx = substr($cbzxid,0,strrpos($cbzxid,"("));
// $cbzxsql = " code ='$cbzx' and status = 1"; // $cbzxsql = " code ='$cbzx' and status = 1";
// $cbzxdata = m('c_cbzx')->getone($cbzxsql,'id,amount'); // $cbzxdata = m('c_cbzx')->getone($cbzxsql,'id,amount');
// $cbarr = array( // $cbarr = array(
// 'amount' =>$cbzxdata['amount']+$value['charge_amount'], // 'amount' =>$cbzxdata['amount']+$value['charge_amount'],
// ); // );
// m('c_cbzx')->update($cbarr,"`code`='$cbzx'"); // m('c_cbzx')->update($cbarr,"`code`='$cbzx'");
// //账户明细 c_account_detail // //账户明细 c_account_detail
// $account_detail=array( // $account_detail=array(
// 'account' => $data['name'], // 'account' => $data['name'],
// 'opt_type' => 2, // 'opt_type' => 2,
// 'amount' =>$value['charge_amount'], // 'amount' =>$value['charge_amount'],
// 'trans_numb' => $this->rs['docnum'], // 'trans_numb' => $this->rs['docnum'],
// 'account_balance' => $data['account_balance']-$value['charge_amount'], // 'account_balance' => $data['account_balance']-$value['charge_amount'],
// 'create_time' =>date("Y-m-d H:i:s"), // 'create_time' =>date("Y-m-d H:i:s"),
// 'uid' =>$this->rs['uid'], // 'uid' =>$this->rs['uid'],
// ); // );
// m('c_account_detail')->insert($account_detail); // m('c_account_detail')->insert($account_detail);
// // 业务付款8业务预付款10费用报销11 oa_c_fund_detail // // 业务付款8业务预付款10费用报销11 oa_c_fund_detail
// $fund_detail=array( // $fund_detail=array(
// 'trans_numb' =>$this->rs['docnum'], // 'trans_numb' =>$this->rs['docnum'],
// 'account' => $data['name'], // 'account' => $data['name'],
// 'toaccount' =>$this->rs['payee'], // 'toaccount' =>$this->rs['payee'],
// 'trans_amount' =>$value['charge_amount'], // 'trans_amount' =>$value['charge_amount'],
// 'business_type' =>8, // 'business_type' =>8,
// 'opt_type' =>2, // 'opt_type' =>2,
// 'account_balance'=>$data['account_balance']-$value['charge_amount'], // 'account_balance'=>$data['account_balance']-$value['charge_amount'],
// 'create_time' =>date("Y-m-d H:i:s"), // 'create_time' =>date("Y-m-d H:i:s"),
// 'uid' =>$this->rs['uid'], // 'uid' =>$this->rs['uid'],
// ); // );
// m('c_fund_detail')->insert($fund_detail); // m('c_fund_detail')->insert($fund_detail);
// } // }
// } // }
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论