Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
OA
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
OA
Commits
66a3d0bf
提交
66a3d0bf
authored
7月 24, 2020
作者:
fengzy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'费用报销借款抵扣冲销'
上级
450d170e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
147 行增加
和
1 行删除
+147
-1
commonModel.php
webmain/model/commonModel.php
+8
-0
finfybxModel.php
webmain/model/flow/finfybxModel.php
+139
-1
没有找到文件。
webmain/model/commonModel.php
浏览文件 @
66a3d0bf
...
...
@@ -152,4 +152,12 @@ class CommonClassModel extends Model
$data
=
m
(
'assetm'
)
->
getall
(
'state = 0'
,
'id as value, CONCAT(num, "(",title,")") as name'
);
return
$data
;
}
//借款单(已审核)
public
function
getfingrjkList
()
{
$data
=
m
(
'c_fininfom_jk'
)
->
getall
(
'status = 1'
,
'id as value, CONCAT(docnum, "金额:(",amount,")") as name'
);
return
$data
;
}
}
webmain/model/flow/finfybxModel.php
浏览文件 @
66a3d0bf
...
...
@@ -12,7 +12,81 @@ class flow_finfybxClassModel extends flowModel
return
$arr
;
}
//提交时调用
protected
function
flowsubmit
(
$na
,
$sm
){
if
(
$this
->
rs
[
'dikouid'
]){
$dikouid
=
$this
->
rs
[
'dikouid'
];
if
(
strpos
(
$dikouid
,
','
)
!==
false
){
$jk_num
=
explode
(
","
,
$dikouid
);
foreach
(
$jk_num
as
$key
=>
$value
){
if
(
$this
->
rs
[
'money'
]
==
0
){
break
;
}
$jk_num
=
substr
(
$value
,
0
,
strrpos
(
$value
,
'金'
));
$sql
=
" docnum ='
$jk_num
' "
;
$fininfom_jk
=
m
(
'c_fininfom_jk'
)
->
getone
(
$sql
,
'balance'
);
//金额
$docnum
=
$this
->
rs
[
'docnum'
];
if
(
$this
->
rs
[
'money'
]
>=
$fininfom_jk
[
'balance'
]){
$dk_amount
=
$fininfom_jk
[
'balance'
];
}
else
{
$dk_amount
=
$this
->
rs
[
'money'
];
}
$this
->
rs
[
'money'
]
=
$this
->
rs
[
'money'
]
-
$dk_amount
;
$deduct_detail
=
array
(
'jk_num'
=>
$jk_num
,
'bx_num'
=>
$docnum
,
'dk_amount'
=>
$dk_amount
,
'status'
=>
0
,
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
);
m
(
'c_deduct_detail'
)
->
insert
(
$deduct_detail
);
}
}
else
{
$jk_num
=
substr
(
$dikouid
,
0
,
strrpos
(
$dikouid
,
'金'
));
$sql
=
" docnum ='
$jk_num
' "
;
$fininfom_jk
=
m
(
'c_fininfom_jk'
)
->
getone
(
$sql
,
'balance'
);
//金额
$docnum
=
$this
->
rs
[
'docnum'
];
if
(
$this
->
rs
[
'money'
]
>=
$fininfom_jk
[
'balance'
]){
$dk_amount
=
$fininfom_jk
[
'balance'
];
}
else
{
$dk_amount
=
$this
->
rs
[
'money'
];
}
m
(
'c_fininfom_jk'
)
->
update
(
$jkbalance
,
"`docnum`='
$jk_num
'"
);
$deduct_detail
=
array
(
'jk_num'
=>
$jk_num
,
'bx_num'
=>
$docnum
,
'dk_amount'
=>
$dk_amount
,
'status'
=>
0
,
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
);
m
(
'c_deduct_detail'
)
->
insert
(
$deduct_detail
);
}
}
}
//二级 或一级审批同意之后进行预扣款
protected
function
flowcheckbefore
(
$zt
,
$sm
){
...
...
@@ -472,6 +546,70 @@ class flow_finfybxClassModel extends flowModel
);
m
(
'c_fund_detail'
)
->
insert
(
$fund_detail
);
}
if
(
$this
->
rs
[
'dikouid'
]){
$dikouid
=
$this
->
rs
[
'dikouid'
];
if
(
strpos
(
$dikouid
,
','
)
!==
false
){
$jk_num
=
explode
(
","
,
$dikouid
);
foreach
(
$jk_num
as
$key
=>
$value
){
if
(
$this
->
rs
[
'money'
]
==
0
){
break
;
}
$jk_num
=
substr
(
$value
,
0
,
strrpos
(
$value
,
'金'
));
$sql
=
" docnum ='
$jk_num
' "
;
$fininfom_jk
=
m
(
'c_fininfom_jk'
)
->
getone
(
$sql
,
'balance'
);
//金额
$docnum
=
$this
->
rs
[
'docnum'
];
if
(
$this
->
rs
[
'money'
]
>=
$fininfom_jk
[
'balance'
]){
$jkbalance
=
array
(
'balance'
=>
0
,
);
}
else
{
$jkbalance
=
array
(
'balance'
=>
$fininfom_jk
[
'balance'
]
-
$this
->
rs
[
'money'
],
);
}
$this
->
rs
[
'money'
]
=
$this
->
rs
[
'money'
]
-
$fininfom_jk
[
'balance'
];
m
(
'c_fininfom_jk'
)
->
update
(
$jkbalance
,
"`docnum`='
$jk_num
'"
);
$deduct_status
=
array
(
'status'
=>
1
,
);
m
(
'c_deduct_detail'
)
->
update
(
$deduct_status
,
"`bx_num`='
$docnum
' and status=0"
);
}
}
else
{
$docnum
=
$this
->
rs
[
'docnum'
];
$jk_num
=
substr
(
$dikouid
,
0
,
strrpos
(
$dikouid
,
'金'
));
$sql
=
" docnum ='
$jk_num
' "
;
$fininfom_jk
=
m
(
'c_fininfom_jk'
)
->
getone
(
$sql
,
'balance'
);
//金额
$docnum
=
$this
->
rs
[
'docnum'
];
if
(
$this
->
rs
[
'money'
]
>=
$fininfom_jk
[
'balance'
]){
$jkbalance
=
array
(
'balance'
=>
0
,
);
}
else
{
$jkbalance
=
array
(
'balance'
=>
$fininfom_jk
[
'balance'
]
-
$this
->
rs
[
'money'
],
);
}
m
(
'c_fininfom_jk'
)
->
update
(
$jkbalance
,
"`docnum`='
$jk_num
'"
);
$deduct_status
=
array
(
'status'
=>
1
,
'update_time'
=>
date
(
"Y-m-d H:i:s"
),
);
m
(
'c_deduct_detail'
)
->
update
(
$deduct_status
,
"`bx_num`='
$docnum
' and status=0"
);
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论