提交 5919c1c8 authored 作者: wangkr's avatar wangkr

合并分支 'release' 到 'master'

Release 查看合并请求 PHP/OA!32
......@@ -48,9 +48,14 @@ class mode_contract_listClassAction extends inputAction{
$sql = ' number = "'.$numb .'"';
$cdata = m($model)->getone($sql,'id,name');
$sql = "select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]".$model."_bank_info where mid = ".$cdata['id'];
$data = $this->db->getall($sql);
if($cdata){
$sql = "select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]".$model."_bank_info where mid = ".$cdata['id'];
$data = $this->db->getall($sql);
}else{
$data=[];
}
$this->returnjson($data);
}
......
......@@ -6,14 +6,23 @@
class mode_finfybxClassAction extends inputAction{
protected function savebefore($table, $arr, $id, $addbo){
}
// protected function savebefore($table, $arr, $id, $addbo){
// $cbzxid= $arr['cbzxid'];
// $model = 'c_fund_account';
// $sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
// $data = m($model)->getone($sql,'id,account_balance');
// if(!$data){
// return "未检测到该成本中心默认扣款账户";
// }
// // if($data['account_balance'] < $arr['amountOfThisPayment']){
// // return "账户余额不足";
// // }
// }
protected function saveafter($table, $arr, $id, $addbo){
}
public function getlastAjax()
{
......
......@@ -13,7 +13,21 @@ class mode_oafkClassAction extends inputAction{
* return array('msg'=>'错误提示内容','rows'=> array()) 可返回空字符串,或者数组 rows 是可同时保存到数据库上数组
*/
protected function savebefore($table, $arr, $id, $addbo){
// $cbzxid= $arr['cbzx_code'];
// $model = 'c_fund_account';
// $sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
// // var_dump($sql);die;
// $data = m($model)->getone($sql,'id,account_balance');
// if(!$data){
// return "未检测到该成本中心默认扣款账户";
// }
// if($data['account_balance'] < $arr['amountOfThisPayment']){
// return "账户余额不足";
// }
}
/**
......@@ -23,9 +37,7 @@ class mode_oafkClassAction extends inputAction{
* $id Int 对应表上记录Id
* $addbo Boolean 是否添加时
*/
protected function saveafter($table, $arr, $id, $addbo){
}
public function getbankinfoAjax()
{
......
......@@ -12,19 +12,44 @@ class mode_oayfkClassAction extends inputAction{
* $addbo Boolean 是否添加时
* return array('msg'=>'错误提示内容','rows'=> array()) 可返回空字符串,或者数组 rows 是可同时保存到数据库上数组
*/
protected function savebefore($table, $arr, $id, $addbo){
protected function savebefore($table, $arr, $id, $addbo){
// if($data['account_balance'] < $arr['amountOfThisPayment']){
// return "账户余额不足";
// }
}
// protected function savesubbefore($data,$tables){
// if($tables == 'c_fund_details_yfk'){
// if (count($data) > 1) {
// foreach ($data as $key => $value) {
// $cbzxid= $value['cbzx_code'];
// $model = 'c_fund_account';
// $sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
// $data = m($model)->getone($sql,'id,account_balance');
// if($data===false){
// return "未检测到该成本中心默认扣款账户";
// }
// }
// }else{
// $cbzxid= $data['cbzx_code'];
// $model = 'c_fund_account';
// $sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
// $data = m($model)->getone($sql,'id,account_balance');
// if($data===false){
// return "未检测到该成本中心默认扣款账户";
// }
// }
// }
// return $data;
// }
/**
* 重写函数:保存后处理,主要保存其他表数据
* $table String 对应表名
* $arr Array 表单参数
* $id Int 对应表上记录Id
* $addbo Boolean 是否添加时
*/
protected function saveafter($table, $arr, $id, $addbo){
}
}
\ No newline at end of file
差异被折叠。
......@@ -13,14 +13,70 @@ class flow_finfybxClassModel extends flowModel
{
$arr["$sid"] = "982";
$arr["$sna"] ="ε";
$arr["$sna"] ="εÑàéª";
}
return $arr;
}
//流程全部完成后调用
protected function flowcheckfinsh($zt){
// 扣除账户余额 c_fund_account account_balance
$cbzxid= $this->rs['cbxmid'];
$model = 'c_fund_account';
$sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
$data = m($model)->getone($sql,'id,name,account_balance');
$zfarr = array(
'account_balance' =>$data['account_balance']-$this->rs['money'],
);
$id=$data['id'];
m('c_fund_account')->update($zfarr,"`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']+$this->rs['money'],
);
m('c_cbzx')->update($cbarr,"`code`='$cbzx'");
//账户明细 c_account_detail
$account_detail=array(
'account' => $data['name'],
'opt_type' => 2,
'amount' =>$this->rs['money'],
'trans_numb' => $this->rs['docnum'],
'account_balance' => $data['account_balance']-$this->rs['money'],
'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' =>'',
'trans_amount' =>$this->rs['money'],
'business_type' =>11,
'opt_type' =>2,
'account_balance'=>$data['account_balance']-$this->rs['money'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
);
m('c_fund_detail')->insert($fund_detail);
}
}
\ No newline at end of file
......@@ -18,19 +18,19 @@ class flow_fund_depositClassModel extends flowModel
//提交时调用
protected function flowsubmit($na, $sm){
$name=$this->rs['toaccount'];
$data=m('c_fund_account')->getone("`name`='$name'");
$zfarr = array(
'account_balance' =>$this->rs['trans_amount']+$data['account_balance'],
);
m('c_fund_account')->update($zfarr,"`name`='$name'");
$id=$this->rs['id'];
$account_balance=$this->rs['trans_amount']+$data['account_balance'];//当前余额
$detail = array(
'account_balance' =>$account_balance,
);
m('c_fund_detail')->update($detail,"`id`='$id'");
$name=$this->rs['toaccount'];
$data=m('c_fund_account')->getone("`name`='$name'");
$zfarr = array(
'account_balance' =>$this->rs['trans_amount']+$data['account_balance'],
);
m('c_fund_account')->update($zfarr,"`name`='$name'");
$id=$this->rs['id'];
$account_balance=$this->rs['trans_amount']+$data['account_balance'];//当前余额
$detail = array(
'account_balance' =>$account_balance,
);
m('c_fund_detail')->update($detail,"`id`='$id'");
......@@ -42,6 +42,7 @@ class flow_fund_depositClassModel extends flowModel
'account_balance' =>$data['account_balance']+$this->rs['trans_amount'],
'trans_numb' => $this->rs['trans_numb'],
'create_time' =>$this->rs['create_time'],
'uid' =>$this->rs['uid'],
);
m('c_account_detail')->insert($toacc_detail);
......
......@@ -76,6 +76,7 @@ class flow_fund_transferClassModel extends flowModel
'account_balance' =>$data['account_balance']-$this->rs['trans_amount'],
'trans_numb' => $this->rs['trans_numb'],
'create_time' =>$this->rs['create_time'],
'uid' =>$this->rs['uid'],
);
m('c_account_detail')->insert($acc_detail);
......@@ -86,6 +87,7 @@ class flow_fund_transferClassModel extends flowModel
'account_balance' =>$toaccount_list['account_balance']+$this->rs['trans_amount'],
'trans_numb' => $this->rs['trans_numb'],
'create_time' =>$this->rs['create_time'],
'uid' =>$this->rs['uid'],
);
m('c_account_detail')->insert($toacc_detail);
......
......@@ -8,4 +8,66 @@ class flow_oafkClassModel extends flowModel
if($rs['contractNumber']) $rs['contractNumber'] = $this->getContractByTag($rs['contractNumber']);
return $rs;
}
//流程全部完成后调用
protected function flowcheckfinsh($zt){
$mid= $this->rs['id'];
$datafk = m('c_fund_details_fk')->getall('mid='.$mid);
foreach ($datafk as $key => $value) {
// 扣除账户余额 c_fund_account account_balance
$cbzxid= $value['cbzx_code'];
$model = 'c_fund_account';
$sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
$data = m($model)->getone($sql,'id,name,account_balance');
$zfarr = array(
'account_balance' =>$data['account_balance']-$value['charge_amount'],
);
$id=$data['id'];
m('c_fund_account')->update($zfarr,"`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']+$value['charge_amount'],
);
m('c_cbzx')->update($cbarr,"`code`='$cbzx'");
//账户明细 c_account_detail
$account_detail=array(
'account' => $data['name'],
'opt_type' => 2,
'amount' =>$value['charge_amount'],
'trans_numb' => $this->rs['docnum'],
'account_balance' => $data['account_balance']-$value['charge_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' =>$value['charge_amount'],
'business_type' =>8,
'opt_type' =>2,
'account_balance'=>$data['account_balance']-$value['charge_amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
);
m('c_fund_detail')->insert($fund_detail);
}
}
}
\ No newline at end of file
......@@ -8,4 +8,66 @@ class flow_oayfkClassModel extends flowModel
if($rs['contractNumber']) $rs['contractNumber'] = $this->getContractByTag($rs['contractNumber']);
return $rs;
}
//流程全部完成后调用
protected function flowcheckfinsh($zt){
$mid= $this->rs['id'];
$datafk = m('c_fund_details_yfk')->getall('mid='.$mid);
foreach ($datafk as $key => $value) {
// 扣除账户余额 c_fund_account account_balance
$cbzxid= $value['cbzx_code'];
$model = 'c_fund_account';
$sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
$data = m($model)->getone($sql,'id,name,account_balance');
$zfarr = array(
'account_balance' =>$data['account_balance']-$value['charge_amount'],
);
$id=$data['id'];
m('c_fund_account')->update($zfarr,"`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']+$value['charge_amount'],
);
m('c_cbzx')->update($cbarr,"`code`='$cbzx'");
//账户明细 c_account_detail
$account_detail=array(
'account' => $data['name'],
'opt_type' => 2,
'amount' =>$value['charge_amount'],
'trans_numb' => $this->rs['docnum'],
'account_balance' => $data['account_balance']-$value['charge_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' =>$value['charge_amount'],
'business_type' =>10,
'opt_type' =>2,
'account_balance'=>$data['account_balance']-$value['charge_amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
);
m('c_fund_detail')->insert($fund_detail);
}
}
}
\ No newline at end of file
......@@ -298,7 +298,10 @@ class loginClassModel extends Model
//删除redis
$redis = new Redis();
$redis->connect('192.168.1.70',6379);
$host = getconfig("redis_host");
$port = getconfig("redis_port");
$redis->connect($host,$port);
$sid = 'PHPREDIS_SESSION:'.$cookieSid;
$redis->delete($sid);
$redis->close();
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论