Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
8ddcdb73
Commit
8ddcdb73
authored
May 23, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开票税费修改
parent
4a7565c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
6 deletions
+37
-6
Finance.php
application/index/controller/Finance.php
+21
-1
OFee.php
application/model/OFee.php
+16
-5
No files found.
application/index/controller/Finance.php
View file @
8ddcdb73
...
...
@@ -622,8 +622,28 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'新增实收参数错误'
);
}
if
(
empty
(
$this
->
params
[
'total_fee'
]))
{
return
$this
->
response
(
101
,
'开票金额为空'
);
}
if
(
empty
(
$this
->
params
[
'operation_date'
]))
{
return
$this
->
response
(
101
,
'开票日期为空'
);
}
$bargain_id
=
$this
->
params
[
'bargain_id'
];
$operation_date
=
$this
->
params
[
'operation_date'
];
$m_fee
=
new
OFee
();
$data
=
$m_fee
->
addFee
(
$this
->
params
[
'tallage'
],
$this
->
params
[
'bargain_id'
],
1
,
$this
->
userId
);
$tax
=
$this
->
params
[
'tax'
];
$insert_data
[
'bargain_id'
]
=
$bargain_id
;
$insert_data
[
'total_fee'
]
=
$this
->
params
[
'total_fee'
];
$insert_data
[
'father_id'
]
=
0
;
$insert_data
[
'operation_id'
]
=
$this
->
userId
;
$insert_data
[
'operation_date'
]
=
$operation_date
;
$insert_data
[
'type'
]
=
1
;
$m_fee
->
editData
(
$insert_data
,
$this
->
params
[
'total_id'
]);
$father_id
=
$m_fee
->
id
;
$data
=
$m_fee
->
addFee
(
$tax
,
$bargain_id
,
1
,
$this
->
userId
,
$father_id
,
$this
->
params
[
'total_fee'
],
$operation_date
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
...
...
application/model/OFee.php
View file @
8ddcdb73
...
...
@@ -47,20 +47,31 @@ class OFee extends BaseModel
*
* @param $data
* @param $bargain_id
* @param int $type 0实收佣金 1税费
* @param int $agent_id 操作人id
* @param int $type
* @param int $agent_id
* @param int $father_id
* @param int $total_fee
* @param string $operation_date
* @return array|false
* @throws \Exception
*/
public
function
addFee
(
$data
,
$bargain_id
,
$type
=
0
,
int
$agent_id
)
{
public
function
addFee
(
$data
,
$bargain_id
,
$type
=
0
,
int
$agent_id
,
$father_id
=
0
,
$total_fee
=
0
,
$operation_date
=
''
)
{
$insert_data
=
[];
foreach
(
$data
as
$k
=>
$v
)
{
$insert_data
[
$k
][
'id'
]
=
$v
[
'id'
];
$insert_data
[
$k
][
'bargain_id'
]
=
$bargain_id
;
$insert_data
[
$k
][
'fee'
]
=
$v
[
'fee'
];
$insert_data
[
$k
][
'
agent
_id'
]
=
$agent_id
;
$insert_data
[
$k
][
'
operation
_id'
]
=
$agent_id
;
$insert_data
[
$k
][
'type'
]
=
$type
;
$insert_data
[
$k
][
'operation_date'
]
=
$v
[
'operation_date'
];
if
(
$type
!=
0
)
{
//开票税费处理
$insert_data
[
$k
][
'father_id'
]
=
$father_id
;
$insert_data
[
$k
][
'total_fee'
]
=
$total_fee
;
$insert_data
[
$k
][
'operation_date'
]
=
$operation_date
;
}
else
{
$insert_data
[
$k
][
'operation_date'
]
=
$v
[
'operation_date'
];
}
}
return
$this
->
saveAll
(
$insert_data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment