提交 0ef48b92 authored 作者: fengzy's avatar fengzy

OA数据同步生产环境测试

上级 8ed4e081
......@@ -151,7 +151,6 @@ protected function flowcheckafter($zt, $sm){
$post_content = self::create_postdata($data);
$result = self::invoke_add($cloudUrl,$post_content,$cookie_jar);
$array = json_decode($result,true);
var_dump($array);
if($array['Result']['ResponseStatus']['IsSuccess']){
$num=$array['Result']['Number'];
......@@ -343,74 +342,7 @@ protected function flowcheckafter($zt, $sm){
// //流程全部完成后调用
protected function flowcheckfinsh($zt){
$docnum=$this->rs['docnum'];
$withhold_cost = m('c_withhold_yfk')->getall("docnum='$docnum' and status =1", 'id,cost_id,amount');
foreach ($withhold_cost as $key => $vo) {
// 扣除账户余额 c_fund_account account_balance
$cbzxid= $vo['cost_id'];
$model = 'c_fund_account';
$sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
$data = m($model)->getone($sql,'id,name,account_balance,freeze_amount');
$zfarr = array(
'account_balance' =>$data['account_balance']-$vo['amount'],
);
$id=$data['id'];
m('c_fund_account')->update($zfarr,"`id`='$id'");
$freeze = array(
'freeze_amount' => $data['freeze_amount'] - $vo['amount'],
);
m('c_fund_account')->update($freeze, "`id`='$id'");
// 成本中心 amount 变更
$cbzx = substr($cbzxid,0,strrpos($cbzxid,"("));
$cbzxsql = " code ='$cbzx' and status = 1";
$cbzxdata = m('c_cbzx')->getone($cbzxsql,'id,amount');
$cbarr = array(
'amount' =>$cbzxdata['amount']+$vo['amount'],
);
m('c_cbzx')->update($cbarr,"`code`='$cbzx'");
//账户明细 c_account_detail
$account_detail=array(
'account' => $data['name'],
'opt_type' => 2,
'amount' =>$vo['amount'],
'trans_numb' => $this->rs['docnum'],
'account_balance' => $data['account_balance']-$vo['amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
);
m('c_account_detail')->insert($account_detail);
// 业务付款8业务预付款10费用报销11 oa_c_fund_detail
$fund_detail=array(
'trans_numb' =>$this->rs['docnum'],
'account' => $data['name'],
'toaccount' =>$this->rs['payee'],
'trans_amount' =>$vo['amount'],
'business_type' =>10,
'opt_type' =>2,
'account_balance'=>$data['account_balance']-$vo['amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
);
m('c_fund_detail')->insert($fund_detail);
}
}
......
......@@ -98,7 +98,7 @@ class openemClassAction extends openapiAction
'nowcheckname' => NULL,
'nstatustext' => '尹再伟处理同意',
);
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
m('flow_bill')->update($zfarr,"`table`='c_emfk' and mid=".$datalist['id']);
$addarr = array(
'table' => 'c_emfk',
......@@ -123,7 +123,7 @@ class openemClassAction extends openapiAction
$this->sendMess(1,3);
m('flow_log')->insert($addarr);
$docnum= $datalist['docnum'];
$withhold_cost = m('c_withhold_emfk')->getall("docnum='$docnum' and status =1", 'id,cost_id,amount');
$withhold_cost = m('c_withhold_emfk')->getall("docnum='$docnum' and status =1", 'id,uid,cost_id,amount');
foreach ($withhold_cost as $key => $vo) {
// 扣除账户余额 c_fund_account account_balance
......@@ -224,7 +224,7 @@ class openemClassAction extends openapiAction
'nowcheckname' => NULL,
'nstatustext' => '尹再伟处理同意',
);
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
m('flow_bill')->update($zfarr,"`table`='c_emfk' and mid=".$datalist['id']);
$addarr = array(
'table' => 'c_emfk',
......@@ -249,7 +249,7 @@ class openemClassAction extends openapiAction
m('flow_log')->insert($addarr);
$this->sendMess(1,3);
$docnum= $datalist['docnum'];
$withhold_cost = m('c_withhold_emfk')->getall("docnum='$docnum' and status =1", 'id,cost_id,amount');
$withhold_cost = m('c_withhold_emfk')->getall("docnum='$docnum' and status =1", 'id,cost_id,uid,amount');
foreach ($withhold_cost as $key => $vo) {
// 扣除账户余额 c_fund_account account_balance
......
......@@ -96,7 +96,7 @@ class openfinfybxClassAction extends openapiAction
'nowcheckname' => NULL,
'nstatustext' => '尹再伟处理同意',
);
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
m('flow_bill')->update($zfarr,"`table`='fininfom' and mid=".$datalist['id']);
$addarr = array(
'table' => 'fininfom',
......@@ -220,7 +220,7 @@ class openfinfybxClassAction extends openapiAction
'nowcheckname' => NULL,
'nstatustext' => '尹再伟处理同意',
);
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
m('flow_bill')->update($zfarr,"`table`='fininfom' and mid=".$datalist['id']);
$addarr = array(
'table' => 'fininfom',
......
......@@ -121,8 +121,8 @@ class openoafkClassAction extends openapiAction
'iszb' =>0
);
m('flow_log')->insert($addarr);
$docnum= $datalist['docnum'];
$withhold_cost = m('c_withhold')->getall("docnum='$docnum' and status =1", 'id,cost_id,amount');
$docnum= $datalist['docnum'];
$withhold_cost = m('c_withhold')->getall("docnum='$docnum' and status =1", 'id,uid,cost_id,amount');
foreach ($withhold_cost as $key => $vo) {
// 扣除账户余额 c_fund_account account_balance
......@@ -158,10 +158,10 @@ class openoafkClassAction extends openapiAction
'account' => $data['name'],
'opt_type' => 2,
'amount' =>$vo['amount'],
'trans_numb' => $this->rs['docnum'],
'trans_numb' => $docnum,
'account_balance' => $data['account_balance']-$vo['amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
'uid' =>$vo['uid'],
);
m('c_account_detail')->insert($account_detail);
......@@ -170,15 +170,15 @@ class openoafkClassAction extends openapiAction
$fund_detail=array(
'trans_numb' =>$this->rs['docnum'],
'trans_numb' =>$docnum,
'account' => $data['name'],
'toaccount' =>$this->rs['payee'],
'toaccount' =>$datalist['payee'],
'trans_amount' =>$vo['amount'],
'business_type' =>8,
'opt_type' =>2,
'account_balance'=>$data['account_balance']-$vo['amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
'uid' =>$vo['uid'],
);
m('c_fund_detail')->insert($fund_detail);
......@@ -243,7 +243,7 @@ class openoafkClassAction extends openapiAction
);
m('flow_log')->insert($addarr);
$docnum= $datalist['docnum'];
$withhold_cost = m('c_withhold')->getall("docnum='$docnum' and status =1", 'id,cost_id,amount');
$withhold_cost = m('c_withhold')->getall("docnum='$docnum' and status =1", 'id,uid,cost_id,amount');
foreach ($withhold_cost as $key => $vo) {
// 扣除账户余额 c_fund_account account_balance
......@@ -279,10 +279,10 @@ class openoafkClassAction extends openapiAction
'account' => $data['name'],
'opt_type' => 2,
'amount' =>$vo['amount'],
'trans_numb' => $this->rs['docnum'],
'trans_numb' => $docnum,
'account_balance' => $data['account_balance']-$vo['amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
'uid' =>$vo['uid'],
);
m('c_account_detail')->insert($account_detail);
......@@ -291,15 +291,15 @@ class openoafkClassAction extends openapiAction
$fund_detail=array(
'trans_numb' =>$this->rs['docnum'],
'trans_numb' =>$docnum,
'account' => $data['name'],
'toaccount' =>$this->rs['payee'],
'toaccount' =>$datalist['payee'],
'trans_amount' =>$vo['amount'],
'business_type' =>8,
'opt_type' =>2,
'account_balance'=>$data['account_balance']-$vo['amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
'uid' =>$vo['uid'],
);
m('c_fund_detail')->insert($fund_detail);
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论