Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
eb109369
提交
eb109369
authored
10月 28, 2020
作者:
wangkr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整 账单balance的条件,按照balance剩余数值生成缴费单
上级
a6ff70f8
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
13 行删除
+23
-13
Payment.php
application/em/controller/Payment.php
+23
-13
没有找到文件。
application/em/controller/Payment.php
浏览文件 @
eb109369
...
...
@@ -188,7 +188,7 @@ class Payment extends Base
if
(
!
$payment
)
return
json
([
'status'
=>
0
,
'message'
=>
'单据:'
.
$epiModel
->
payment_id
.
'出现异常,单据与账单关系存在,但缴费单不存在!'
]);
//如果缴费单并未缴费
if
(
$payment
->
amount
>
0
){
if
(
$payment
->
balance
>
0
){
$message
=
'账单号: '
.
$inv
->
invoice_id
.
' 已经与缴费单:'
.
$payment
->
payment_id
.
'挂起,无法生成缴费单'
;
return
json
([
'status'
=>
0
,
'message'
=>
$message
]);
}
else
{
...
...
@@ -475,16 +475,21 @@ class Payment extends Base
if
(
$inv
->
payment_balance
==
0
){
$inv
->
paid_amount
=
$inv
->
payment_amount
;
}
else
{
$inv
->
paid_amount
=
$inv
->
payment_
amount
-
$inv
->
payment_
balance
;
$inv
->
paid_amount
=
$inv
->
payment_balance
;
}
}
}
$payway
=
$this
->
getFkInfo
(
1
);
$org
=
$this
->
getFkInfo
(
2
);
$this
->
assign
(
'invs'
,
$invs
);
$this
->
assign
(
'payment_id'
,
$payment_id
);
$this
->
assign
(
'payee'
,
$this
->
getGys
(
$staff
->
email
));
$this
->
assign
(
'org'
,
$this
->
getFkInfo
(
2
));
$this
->
assign
(
'payway'
,
$this
->
getFkInfo
(
1
));
$this
->
assign
(
'org'
,
$org
);
$this
->
assign
(
'date'
,
date
(
'Y-m-d H:i:s'
));
$this
->
assign
(
'payway'
,
$payway
);
return
$this
->
fetch
(
'pay_oa'
);
}
...
...
@@ -503,19 +508,19 @@ class Payment extends Base
$details
=
[];
if
(
$payment
->
payment_type
==
2
||
$payment
->
payment_type
==
4
){
$details
[
0
][
'charge_type'
]
=
"维护电费"
;
$details
[
0
][
'charge_type'
]
=
$post
[
'fkitem'
]
;
$details
[
0
][
'amount'
]
=
$payment
->
amount
;
$details
[
0
][
'cbzxid'
]
=
$this
->
getCbzxIdByEmId
(
$payment
->
em_id
);
}
else
{
$invs
=
(
new
EmPayment
())
->
getinvsInfo
(
$payment
->
payment_id
);
foreach
(
$invs
as
$k
=>
$inv
){
$details
[
$k
][
'charge_type'
]
=
"维护电费"
;
$details
[
$k
][
'charge_type'
]
=
$post
[
'fkitem'
]
;
if
(
$inv
->
payment_balance
==
0
){
$details
[
$k
][
'amount'
]
=
0
;
}
else
if
(
$inv
->
payment_amount
==
$inv
->
payment_balance
){
$details
[
$k
][
'amount'
]
=
$inv
->
payment_amount
;
}
else
{
$details
[
$k
][
'amount'
]
=
$inv
->
payment_
amount
-
$inv
->
payment_
balance
;
$details
[
$k
][
'amount'
]
=
$inv
->
payment_balance
;
}
$details
[
$k
][
'cbzxid'
]
=
$this
->
getDetailsFields
(
$inv
->
account_id
);
}
...
...
@@ -531,6 +536,7 @@ class Payment extends Base
'info'
=>
$post
[
'info'
],
'cause'
=>
$post
[
'cause'
],
'date'
=>
$post
[
'date'
],
'payment_id'
=>
$payment
->
payment_id
,
'details'
=>
$details
];
...
...
@@ -587,9 +593,14 @@ class Payment extends Base
$res
=
httpPOST
(
$url
,
$data
);
$res
=
json_decode
(
$res
,
true
);
foreach
(
$res
[
'data'
]
as
$k
=>
$v
){
$temp
=
[];
if
(
!
empty
(
$v
[
'bank_info'
])){
foreach
(
$v
[
'bank_info'
]
as
$a
=>
$b
){
$temp
[
$a
]
=
'银行名称: '
.
$b
[
'open_bank_name'
]
.
'账号: '
.
$b
[
'bank_code'
];
$info
=
"账户名称:"
.
$b
[
'bank_holder'
]
.
','
;
$info
.=
"开户银行:"
.
$b
[
'open_bank_name'
]
.
','
;
$info
.=
"银行账号:"
.
$b
[
'bank_code'
]
.
','
;
$info
.=
"开户行地址:"
.
$b
[
'open_address'
];
$temp
[
$a
]
=
$info
;
}
$res
[
'data'
][
$k
][
'bankInfo'
]
=
json_encode
(
$temp
);
}
...
...
@@ -599,9 +610,9 @@ class Payment extends Base
//获取付款所需信息
public
function
getFkInfo
(
$type
){
$url
=
config
(
'oafk.base_url'
)
.
config
(
'oafk.type'
)
.
$this
->
apiKey
();
$data
=
[
'type'
=>
$type
];
$res
=
httpPOST
(
$url
,
$data
);
$res
=
httpPOST
(
$url
,[
'type'
=>
$type
]);
$res
=
json_decode
(
$res
,
true
);
return
$res
[
'data'
];
}
...
...
@@ -609,9 +620,8 @@ class Payment extends Base
//创建付款编号
public
function
createFkNumb
(
$data
){
$url
=
config
(
'oafk.base_url'
)
.
config
(
'oafk.fk'
)
.
$this
->
apiKey
();
$res
=
httpPOST
(
$url
,
[
'data'
=>
json_encode
(
$data
)]);
// $end = strpos($res,'}');
// $str = substr($res,$start,$end);
$data
=
[
'data'
=>
$data
];
$res
=
httpPOST
(
$url
,
$data
);
$res
=
json_decode
(
$res
,
true
);
return
$res
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论