Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
OA
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
OA
Commits
9fb21e23
提交
9fb21e23
authored
7月 23, 2020
作者:
fengzy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'调整费用报销与借款单逻辑'
上级
9dffc88b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
68 行增加
和
69 行删除
+68
-69
emfkModel.php
webmain/model/flow/emfkModel.php
+68
-69
没有找到文件。
webmain/model/flow/emfkModel.php
浏览文件 @
9fb21e23
...
...
@@ -27,9 +27,7 @@ class flow_emfkClassModel extends flowModel
*/
protected
function
flowcheckafter
(
$zt
,
$sm
){
if
(
$zt
==
2
){
var_dump
(
$this
->
updatestatus
(
5
));
die
;
$this
->
updatestatus
(
5
));
$this
->
sendMess
(
0
,
9
);
}
}
...
...
@@ -161,7 +159,7 @@ class flow_emfkClassModel extends flowModel
$status
=
array
(
'status'
=>
0
,
'status'
=>
9
,
);
m
(
'c_withhold_emfk'
)
->
update
(
$status
,
"docnum='
$docnum
'"
);
}
...
...
@@ -169,71 +167,71 @@ class flow_emfkClassModel extends flowModel
//流程全部完成后调用
//
protected function flowcheckfinsh($zt){
//
//
$docnum=$this->rs['docnum'];
//
$withhold_cost = m('c_withhold_emfk')->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['applicant'],
//
'trans_amount' =>$vo['amount'],
//
'business_type' =>12,
//
'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);
//
}
//
}
protected
function
flowcheckfinsh
(
$zt
){
$docnum
=
$this
->
rs
[
'docnum'
];
$withhold_cost
=
m
(
'c_withhold_emfk'
)
->
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
);
// 电费12
$fund_detail
=
array
(
'trans_numb'
=>
$this
->
rs
[
'docnum'
],
'account'
=>
$data
[
'name'
],
'toaccount'
=>
$this
->
rs
[
'applicant'
],
'trans_amount'
=>
$vo
[
'amount'
],
'business_type'
=>
12
,
'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
);
}
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论