Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
OA
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
weiyn
OA
Commits
182af322
提交
182af322
authored
4月 29, 2020
作者:
fengzy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
财务付款模块关联资金管理模块
上级
5db83e68
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
204 行增加
和
7 行删除
+204
-7
mode_finfybxAction.php
webmain/flow/input/mode_finfybxAction.php
+65
-0
mode_oafkAction.php
webmain/flow/input/mode_oafkAction.php
+69
-0
mode_oayfkAction.php
webmain/flow/input/mode_oayfkAction.php
+70
-7
没有找到文件。
webmain/flow/input/mode_finfybxAction.php
浏览文件 @
182af322
...
@@ -7,11 +7,76 @@ class mode_finfybxClassAction extends inputAction{
...
@@ -7,11 +7,76 @@ 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
){
protected
function
saveafter
(
$table
,
$arr
,
$id
,
$addbo
){
// 扣除账户余额 c_fund_account account_balance
$cbzxid
=
$arr
[
'cbzxid'
];
$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'
]
-
$arr
[
'amountOfThisPayment'
],
);
$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'
]
+
$arr
[
'amountOfThisPayment'
],
);
m
(
'c_cbzx'
)
->
update
(
$cbarr
,
"`code`='
$cbzx
'"
);
//账户明细 c_account_detail
$account_detail
=
array
(
'account'
=>
$data
[
'name'
],
'opt_type'
=>
2
,
'amount'
=>
$arr
[
'amountOfThisPayment'
],
'trans_numb'
=>
$arr
[
'docnum'
],
'account_balance'
=>
$data
[
'account_balance'
]
-
$arr
[
'amountOfThisPayment'
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
'uid'
=>
$arr
[
'optid'
],
);
m
(
'c_account_detail'
)
->
insert
(
$account_detail
);
// 业务付款8业务预付款10费用报销11 oa_c_fund_detail
$fund_detail
=
array
(
'trans_numb'
=>
$arr
[
'docnum'
],
'account'
=>
$data
[
'name'
],
'toaccount'
=>
$arr
[
'payee'
],
'trans_amount'
=>
$arr
[
'amountOfThisPayment'
],
'business_type'
=>
11
,
'opt_type'
=>
2
,
'account_balance'
=>
$data
[
'account_balance'
]
-
$arr
[
'amountOfThisPayment'
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
);
m
(
'c_fund_detail'
)
->
insert
(
$fund_detail
);
}
}
...
...
webmain/flow/input/mode_oafkAction.php
浏览文件 @
182af322
...
@@ -14,6 +14,18 @@ class mode_oafkClassAction extends inputAction{
...
@@ -14,6 +14,18 @@ class mode_oafkClassAction 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 "账户余额不足";
// }
}
}
/**
/**
...
@@ -25,6 +37,63 @@ class mode_oafkClassAction extends inputAction{
...
@@ -25,6 +37,63 @@ class mode_oafkClassAction extends inputAction{
*/
*/
protected
function
saveafter
(
$table
,
$arr
,
$id
,
$addbo
){
protected
function
saveafter
(
$table
,
$arr
,
$id
,
$addbo
){
// 扣除账户余额 c_fund_account account_balance
$cbzxid
=
$arr
[
'cbzxid'
];
$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'
]
-
$arr
[
'amountOfThisPayment'
],
);
$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'
]
+
$arr
[
'amountOfThisPayment'
],
);
m
(
'c_cbzx'
)
->
update
(
$cbarr
,
"`code`='
$cbzx
'"
);
//账户明细 c_account_detail
$account_detail
=
array
(
'account'
=>
$data
[
'name'
],
'opt_type'
=>
2
,
'amount'
=>
$arr
[
'amountOfThisPayment'
],
'trans_numb'
=>
$arr
[
'docnum'
],
'account_balance'
=>
$data
[
'account_balance'
]
-
$arr
[
'amountOfThisPayment'
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
'uid'
=>
$arr
[
'optid'
],
);
m
(
'c_account_detail'
)
->
insert
(
$account_detail
);
// 业务付款8业务预付款10费用报销11 oa_c_fund_detail
$fund_detail
=
array
(
'trans_numb'
=>
$arr
[
'docnum'
],
'account'
=>
$data
[
'name'
],
'toaccount'
=>
$arr
[
'payee'
],
'trans_amount'
=>
$arr
[
'amountOfThisPayment'
],
'business_type'
=>
8
,
'opt_type'
=>
2
,
'account_balance'
=>
$data
[
'account_balance'
]
-
$arr
[
'amountOfThisPayment'
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
);
m
(
'c_fund_detail'
)
->
insert
(
$fund_detail
);
}
}
public
function
getbankinfoAjax
()
public
function
getbankinfoAjax
()
...
...
webmain/flow/input/mode_oayfkAction.php
浏览文件 @
182af322
...
@@ -13,17 +13,80 @@ class mode_oayfkClassAction extends inputAction{
...
@@ -13,17 +13,80 @@ class mode_oayfkClassAction extends inputAction{
* return array('msg'=>'错误提示内容','rows'=> array()) 可返回空字符串,或者数组 rows 是可同时保存到数据库上数组
* return array('msg'=>'错误提示内容','rows'=> array()) 可返回空字符串,或者数组 rows 是可同时保存到数据库上数组
*/
*/
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 "账户余额不足";
// }
}
}
/**
* 重写函数:保存后处理,主要保存其他表数据
* $table String 对应表名
* $arr Array 表单参数
* $id Int 对应表上记录Id
* $addbo Boolean 是否添加时
*/
protected
function
saveafter
(
$table
,
$arr
,
$id
,
$addbo
){
protected
function
saveafter
(
$table
,
$arr
,
$id
,
$addbo
){
// 扣除账户余额 c_fund_account account_balance
$cbzxid
=
$arr
[
'cbzxid'
];
$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'
]
-
$arr
[
'amountOfThisPayment'
],
);
$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'
]
+
$arr
[
'amountOfThisPayment'
],
);
m
(
'c_cbzx'
)
->
update
(
$cbarr
,
"`code`='
$cbzx
'"
);
//账户明细 c_account_detail
$account_detail
=
array
(
'account'
=>
$data
[
'name'
],
'opt_type'
=>
2
,
'amount'
=>
$arr
[
'amountOfThisPayment'
],
'trans_numb'
=>
$arr
[
'docnum'
],
'account_balance'
=>
$data
[
'account_balance'
]
-
$arr
[
'amountOfThisPayment'
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
'uid'
=>
$arr
[
'optid'
],
);
m
(
'c_account_detail'
)
->
insert
(
$account_detail
);
// 业务付款8业务预付款10费用报销11 oa_c_fund_detail
$fund_detail
=
array
(
'trans_numb'
=>
$arr
[
'docnum'
],
'account'
=>
$data
[
'name'
],
'toaccount'
=>
$arr
[
'payee'
],
'trans_amount'
=>
$arr
[
'amountOfThisPayment'
],
'business_type'
=>
10
,
'opt_type'
=>
2
,
'account_balance'
=>
$data
[
'account_balance'
]
-
$arr
[
'amountOfThisPayment'
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
);
m
(
'c_fund_detail'
)
->
insert
(
$fund_detail
);
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论