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
cdbcb356
Commit
cdbcb356
authored
Nov 27, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
a030442f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
123 additions
and
38 deletions
+123
-38
app/Admin/Controllers/HomeController.php
+14
-0
app/Admin/Controllers/LawyerCollectController.php
+70
-17
app/Admin/Controllers/LawyerIncomeController.php
+2
-3
app/Admin/Controllers/ViewCovenantInvoicedController.php
+15
-0
app/Admin/Controllers/ViewCovenantReceivedController.php
+16
-1
app/Admin/Forms/CovenantInvoiceForm.php
+2
-2
app/Admin/Forms/CovenantReceiveForm.php
+4
-4
app/Admin/routes.php
+0
-11
app/Models/CovenantReceivePayment.php
+0
-0
No files found.
app/Admin/Controllers/HomeController.php
View file @
cdbcb356
...
...
@@ -8,11 +8,25 @@
use
Dcat\Admin\Layout\Column
;
use
Dcat\Admin\Layout\Content
;
use
Dcat\Admin\Layout\Row
;
use
Dcat\Admin\Admin
;
use
Illuminate\Support\Facades\Auth
;
class
HomeController
extends
Controller
{
public
function
index
(
Content
$content
)
{
$user
=
Admin
::
user
();
// $user = Administrator::findOrFail($userId); // 获取用户模型
$roles
=
$user
->
roles
;
// 获取用户的角色
$permissions
=
[];
foreach
(
$roles
as
$role
)
{
$permissions
=
array_merge
(
$permissions
,
$role
->
permissions
->
pluck
(
'slug'
)
->
toArray
());
}
// echo "<pre>";
// print_r($permissions);
// die;
return
$content
->
header
(
'Dashboard'
)
->
description
(
'Description...'
)
...
...
app/Admin/Controllers/LawyerCollectController.php
View file @
cdbcb356
...
...
@@ -4,6 +4,7 @@
use
App\Admin\Repositories\LawyerCollect
;
use
App\Models\Covenant
as
ModelsCovenant
;
use
App\Models\CovenantReceivePayment
as
ModelsCovenantReceivePayment
;
use
App\Models\Lawyer
as
ModelLawyer
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
...
...
@@ -22,22 +23,74 @@ class LawyerCollectController extends AdminController
protected
function
grid
()
{
return
Grid
::
make
(
new
LawyerCollect
(),
function
(
Grid
$grid
)
{
$number
=
$grid
->
model
()
->
filter
()
->
input
(
'number'
)
??
''
;
//律师编号
$received_at
=
$invoiced_at
=
[];
$received_at
[
'start'
]
=
$_GET
[
'received_at'
][
'start'
]
??
''
;
$received_at
[
'end'
]
=
$_GET
[
'received_at'
][
'end'
]
??
''
;
$invoiced_at
[
'start'
]
=
$_GET
[
'invoiced_at'
][
'start'
]
??
''
;
$invoiced_at
[
'end'
]
=
$_GET
[
'invoiced_at'
][
'end'
]
??
''
;
//创收已收款
$received_amount
=
ModelsCovenantReceivePayment
::
getReceivedMoneyByNumber
(
$number
,
$received_at
,
$invoiced_at
);
//已开票
$invoiced_money
=
ModelsCovenantReceivePayment
::
getInvoicedMoneyByNumber
(
$number
,
$received_at
,
$invoiced_at
);
//收款未开票
$received_noinvoiced
=
(
$received_amount
-
$invoiced_money
)
>
0
?
$received_amount
-
$invoiced_money
:
0
;
//开票未收款
$invoiced_noreceived
=
(
$invoiced_money
-
$received_amount
)
>
0
?
$invoiced_money
-
$received_amount
:
0
;
//提成金额
$commissionAmount
=
ModelsCovenantReceivePayment
::
getCommissionAmount
(
$number
,
$received_at
);
//基本工资
$basicSalary
=
ModelsCovenantReceivePayment
::
getTotalBasicSalary
(
$number
,
$received_at
);
//专项附加
$special_additional
=
ModelsCovenantReceivePayment
::
getTotalSpecialAdditional
(
$number
,
$received_at
);
//社保
$social
=
ModelsCovenantReceivePayment
::
getTotalSocial
(
$number
,
$received_at
);
//公积金
$accumulation_fund
=
ModelsCovenantReceivePayment
::
getTotalAccumulationFund
(
$number
,
$received_at
);
// 添加一行表头数据
$grid
->
header
(
function
()
use
(
$received_amount
,
$received_noinvoiced
,
$commissionAmount
,
$invoiced_noreceived
,
$basicSalary
,
$special_additional
,
$social
,
$accumulation_fund
)
{
return
'<div class="table-responsive table-wrapper complex-container table-middle mt-1 table-collapse " >'
.
'<table class="table custom-data-table data-table" id="grid-table">
<thead>
<tr>
<th width="160" style="text-align:center;" colspan="2">合计</th>
<th width="90" style="">'
.
$received_amount
.
'</th>
<th style="">'
.
$commissionAmount
.
'</th>
<th style="">'
.
$received_noinvoiced
.
'</th>
<th style="">'
.
$invoiced_noreceived
.
'</th>
<th style="">成本合计</th>
<th style="">'
.
$basicSalary
.
'</th>
<th style="">'
.
$special_additional
.
'</th>
<th style="">'
.
$social
.
'</th>
<th style="">'
.
$accumulation_fund
.
'</th>
<th style="">10000</th>
<th style="">30000</th>
<th style="">48899</th>
</tr>
</thead>
</tbody>
</table>'
.
'</div>'
;
});
//$grid->column('id')->sortable();
$grid
->
column
(
'lnumber'
,
'律师编号'
);
$grid
->
column
(
'lname'
,
'律师名称'
);
$grid
->
column
(
'commission_ratio'
,
'提成比例
%'
);
$grid
->
column
(
'receipt_money'
,
'创收已收款'
);
$grid
->
column
(
'commission_amount'
,
'提成金额'
);
$grid
->
column
(
'receipt_noinvoice'
,
'已收款未开票'
);
$grid
->
column
(
'invoice_noreceipt'
,
'已开票未收款'
);
$grid
->
column
(
'cost'
,
'成本合计'
);
$grid
->
column
(
'basic_salary'
,
'基本工资'
);
$grid
->
column
(
'special_additional'
,
'专项附加'
);
$grid
->
column
(
'social'
,
'社保'
);
$grid
->
column
(
'accumulation_fund'
,
'公积金'
);
$grid
->
column
(
'posting_tickets_fee'
,
'贴票金额'
);
$grid
->
column
(
'advance_fee'
,
'预支款'
);
$grid
->
column
(
'payable_commission'
,
'可结算提成'
);
$grid
->
column
(
'lnumber'
,
'律师编号'
)
->
width
(
90
)
;
$grid
->
column
(
'lname'
,
'律师名称'
)
->
width
(
90
)
;
$grid
->
column
(
'commission_ratio'
,
'提成比例
(%)'
)
->
width
(
100
);
$grid
->
column
(
'receipt_money'
,
'创收已收款'
)
->
width
(
90
)
;
$grid
->
column
(
'commission_amount'
,
'提成金额'
)
->
width
(
90
)
;
$grid
->
column
(
'receipt_noinvoice'
,
'已收款未开票'
)
->
width
(
90
)
;
$grid
->
column
(
'invoice_noreceipt'
,
'已开票未收款'
)
->
width
(
90
)
;
$grid
->
column
(
'cost'
,
'成本合计'
)
->
width
(
90
)
;
$grid
->
column
(
'basic_salary'
,
'基本工资'
)
->
width
(
90
)
;
$grid
->
column
(
'special_additional'
,
'专项附加'
)
->
width
(
90
)
;
$grid
->
column
(
'social'
,
'社保'
)
->
width
(
90
)
;
$grid
->
column
(
'accumulation_fund'
,
'公积金'
)
->
width
(
90
)
;
$grid
->
column
(
'posting_tickets_fee'
,
'贴票金额'
)
->
width
(
90
)
;
$grid
->
column
(
'advance_fee'
,
'预支款'
)
->
width
(
90
)
;
$grid
->
column
(
'payable_commission'
,
'可结算提成'
)
->
width
(
90
)
;
// $grid->column('created_at');
// $grid->column('updated_at')->sortable();
...
...
@@ -52,8 +105,8 @@ protected function grid()
$filter
->
panel
();
$filter
->
like
(
'number'
,
'律师编号'
)
->
width
(
3
);
$filter
->
like
(
'name'
,
'律师姓名'
)
->
width
(
3
);
$filter
->
between
(
'received_at'
,
'收款日期'
)
->
date
()
->
width
(
4
);
$filter
->
between
(
'invoiced_at'
,
'开票日期'
)
->
date
()
->
width
(
4
);
$filter
->
between
(
'received_at'
,
'收款日期'
)
->
month
()
->
width
(
4
);
$filter
->
between
(
'invoiced_at'
,
'开票日期'
)
->
month
()
->
width
(
4
);
});
});
}
...
...
app/Admin/Controllers/LawyerIncomeController.php
View file @
cdbcb356
...
...
@@ -2,7 +2,6 @@
namespace
App\Admin\Controllers
;
//use App\Admin\Repositories\LawyerCost;
use
App\Models\Lawyer
as
ModelLawyer
;
use
App\Models\LawyerCost
as
ModelLawyerCost
;
use
App\Models\CovenantReceivePayment
as
ModelCovenantReceivePayment
;
...
...
@@ -10,7 +9,6 @@
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Show
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
App\Admin\Actions\CovenantReceive
;
class
LawyerIncomeController
extends
AdminController
{
...
...
@@ -60,8 +58,9 @@ protected function grid()
});
$grid
->
column
(
'field4'
,
'已开票未收款'
)
->
display
(
function
(
$val
)
{
$id
=
$this
->
id
;
$year
=
date
(
'Y'
);
$linkstr
=
'<a href="/lawyer-covenant-income?no='
.
$id
.
'" target="_blank">创收收款表</a> '
;
$linkstr
.=
'<a href="/receive_payment?no='
.
$id
.
'" target="_blank">已收款/已开票汇总</a><br/>'
;
$linkstr
.=
'<a href="/receive_payment?no='
.
$id
.
'
&year='
.
$year
.
'
" target="_blank">已收款/已开票汇总</a><br/>'
;
return
$linkstr
;
});
...
...
app/Admin/Controllers/ViewCovenantInvoicedController.php
View file @
cdbcb356
...
...
@@ -11,6 +11,8 @@
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Dcat\Admin\Widgets\Modal
;
use
App\Admin\Forms\CovenantInvoiceForm
;
class
ViewCovenantInvoicedController
extends
AdminController
{
...
...
@@ -24,6 +26,19 @@ protected function grid()
{
return
Grid
::
make
(
new
ModelsCovenantReceivePayment
(),
function
(
Grid
$grid
)
{
$cid
=
$grid
->
model
()
->
filter
()
->
input
(
'cid'
)
??
0
;
$grid
->
tools
(
function
(
Grid\Tools
$tools
)
use
(
$cid
)
{
$tools
->
append
(
Modal
::
make
()
// 大号弹窗
->
lg
()
// 弹窗标题
->
title
(
'新增'
)
// 按钮
->
button
(
'<button class="btn btn-primary"><i class="feather icon-plus"></i> 新增</button>'
)
// 弹窗内容
->
body
(
CovenantInvoiceForm
::
make
()
->
payload
([
'id'
=>
$cid
])));
});
$grid
->
model
()
->
where
(
'rtype'
,
2
)
->
orderBy
(
"id"
,
"desc"
);
//$grid->column('id')->sortable();
$grid
->
column
(
'invoiced_at'
,
'开票时间'
);
...
...
app/Admin/Controllers/ViewCovenantReceivedController.php
View file @
cdbcb356
...
...
@@ -11,6 +11,9 @@
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Dcat\Admin\Layout\Content
;
use
Dcat\Admin\Widgets\Modal
;
use
App\Admin\Forms\CovenantReceiveForm
;
class
ViewCovenantReceivedController
extends
AdminController
{
...
...
@@ -24,6 +27,19 @@ protected function grid()
{
return
Grid
::
make
(
new
ModelsCovenantReceivePayment
(),
function
(
Grid
$grid
)
{
$cid
=
$grid
->
model
()
->
filter
()
->
input
(
'cid'
)
??
0
;
$grid
->
tools
(
function
(
Grid\Tools
$tools
)
use
(
$cid
)
{
$tools
->
append
(
Modal
::
make
()
// 大号弹窗
->
lg
()
// 弹窗标题
->
title
(
'新增'
)
// 按钮
->
button
(
'<button class="btn btn-primary"><i class="feather icon-plus"></i> 新增</button>'
)
// 弹窗内容
->
body
(
CovenantReceiveForm
::
make
()
->
payload
([
'id'
=>
$cid
])));
});
$grid
->
model
()
->
where
(
'rtype'
,
1
)
->
orderBy
(
"id"
,
"desc"
);
//$grid->column('id')->sortable();
$grid
->
column
(
'received_type'
,
'收款账户'
)
->
display
(
function
(
$val
)
{
...
...
@@ -54,7 +70,6 @@ protected function grid()
}
/**
* Make a form builder.
*
...
...
app/Admin/Forms/CovenantInvoiceForm.php
View file @
cdbcb356
...
...
@@ -63,8 +63,8 @@ public function handle(array $input)
*/
public
function
form
()
{
$this
->
date
(
'invoiced_at'
,
'开票时间'
)
->
format
(
'YYYY-MM-DD'
)
->
default
(
date
(
"Y-m-d"
));
$this
->
text
(
'invoiced_money'
,
'开票金额'
);
$this
->
date
(
'invoiced_at'
,
'开票时间'
)
->
format
(
'YYYY-MM-DD'
)
->
default
(
date
(
"Y-m-d"
))
->
required
()
;
$this
->
text
(
'invoiced_money'
,
'开票金额'
)
->
required
()
;
}
/**
...
...
app/Admin/Forms/CovenantReceiveForm.php
View file @
cdbcb356
...
...
@@ -70,10 +70,10 @@ public function handle(array $input)
*/
public
function
form
()
{
$this
->
select
(
'received_type'
,
'收款账户'
)
->
options
([
1
=>
'基本户'
,
2
=>
'其它'
]);
$this
->
text
(
'pay_method'
,
'支付方式'
);
$this
->
date
(
'received_at'
,
'收款时间'
)
->
format
(
'YYYY-MM-DD'
)
->
default
(
date
(
"Y-m-d"
));
$this
->
text
(
'received_amount'
,
'收款金额'
);
$this
->
select
(
'received_type'
,
'收款账户'
)
->
options
([
1
=>
'基本户'
,
2
=>
'其它'
])
->
required
()
;
$this
->
text
(
'pay_method'
,
'支付方式'
)
->
required
()
;
$this
->
date
(
'received_at'
,
'收款时间'
)
->
format
(
'YYYY-MM-DD'
)
->
default
(
date
(
"Y-m-d"
))
->
required
()
;
$this
->
text
(
'received_amount'
,
'收款金额'
)
->
required
()
;
$this
->
text
(
'paymenter'
,
'付款人'
);
}
...
...
app/Admin/routes.php
View file @
cdbcb356
...
...
@@ -30,17 +30,6 @@
$router
->
get
(
'/'
,
'HomeController@index'
);
$router
->
get
(
'users/getUserType'
,
'UsersController@getUserType'
);
//人员类型列表(后台组件使用)
$router
->
get
(
'users/getDepartmentType'
,
'UsersController@getDepartmentType'
);
//院系所类型列表(后台组件使用)
$router
->
get
(
'users/getYearList'
,
'UsersController@getYearList'
);
//年度列表(后台组件使用)
$router
->
get
(
'users/getProjectType'
,
'UsersController@getProjectType'
);
//项目类型列表(后台组件使用)
$router
->
get
(
'department/getHospitalList'
,
'DepartmentController@getHospitalList'
);
//附属医院列表(后台组件使用)
//$router->resource('user', 'UserController'); //员工管理
$router
->
resource
(
'principal'
,
'PrincipalController'
);
//委托人信息
...
...
app/Models/CovenantReceivePayment.php
View file @
cdbcb356
This diff is collapsed.
Click to expand it.
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