Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
OA
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
OA
Commits
dff6b6e3
提交
dff6b6e3
authored
8月 31, 2020
作者:
fengzy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
费用报销脚本
上级
b4c239a6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
74 行增加
和
34 行删除
+74
-34
emfkModel.php
webmain/model/flow/emfkModel.php
+73
-33
projectfkModel.php
webmain/model/flow/projectfkModel.php
+1
-1
没有找到文件。
webmain/model/flow/emfkModel.php
浏览文件 @
dff6b6e3
...
...
@@ -14,6 +14,25 @@ class flow_emfkClassModel extends flowModel
9
=>
'审核失败'
,
];
protected
function
flowzuofeibill
(
$sm
){
$this
->
updatestatus
(
5
);
$this
->
sendMess
(
0
,
9
);
}
//删除单据时调用
protected
function
flowdeletebill
(
$sm
){
$this
->
updatestatus
(
5
);
$this
->
sendMess
(
0
,
9
);
}
//流程全部完成后调用
protected
function
flowcheckfinsh
(
$zt
){
$this
->
sendMess
(
1
,
3
);
}
/**
* 审核时触发
...
...
@@ -40,11 +59,11 @@ class flow_emfkClassModel extends flowModel
foreach
(
$oa_fininfos
as
$k
=>
$value
)
{
foreach
(
$value
as
$key
=>
$val
)
{
switch
(
$key
)
{
//
case 'charge_type':
//
// $arr['FPAYBILLENTRY'][$k]['FCOSTID']['FNUMBER']=self::getb
xlx($val);
//
//
break;
case
'charge_type'
:
$arr
[
'FPAYBILLENTRY'
][
$k
][
'F_KXType'
][
'FNUMBER'
]
=
self
::
getk
xlx
(
$val
);
break
;
case
'cbzxid'
:
...
...
@@ -83,7 +102,7 @@ class flow_emfkClassModel extends flowModel
}
$cloudUrl
=
"http://
36.110.39
.211/k3cloud/"
;
$cloudUrl
=
"http://
192.168.1
.211/k3cloud/"
;
//登陆参数
$data
=
array
(
'5e64f6ff0bd47f'
,
//帐套Id
...
...
@@ -172,7 +191,8 @@ class flow_emfkClassModel extends flowModel
$model
[
'Model'
][
'FRECTUNIT'
][
'FNumber'
]
=
$supplier
[
'number'
];
$model
[
'Model'
][
'FPAYBILLENTRY'
]
=
$arr
[
'FPAYBILLENTRY'
];
$model
[
'Model'
][
'FDepartment'
][
'FNumber'
]
=
self
::
deptname
(
$applicationdpt
);
$model
[
'Model'
][
'FSETTLEORGID'
][
'FNumber'
]
=
self
::
getorg
(
$this
->
rs
[
'org'
]);
$model
[
'Model'
][
'FPAYORGID'
][
'FNumber'
]
=
self
::
getorg
(
$this
->
rs
[
'org'
]);
$data_model
=
json_encode
(
$model
);
$data
=
array
(
'AP_PAYBILL'
,
//业务对象标识FormId
...
...
@@ -182,25 +202,14 @@ class flow_emfkClassModel extends flowModel
$post_content
=
self
::
create_postdata
(
$data
);
$result
=
self
::
invoke_add
(
$cloudUrl
,
$post_content
,
$cookie_jar
);
$array
=
json_decode
(
$result
,
true
);
$num
=
$array
[
'Result'
][
'Number'
];
if
(
$array
[
'Result'
][
'ResponseStatus'
][
'IsSuccess'
]){
$num
=
$array
[
'Result'
][
'Number'
];
$this
->
update
(
"`fbillno`='
$num
'"
,
$this
->
rs
[
'id'
]);
$this
->
erplog
(
$this
->
rs
[
'docnum'
],
'c_emfk'
,
'保存成功'
,
json_encode
(
$array
),
date
(
"Y-m-d H:i:s"
),
2
,
$num
,
$array
[
'Result'
][
'Id'
],
1
);
if
(
$this
->
emfk_submit
(
$cloudUrl
,
$cookie_jar
,
$array
[
'Result'
][
'Id'
],
$array
[
'Result'
][
'Number'
])){
$this
->
erplog
(
$this
->
rs
[
'docnum'
],
'c_emfk'
,
'提交成功'
,
json_encode
(
$array
),
date
(
"Y-m-d H:i:s"
),
2
,
$num
,
$array
[
'Result'
][
'Id'
],
2
);
}
else
{
$this
->
erplog
(
$this
->
rs
[
'docnum'
],
'c_emfk'
,
'提交失败'
,
json_encode
(
$array
),
date
(
"Y-m-d H:i:s"
),
1
,
$num
,
$array
[
'Result'
][
'Id'
],
2
);
}
}
else
{
$this
->
erplog
(
$this
->
rs
[
'docnum'
],
'c_emfk'
,
'保存失败'
,
json_encode
(
$array
),
date
(
"Y-m-d H:i:s"
),
1
,
$num
,
$array
[
'Result'
][
'Id'
],
1
);
...
...
@@ -253,6 +262,20 @@ class flow_emfkClassModel extends flowModel
m
(
'log'
)
->
addlog
(
'电费付款'
,
'接口返回信息:'
.
$res
);
}
static
function
getorg
(
$name
)
{
$data
=
m
(
'option'
)
->
getone
(
"num='organization'"
,
'id,name'
);
$orglist
=
m
(
'option'
)
->
getone
(
"pid='"
.
$data
[
'id'
]
.
"' and name='"
.
$name
.
"'"
,
'name,num'
);
return
$orglist
[
'num'
];
}
static
function
getkxlx
(
$name
)
{
$data
=
m
(
'option'
)
->
getone
(
"num='kxtype'"
,
'id,name'
);
$kxlxlist
=
m
(
'option'
)
->
getone
(
"pid='"
.
$data
[
'id'
]
.
"' and name='"
.
$name
.
"'"
,
'name,num'
);
return
$kxlxlist
[
'num'
];
}
public
static
function
dept
(
$data
)
{
$sql
=
" id= '
$data
'"
;
...
...
@@ -309,25 +332,43 @@ class flow_emfkClassModel extends flowModel
if
(
$flowid
[
'nowcheckid'
]
==
$checkid
){
$data
=
m
(
'c_emfk_details'
)
->
getall
(
'mid='
.
$this
->
rs
[
'id'
],
'id,cbzxid,amount'
);
foreach
(
$data
as
$key
=>
$vo
)
{
$project
=
self
::
project
(
$vo
[
'cbzxid'
]);
foreach
(
$data
as
$v
){
if
(
!
isset
(
$ret
[
$v
[
'cbzxid'
]])){
$ret
[
$v
[
'cbzxid'
]]
=
$v
;
}
else
{
$ret
[
$v
[
'cbzxid'
]][
'amount'
]
+=
$v
[
'amount'
];
}
}
$ret
=
array_values
(
$ret
);
foreach
(
$ret
as
$key
=>
$vo
)
{
$project
=
self
::
project
(
$vo
[
'cbzxid'
]);
$cbzx_code
=
self
::
dept
(
$project
[
'data'
][
0
][
'jz_cur_dept'
]);
$sql
=
" cost_id='
$cbzx_code
' and status = 1 and is_default=1"
;
$cost
=
m
(
'c_fund_account'
)
->
getone
(
$sql
,
'id,type,name,freeze_amount,account_balance'
);
//查询账户表成本中心id
if
(
$cost
[
'type'
]
==
'1'
){
if
((
$cost
[
'account_balance'
]
-
$cost
[
'freeze_amount'
])
<
$vo
[
'amount'
]){
return
$cost
[
'name'
]
.
"余额不足"
;
die
;
}
if
((
$cost
[
'account_balance'
]
-
$cost
[
'freeze_amount'
])
<
$vo
[
'amount'
]){
return
$cost
[
'name'
]
.
"余额不足"
;
die
;
}
$id
=
$cost
[
'id'
];
}
foreach
(
$data
as
$ke
=>
$value
)
{
$project
=
self
::
project
(
$value
[
'cbzxid'
]);
$cbzx_code
=
self
::
dept
(
$project
[
'data'
][
0
][
'jz_cur_dept'
]);
$sql
=
" cost_id='
$cbzx_code
' and status = 1 and is_default=1"
;
$cost
=
m
(
'c_fund_account'
)
->
getone
(
$sql
,
'id,type,name,freeze_amount,account_balance'
);
//查询账户表成本中心id
$id
=
$cost
[
'id'
];
$c_withhold
=
array
(
'fund_account_id'
=>
$id
,
'docnum'
=>
$this
->
rs
[
'docnum'
],
'cost_id'
=>
$v
o
[
'cbzxid'
],
'amount'
=>
$v
o
[
'amount'
],
'cost_id'
=>
$v
alue
[
'cbzxid'
],
'amount'
=>
$v
alue
[
'amount'
],
'status'
=>
1
,
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
'uid'
=>
$this
->
rs
[
'uid'
],
...
...
@@ -336,7 +377,7 @@ class flow_emfkClassModel extends flowModel
//修改冻结余额
$freeze
=
array
(
'freeze_amount'
=>
$cost
[
'freeze_amount'
]
+
$v
o
[
'amount'
],
'freeze_amount'
=>
$cost
[
'freeze_amount'
]
+
$v
alue
[
'amount'
],
);
m
(
'c_fund_account'
)
->
update
(
$freeze
,
"`id`='
$id
'"
);
...
...
@@ -515,4 +556,4 @@ class flow_emfkClassModel extends flowModel
}
}
\ No newline at end of file
}
webmain/model/flow/projectfkModel.php
浏览文件 @
dff6b6e3
...
...
@@ -248,7 +248,7 @@ class flow_projectfkClassModel extends flowModel
$sql
=
" mid ='
$id
' and `table`='c_projectfk' "
;
$flow_bill
=
m
(
'flow_bill'
)
->
getone
(
$sql
,
'allcheckid'
);
$allcheckid
=
explode
(
','
,
$flow_bill
[
'allcheckid'
]);
$optionid
=
m
(
'option'
)
->
getone
(
"num = '
oafk
_manager' "
,
'id'
);
$optionid
=
m
(
'option'
)
->
getone
(
"num = '
project
_manager' "
,
'id'
);
$optionid
=
$optionid
[
'id'
];
$option
=
m
(
'option'
)
->
getall
(
"pid = '
$optionid
' and num =1 order by sort desc"
,
'num,name,value,sort'
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论