Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvsuo-pc
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhilin
lvsuo-pc
Commits
cbd76dbf
Commit
cbd76dbf
authored
Dec 06, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
19f3ea43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
app/Admin/Controllers/LawyerCommissionController.php
+1
-1
app/Admin/Controllers/ViewCovenantInvoicedController.php
+32
-4
app/Admin/Repositories/LawyerCommission.php
+4
-4
No files found.
app/Admin/Controllers/LawyerCommissionController.php
View file @
cbd76dbf
...
...
@@ -39,7 +39,7 @@ protected function grid()
$tickets_money
=
ModelLawyerCost
::
getPostingTicketsMoney
(
$this
->
id
,
$year
,
$this
->
commission_rate
,
$this
->
ticket_ratio
);
return
$tickets_money
;
});
$grid
->
column
(
'commission_retention'
,
'
提成留底
'
)
->
display
(
function
()
use
(
$year
)
{
$grid
->
column
(
'commission_retention'
,
'
预留结案费
'
)
->
display
(
function
()
use
(
$year
)
{
$received_money
=
ModelCovenantReceivePayment
::
getReceivedMoney
(
$this
->
id
,
$year
);
//创收已收款
$commission_rate
=
$this
->
commission_rate
;
//提成比例
$result
=
$received_money
*
(
$commission_rate
/
100
)
*
0.05
;
...
...
app/Admin/Controllers/ViewCovenantInvoicedController.php
View file @
cbd76dbf
...
...
@@ -14,6 +14,7 @@
use
Dcat\Admin\Widgets\Modal
;
use
App\Admin\Forms\CovenantInvoiceForm
;
use
Dcat\Admin\Admin
;
use
App\Models\Lawyer
as
ModelsLawyer
;
class
ViewCovenantInvoicedController
extends
AdminController
{
...
...
@@ -56,17 +57,32 @@ protected function grid()
//文字信息
$grid
->
tools
(
function
(
Grid\Tools
$tools
)
use
(
$grid
,
$cid
)
{
$principal
=
$number
=
''
;
$principal
=
$cnumber
=
$lnumber
=
$lname
=
''
;
$invoiced_money
=
$received_money
=
$received_noinvoiced
=
$invoiced_noreceived
=
0
;
if
(
$cid
)
{
$cobj
=
ModelsCovenant
::
find
(
$cid
);
$principal
=
$cobj
->
principal
;
$number
=
$cobj
->
number
;
$cnumber
=
$cobj
->
number
;
$lobj
=
ModelsLawyer
::
find
(
$cobj
->
lawyer_id
);
$lnumber
=
$lobj
->
number
;
$lname
=
$lobj
->
name
;
//开票金额
$invoiced_money
=
self
::
getInvoicedByCid
(
$cid
);
//已收款
$received_money
=
self
::
getReceivedByCid
(
$cid
);
//已收款未开票
$received_noinvoiced
=
(
$received_money
-
$invoiced_money
)
>
0
?
$received_money
-
$invoiced_money
:
0
;
//已开票未收款
$invoiced_noreceived
=
(
$invoiced_money
-
$received_money
)
>
0
?
$invoiced_money
-
$received_money
:
0
;
}
$card_info
=
" 合同编号:
{
$number
}
委托人:
{
$principal
}
"
;
$card_info
=
" 合同编号:
{
$cnumber
}
委托人:
{
$principal
}
"
;
$card_info
.=
" 律师编号:
{
$lnumber
}
律师姓名:
{
$lname
}
"
;
$card_info
.=
" 开票金额:
{
$invoiced_money
}
已收款:
{
$received_money
}
"
;
$card_info
.=
" 已收款未开票:
{
$received_noinvoiced
}
已开票未收款:
{
$invoiced_noreceived
}
"
;
$tools
->
append
(
$card_info
);
});
$grid
->
actions
(
function
(
Grid\Displayers\Actions
$actions
)
{
//编辑
if
(
!
Admin
::
user
()
->
can
(
'view-invoiced-edit'
))
{
...
...
@@ -104,4 +120,16 @@ protected function form()
return
$form
;
}
//开票金额
public
static
function
getInvoicedByCid
(
$cid
)
{
return
ModelsCovenantReceivePayment
::
where
([
'cid'
=>
$cid
,
'rtype'
=>
2
])
->
sum
(
'invoiced_money'
);
}
//已收款
public
static
function
getReceivedByCid
(
$cid
)
{
return
ModelsCovenantReceivePayment
::
where
([
'cid'
=>
$cid
,
'rtype'
=>
1
])
->
sum
(
'received_amount'
);
}
}
app/Admin/Repositories/LawyerCommission.php
View file @
cbd76dbf
...
...
@@ -66,13 +66,11 @@ public function get(Grid\Model $model)
$tmp
[
$i
]
=
strval
(
$commission_rate
*
1
)
.
'%'
;
}
//可提成金额
$royalty_amount
=
0
;
if
(
$val
[
'field'
]
==
'royalty_amount'
)
{
$royalty_amount
=
sprintf
(
'%.2f'
,
$receiveMoeny
*
(
$commission_rate
/
100
)
);
$tmp
[
$i
]
=
$royalty_amount
;
$royalty_amount
=
$receiveMoeny
*
(
$commission_rate
/
100
);
$tmp
[
$i
]
=
sprintf
(
'%.2f'
,
$royalty_amount
)
;
}
//已支付款项
$paid_amount
=
0
;
if
(
$val
[
'field'
]
==
'paid_amount'
)
{
$paid_amount
=
ModelLawyerCost
::
getPaidAmount
(
$lawyer_id
,
$year
,
$i
);
$tmp
[
$i
]
=
sprintf
(
'%.2f'
,
$paid_amount
);
...
...
@@ -167,6 +165,8 @@ public function get(Grid\Model $model)
}
//可支付提成结算金额
if
(
$val
[
'field'
]
==
'payable_commission_amount'
)
{
$royalty_amount
=
$receiveMoeny
*
(
$commission_rate
/
100
);
$paid_amount
=
ModelLawyerCost
::
getPaidAmount
(
$lawyer_id
,
$year
,
$i
);
$payable_money
=
$royalty_amount
-
$paid_amount
;
$tmp
[
$i
]
=
$payable_money
;
}
...
...
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