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
421e9573
Commit
421e9573
authored
Jan 09, 2025
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
f919ce34
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
213 additions
and
115 deletions
+213
-115
app/Admin/Controllers/CovenantController.php
+9
-2
app/Admin/Controllers/CovenantReceivePaymentController.php
+4
-4
app/Admin/Controllers/LawyerCollectController.php
+13
-32
app/Admin/Controllers/LawyerCommissionController.php
+6
-6
app/Admin/Controllers/LawyerCostController.php
+16
-11
app/Admin/Controllers/LawyerIncomeController.php
+3
-3
app/Admin/Controllers/ViewCovenantInvoicedController.php
+6
-4
app/Admin/Controllers/ViewCovenantReceivedController.php
+6
-4
app/Admin/Extensions/ReceivedInvoicedExport.php
+1
-1
app/Admin/Extensions/lawyerCommissionExportExten.php
+16
-13
app/Admin/Extensions/lawyerCostExportExten.php
+13
-13
app/Admin/Repositories/Covenant.php
+4
-4
app/Admin/Repositories/CovenantReceivePaymentCollect.php
+4
-4
app/Admin/Repositories/LawyerCollect.php
+22
-12
app/Admin/Repositories/LawyerCommission.php
+46
-0
app/Admin/Repositories/LawyerCost.php
+42
-0
app/Admin/Repositories/LawyerInvoicedPaymentCollect.php
+1
-1
app/Admin/Repositories/LawyerReceivePaymentCollect.php
+1
-1
No files found.
app/Admin/Controllers/CovenantController.php
View file @
421e9573
...
...
@@ -36,11 +36,18 @@ protected function grid()
$grid
->
column
(
'sign_at'
);
$grid
->
column
(
'principal'
,
'委托人'
);
$grid
->
column
(
'lawyer.name'
,
'办案律师'
);
$grid
->
column
(
'amount'
);
$grid
->
column
(
'amount'
)
->
display
(
function
(
$val
)
{
return
number_format
(
$val
,
2
);
});
$grid
->
column
(
'payment_method'
)
->
display
(
function
(
$val
)
{
return
$val
==
1
?
'开票付款'
:
'付款开票'
;
});
$grid
->
column
(
'reserve_fee'
,
'预留结案费'
);
$grid
->
column
(
'reserve_fee'
,
'预留结案费'
)
->
display
(
function
()
{
$lawyerObj
=
ModelLawyer
::
find
(
$this
->
lawyer_id
);
$commission_rate
=
$lawyerObj
->
commission_rate
;
$result
=
$this
->
amount
*
$commission_rate
/
100
*
0.05
;
return
number_format
(
$result
,
2
);
});
$grid
->
column
(
'is_closed'
,
'结案状态'
)
->
display
(
function
(
$val
)
{
return
$val
?
'已结案'
:
'未结案'
;
});
...
...
app/Admin/Controllers/CovenantReceivePaymentController.php
View file @
421e9573
...
...
@@ -39,9 +39,9 @@ protected function grid()
//开票金额
$invoicedMoney
=
ModelsCovenantReceivePayment
::
getTotalInvoicedMoney
(
$params
,
$received_at
,
$invoiced_at
);
//已收款未开票
$receiptNoinvoice
=
(
$receivedMoney
-
$invoicedMoney
)
>
0
?
sprintf
(
'%.2f'
,
$receivedMoney
-
$invoicedMoney
)
:
0
;
$receiptNoinvoice
=
(
$receivedMoney
-
$invoicedMoney
)
>
0
?
number_format
(
$receivedMoney
-
$invoicedMoney
,
2
)
:
0
;
//已开票未收款
$invoiceNoreceipt
=
(
$invoicedMoney
-
$receivedMoney
)
>
0
?
sprintf
(
'%.2f'
,
$invoicedMoney
-
$receivedMoney
)
:
0
;
$invoiceNoreceipt
=
(
$invoicedMoney
-
$receivedMoney
)
>
0
?
number_format
(
$invoicedMoney
-
$receivedMoney
,
2
)
:
0
;
// 添加一行表头数据
// $grid->header(function () use ($invoicedMoney, $receivedMoney, $receiptNoinvoice, $invoiceNoreceipt) {
// return '<div class="row" style="text-align:center;">' .
...
...
@@ -62,8 +62,8 @@ protected function grid()
<th width="90">合计</th>
<th width="90"></th>
<th width="90"></th>
<th width="90">'
.
sprintf
(
'%.2f'
,
$invoicedMoney
)
.
'</th>
<th width="90">'
.
sprintf
(
'%.2f'
,
$receivedMoney
)
.
'</th>
<th width="90">'
.
number_format
(
$invoicedMoney
,
2
)
.
'</th>
<th width="90">'
.
number_format
(
$receivedMoney
,
2
)
.
'</th>
<th width="90">'
.
$receiptNoinvoice
.
'</th>
<th width="90"> '
.
$invoiceNoreceipt
.
'</th>
</tr>
...
...
app/Admin/Controllers/LawyerCollectController.php
View file @
421e9573
...
...
@@ -55,21 +55,21 @@ protected function grid()
//提成金额
$commissionAmount
=
$totalInfo
[
'commission_amount'
];
//ModelsCovenantReceivePayment::getCommissionAmount($number, $year, $received_at);
//成本合计
$costTotal
=
sprintf
(
'%.2f'
,
$totalInfo
[
'cost'
]
);
$costTotal
=
number_format
(
$totalInfo
[
'cost'
],
2
);
//基本工资
$basicSalary
=
sprintf
(
'%.2f'
,
$totalInfo
[
'salary'
]
);
$basicSalary
=
number_format
(
$totalInfo
[
'salary'
],
2
);
//专项附加
$special_additional
=
sprintf
(
'%.2f'
,
$totalInfo
[
'special_additional'
]
);
$special_additional
=
number_format
(
$totalInfo
[
'special_additional'
],
2
);
//社保
$social
=
sprintf
(
'%.2f'
,
$totalInfo
[
'social'
]
);
$social
=
number_format
(
$totalInfo
[
'social'
],
2
);
//公积金
$accumulation_fund
=
sprintf
(
'%.2f'
,
$totalInfo
[
'accumulation_fund'
]
);
$accumulation_fund
=
number_format
(
$totalInfo
[
'accumulation_fund'
],
2
);
//贴票金额
$posting_tickets
=
sprintf
(
'%.2f'
,
$totalInfo
[
'tickets_money'
]
);
$posting_tickets
=
number_format
(
$totalInfo
[
'tickets_money'
],
2
);
//预支款
$advance_fee
=
sprintf
(
'%.2f'
,
$totalInfo
[
'advance_fee'
]
);
$advance_fee
=
number_format
(
$totalInfo
[
'advance_fee'
],
2
);
//可结算提成
$payable_amount
=
sprintf
(
'%.2f'
,
$totalInfo
[
'payable_commission'
]
);
$payable_amount
=
number_format
(
$totalInfo
[
'payable_commission'
],
2
);
// 添加一行表头数据
$grid
->
header
(
function
()
use
(
$received_amount
,
$commissionAmount
,
$received_noinvoiced
,
$invoiced_noreceived
,
$costTotal
,
$basicSalary
,
$special_additional
,
$social
,
$accumulation_fund
,
$posting_tickets
,
$advance_fee
,
$payable_amount
)
{
return
'<div class="table-responsive table-wrapper complex-container table-middle mt-1 table-collapse ">
...
...
@@ -78,10 +78,10 @@ protected function grid()
<tr>
<th width="100" style="text-align:right;">合计</th>
<th width="90"> </th>
<th width="90" style="text-align:left;">'
.
sprintf
(
'%.2f'
,
$received_amount
)
.
'</th>
<th width="80" style="text-align:left;">'
.
sprintf
(
'%.2f'
,
$commissionAmount
)
.
'</th>
<th width="90" style="text-align:left;">'
.
sprintf
(
'%.2f'
,
$received_noinvoiced
)
.
'</th>
<th width="90" style="text-align:left;">'
.
sprintf
(
'%.2f'
,
$invoiced_noreceived
)
.
'</th>
<th width="90" style="text-align:left;">'
.
number_format
(
$received_amount
,
2
)
.
'</th>
<th width="80" style="text-align:left;">'
.
number_format
(
$commissionAmount
,
2
)
.
'</th>
<th width="90" style="text-align:left;">'
.
number_format
(
$received_noinvoiced
,
2
)
.
'</th>
<th width="90" style="text-align:left;">'
.
number_format
(
$invoiced_noreceived
,
2
)
.
'</th>
<th width="90" style="text-align:left;">'
.
$costTotal
.
'</th>
<th width="90" style="text-align:left;">'
.
$basicSalary
.
'</th>
<th width="90" style="text-align:left;">'
.
$special_additional
.
'</th>
...
...
@@ -99,26 +99,7 @@ protected function grid()
</table>
</div>'
;
});
// $grid->header(function () {
// return '<div class="row" style="text-align:center;">' .
// '<div class="col-md-3" >合计</div>' .
// '<div class="col-md-1">1</div>' .
// '<div class="col-md-1">2</div>' .
// '<div class="col-md-1">3</div>' .
// '<div class="col-md-1">4</div>' .
// '<div class="col-md-1">5</div>' .
// '<div class="col-md-1">6</div>' .
// '<div class="col-md-1">7</div>' .
// '<div class="col-md-1">8</div>' .
// '<div class="col-md-1">9</div>' .
// '<div class="col-md-1">10</div>' .
// '<div class="col-md-1">11</div>' .
// '</div>';
// });
//$grid->column('id')->sortable();
// $grid->column('lnumber', '律师编号')->width(90)->style([
// 'text-align:center',
// ]);
$grid
->
column
(
'lname'
,
'律师名称'
)
->
width
(
90
)
->
style
([
'text-align:left'
,
]);
...
...
app/Admin/Controllers/LawyerCommissionController.php
View file @
421e9573
...
...
@@ -29,33 +29,33 @@ protected function grid()
$grid
->
column
(
'name'
,
'律师姓名'
);
$grid
->
column
(
'received_money'
,
'创收已收款'
)
->
display
(
function
(
$val
)
use
(
$year
)
{
$money
=
self
::
getReceivedMoney
(
$year
,
$this
->
id
);
return
$money
;
return
number_format
(
$money
,
2
)
;
});
$grid
->
column
(
'commission_rate'
,
'提成比例 %'
);
$grid
->
column
(
'paid_amount'
,
'已支付款项'
)
->
display
(
function
(
$val
)
use
(
$year
)
{
$paid_amount
=
self
::
getPaidAmount
(
$year
,
$this
->
id
);
return
sprintf
(
'%.2f'
,
$paid_amount
);
return
number_format
(
$paid_amount
,
2
);
});
$grid
->
column
(
'posting_tickets_money'
,
'贴票金额'
)
->
display
(
function
()
use
(
$year
)
{
$tickets_money
=
ModelLawyerCost
::
getAllPostingTicketsMoney
(
$this
->
id
,
$year
);
return
$tickets_money
;
return
number_format
(
$tickets_money
,
2
)
;
});
$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
;
return
sprintf
(
'%.2f'
,
$result
);
return
number_format
(
$result
,
2
);
});
$grid
->
column
(
'payable_amount'
,
'可支付提成结算金额'
)
->
display
(
function
()
use
(
$year
)
{
$received_money
=
ModelCovenantReceivePayment
::
getReceivedMoney
(
$this
->
id
,
$year
);
//创收已收款
$paid_amount
=
ModelLawyerCost
::
getPaidAmount
(
$this
->
id
,
$year
);
//已支付款项
$commission_rate
=
$this
->
commission_rate
;
//提成比例
$result
=
$received_money
*
(
$commission_rate
/
100
)
-
$paid_amount
;
return
sprintf
(
'%.2f'
,
$result
);
return
number_format
(
$result
,
2
);
});
$grid
->
column
(
'personal_income_tax'
,
'个人所得税'
)
->
display
(
function
(
$val
)
use
(
$year
)
{
$amount
=
self
::
getPersonalIncomeTax
(
$year
,
$this
->
id
);
return
sprintf
(
'%.2f'
,
$amount
);
return
number_format
(
$amount
,
2
);
});
// $grid->column('created_at');
...
...
app/Admin/Controllers/LawyerCostController.php
View file @
421e9573
...
...
@@ -48,7 +48,8 @@ protected function grid()
return
self
::
getAnnuity
(
$this
->
number
,
$year
);
});
$grid
->
column
(
'posting_tickets_fee'
,
'贴票成本'
)
->
display
(
function
(
$val
)
use
(
$year
)
{
return
ModelLawyerCost
::
getAllPostingTicketsMoney
(
$this
->
id
,
$year
);
$result
=
ModelLawyerCost
::
getAllPostingTicketsMoney
(
$this
->
id
,
$year
);
return
number_format
(
$result
,
2
);
});
$grid
->
column
(
'assistant_fee'
,
'助理律师成本'
)
->
display
(
function
(
$val
)
use
(
$year
)
{
return
self
::
getAssistantFee
(
$this
->
number
,
$year
);
...
...
@@ -97,12 +98,14 @@ protected function grid()
//基本工资
public
static
function
getBasiSalary
(
$number
,
$year
)
{
return
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'basic_salary'
);
$result
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'basic_salary'
);
return
number_format
(
$result
,
2
);
}
//专项附加
public
static
function
getSpecialAdditional
(
$number
,
$year
)
{
return
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'special_additional'
);
$result
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'special_additional'
);
return
number_format
(
$result
,
2
);
}
//社保
...
...
@@ -110,7 +113,8 @@ public static function getSocial($number, $year)
{
$social_person_fee
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'social_person_fee'
);
$social_company_fee
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'social_company_fee'
);
return
round
(
$social_person_fee
+
$social_company_fee
,
2
);
$result
=
round
(
$social_person_fee
+
$social_company_fee
,
2
);
return
number_format
(
$result
,
2
);
}
...
...
@@ -119,49 +123,50 @@ public static function getAccumulationFund($number, $year)
{
$accumulation_fund_person_fee
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'accumulation_fund_person_fee'
);
$accumulation_fund_company_fee
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'accumulation_fund_company_fee'
);
return
round
(
$accumulation_fund_person_fee
+
$accumulation_fund_company_fee
,
2
);
$result
=
round
(
$accumulation_fund_person_fee
+
$accumulation_fund_company_fee
,
2
);
return
number_format
(
$result
,
2
);
}
//律所年检费
public
static
function
getAnnualInspectionFee
(
$number
,
$year
)
{
$annual_inspection_fee
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'annual_inspection_fee'
);
return
$annual_inspection_fee
;
return
number_format
(
$annual_inspection_fee
,
2
)
;
}
//律所年金
public
static
function
getAnnuity
(
$number
,
$year
)
{
$annuity
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'annuity'
);
return
$annuity
;
return
number_format
(
$annuity
,
2
)
;
}
//助理律师成本
public
static
function
getAssistantFee
(
$number
,
$year
)
{
$annuity
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'assistant_fee'
);
return
$annuity
;
return
number_format
(
$annuity
,
2
)
;
}
//办公室租赁成本
public
static
function
getOfficeRentalFee
(
$number
,
$year
)
{
$office_rental_fee
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'office_rental_fee'
);
return
$office_rental_fee
;
return
number_format
(
$office_rental_fee
,
2
)
;
}
//个人所得税
public
static
function
getPersonalIncomeTax
(
$number
,
$year
)
{
$personal_income_tax
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'personal_income_tax'
);
return
$personal_income_tax
;
return
number_format
(
$personal_income_tax
,
2
)
;
}
//无票成本
public
static
function
getNoticketCost
(
$number
,
$year
)
{
$noticket_cost
=
ModelLawyerCost
::
where
([
'number'
=>
$number
,
'year'
=>
$year
])
->
sum
(
'noticket_cost'
);
return
$noticket_cost
;
return
number_format
(
$noticket_cost
,
2
)
;
}
/**
...
...
app/Admin/Controllers/LawyerIncomeController.php
View file @
421e9573
...
...
@@ -35,14 +35,14 @@ protected function grid()
$invoiced_money
=
ModelCovenantReceivePayment
::
where
([
'lawyer_id'
=>
$this
->
id
,
'rtype'
=>
2
])
->
where
(
'invoiced_at'
,
'like'
,
$year
.
'%'
)
->
sum
(
'invoiced_money'
);
return
$invoiced_money
;
return
number_format
(
$invoiced_money
,
2
)
;
});
$grid
->
column
(
'field2'
,
'已收款'
)
->
display
(
function
()
use
(
$year
)
{
//已收款
$receipt_money
=
ModelCovenantReceivePayment
::
where
([
'lawyer_id'
=>
$this
->
id
,
'rtype'
=>
1
])
->
where
(
'received_at'
,
'like'
,
$year
.
'%'
)
->
sum
(
'received_amount'
);
return
$receipt_money
;
return
number_format
(
$receipt_money
,
2
)
;
});
$grid
->
column
(
'field3'
,
'已收款未开票'
)
->
display
(
function
()
use
(
$year
)
{
//开票金额
...
...
@@ -54,7 +54,7 @@ protected function grid()
->
where
(
'received_at'
,
'like'
,
$year
.
'%'
)
->
sum
(
'received_amount'
);
//已收款未开票
$receipt_noinvoice
=
(
$receipt_money
-
$invoiced_money
)
>
0
?
$receipt_money
-
$invoiced_money
:
'-'
;
$receipt_noinvoice
=
(
$receipt_money
-
$invoiced_money
)
>
0
?
number_format
(
$receipt_money
-
$invoiced_money
,
2
)
:
'-'
;
return
$receipt_noinvoice
;
});
$grid
->
column
(
'field4'
,
'已开票未收款'
)
->
display
(
function
(
$val
)
{
...
...
app/Admin/Controllers/ViewCovenantInvoicedController.php
View file @
421e9573
...
...
@@ -49,7 +49,9 @@ protected function grid()
$grid
->
model
()
->
where
([
'rtype'
=>
2
,
'lawyer_id'
=>
$lawyer_id
,
'cid'
=>
$cid
])
->
orderBy
(
"id"
,
"desc"
);
//$grid->column('id')->sortable();
$grid
->
column
(
'invoiced_at'
,
'开票时间'
);
$grid
->
column
(
'invoiced_money'
,
'开票金额'
);
$grid
->
column
(
'invoiced_money'
,
'开票金额'
)
->
display
(
function
(
$val
)
{
return
number_format
(
$val
,
2
);
});
$grid
->
disableViewButton
();
$grid
->
disableCreateButton
();
...
...
@@ -71,13 +73,13 @@ protected function grid()
//已收款
$received_money
=
self
::
getReceivedByCid
(
$cid
);
//已收款未开票
$received_noinvoiced
=
(
$received_money
-
$invoiced_money
)
>
0
?
$received_money
-
$invoiced_money
:
0
;
$received_noinvoiced
=
(
$received_money
-
$invoiced_money
)
>
0
?
number_format
(
$received_money
-
$invoiced_money
,
2
)
:
0
;
//已开票未收款
$invoiced_noreceived
=
(
$invoiced_money
-
$received_money
)
>
0
?
$invoiced_money
-
$received_money
:
0
;
$invoiced_noreceived
=
(
$invoiced_money
-
$received_money
)
>
0
?
number_format
(
$invoiced_money
-
$received_money
,
2
)
:
0
;
}
$card_info
=
" 合同编号:
{
$cnumber
}
委托人:
{
$principal
}
"
;
$card_info
.=
" 律师编号:
{
$lnumber
}
律师姓名:
{
$lname
}
"
;
$card_info
.=
" 开票金额:
{
$invoiced_money
}
已收款:
{
$received_money
}
"
;
$card_info
.=
" 开票金额:
"
.
number_format
(
$invoiced_money
,
2
)
.
" 已收款:"
.
number_format
(
$received_money
,
2
)
;
$card_info
.=
" 已收款未开票:
{
$received_noinvoiced
}
已开票未收款:
{
$invoiced_noreceived
}
"
;
$tools
->
append
(
$card_info
);
});
...
...
app/Admin/Controllers/ViewCovenantReceivedController.php
View file @
421e9573
...
...
@@ -59,7 +59,9 @@ protected function grid()
return
ModelsCovenantReceivePayment
::
PAYMENT_METHOD
[
$val
];
});
$grid
->
column
(
'received_at'
,
'收款时间'
);
$grid
->
column
(
'received_amount'
,
'收款金额'
);
$grid
->
column
(
'received_amount'
,
'收款金额'
)
->
display
(
function
(
$val
)
{
return
number_format
(
$val
,
2
);
});
$grid
->
column
(
'paymenter'
,
'付款人'
);
$grid
->
disableViewButton
();
...
...
@@ -82,13 +84,13 @@ protected function grid()
//已收款
$received_money
=
self
::
getReceivedByCid
(
$cid
);
//已收款未开票
$received_noinvoiced
=
(
$received_money
-
$invoiced_money
)
>
0
?
$received_money
-
$invoiced_money
:
0
;
$received_noinvoiced
=
(
$received_money
-
$invoiced_money
)
>
0
?
number_format
(
$received_money
-
$invoiced_money
,
2
)
:
0
;
//已开票未收款
$invoiced_noreceived
=
(
$invoiced_money
-
$received_money
)
>
0
?
$invoiced_money
-
$received_money
:
0
;
$invoiced_noreceived
=
(
$invoiced_money
-
$received_money
)
>
0
?
number_format
(
$invoiced_money
-
$received_money
,
2
)
:
0
;
}
$card_info
=
" 合同编号:
{
$cnumber
}
委托人:
{
$principal
}
"
;
$card_info
.=
" 律师编号:
{
$lnumber
}
律师姓名:
{
$lname
}
"
;
$card_info
.=
" 开票金额:
{
$invoiced_money
}
已收款:
{
$received_money
}
"
;
$card_info
.=
" 开票金额:
"
.
number_format
(
$invoiced_money
,
2
)
.
" 已收款:"
.
number_format
(
$received_money
,
2
)
;
$card_info
.=
" 已收款未开票:
{
$received_noinvoiced
}
已开票未收款:
{
$invoiced_noreceived
}
"
;
$tools
->
append
(
$card_info
);
});
...
...
app/Admin/Extensions/ReceivedInvoicedExport.php
View file @
421e9573
...
...
@@ -68,7 +68,7 @@ public function getList($param)
}
else
{
//已开票
$amount
=
ModelsCovenantReceivePayment
::
where
([
'rtype'
=>
$rtype
,
'lawyer_id'
=>
$lawyer_id
,
'year'
=>
$year
,
'month'
=>
$i
])
->
sum
(
'invoiced_money'
);
}
$data
[
$i
]
=
$amount
;
$data
[
$i
]
=
number_format
(
$amount
,
2
)
;
}
return
[
$data
];
...
...
app/Admin/Extensions/lawyerCommissionExportExten.php
View file @
421e9573
...
...
@@ -218,44 +218,47 @@ public function getList($param)
}
//转成字符串导出
foreach
(
$data
as
$kk
=>
&
$vv
)
{
if
(
$vv
[
'title'
]
==
'提成比例'
||
$vv
[
'title'
]
==
'提成留底'
)
{
continue
;
}
if
(
isset
(
$vv
[
1
]))
{
$vv
[
1
]
=
(
string
)
$vv
[
1
]
;
$vv
[
1
]
=
(
string
)
number_format
(
$vv
[
1
],
2
)
;
}
if
(
isset
(
$vv
[
2
]))
{
$vv
[
2
]
=
(
string
)
$vv
[
2
]
;
$vv
[
2
]
=
(
string
)
number_format
(
$vv
[
2
],
2
)
;
}
if
(
isset
(
$vv
[
3
]))
{
$vv
[
3
]
=
(
string
)
$vv
[
3
]
;
$vv
[
3
]
=
(
string
)
number_format
(
$vv
[
3
],
2
)
;
}
if
(
isset
(
$vv
[
4
]))
{
$vv
[
4
]
=
(
string
)
$vv
[
4
]
;
$vv
[
4
]
=
(
string
)
number_format
(
$vv
[
4
],
2
)
;
}
if
(
isset
(
$vv
[
5
]))
{
$vv
[
5
]
=
(
string
)
$vv
[
5
]
;
$vv
[
5
]
=
(
string
)
number_format
(
$vv
[
5
],
2
)
;
}
if
(
isset
(
$vv
[
6
]))
{
$vv
[
6
]
=
(
string
)
$vv
[
6
]
;
$vv
[
6
]
=
(
string
)
number_format
(
$vv
[
6
],
2
)
;
}
if
(
isset
(
$vv
[
7
]))
{
$vv
[
7
]
=
(
string
)
$vv
[
7
]
;
$vv
[
7
]
=
(
string
)
number_format
(
$vv
[
7
],
2
)
;
}
if
(
isset
(
$vv
[
8
]))
{
$vv
[
8
]
=
(
string
)
$vv
[
8
]
;
$vv
[
8
]
=
(
string
)
number_format
(
$vv
[
8
],
2
)
;
}
if
(
isset
(
$vv
[
9
]))
{
$vv
[
9
]
=
(
string
)
$vv
[
9
]
;
$vv
[
9
]
=
(
string
)
number_format
(
$vv
[
9
],
2
)
;
}
if
(
isset
(
$vv
[
10
]))
{
$vv
[
10
]
=
(
string
)
$vv
[
10
]
;
$vv
[
10
]
=
(
string
)
number_format
(
$vv
[
10
],
2
)
;
}
if
(
isset
(
$vv
[
11
]))
{
$vv
[
11
]
=
(
string
)
$vv
[
11
]
;
$vv
[
11
]
=
(
string
)
number_format
(
$vv
[
11
],
2
)
;
}
if
(
isset
(
$vv
[
12
]))
{
$vv
[
12
]
=
(
string
)
$vv
[
12
]
;
$vv
[
12
]
=
(
string
)
number_format
(
$vv
[
12
],
2
)
;
}
if
(
isset
(
$vv
[
'total'
]))
{
$vv
[
'total'
]
=
(
string
)
$vv
[
'total'
]
;
$vv
[
'total'
]
=
(
string
)
number_format
(
$vv
[
'total'
],
2
)
;
}
}
return
$data
;
...
...
app/Admin/Extensions/lawyerCostExportExten.php
View file @
421e9573
...
...
@@ -229,43 +229,43 @@ public function getList($param)
//转成字符串导出
foreach
(
$data
as
$kk
=>
&
$vv
)
{
if
(
isset
(
$vv
[
1
]))
{
$vv
[
1
]
=
(
string
)
$vv
[
1
]
;
$vv
[
1
]
=
(
string
)
number_format
(
$vv
[
1
],
2
)
;
}
if
(
isset
(
$vv
[
2
]))
{
$vv
[
2
]
=
(
string
)
$vv
[
2
]
;
$vv
[
2
]
=
(
string
)
number_format
(
$vv
[
2
],
2
)
;
}
if
(
isset
(
$vv
[
3
]))
{
$vv
[
3
]
=
(
string
)
$vv
[
3
]
;
$vv
[
3
]
=
(
string
)
number_format
(
$vv
[
3
],
2
)
;
}
if
(
isset
(
$vv
[
4
]))
{
$vv
[
4
]
=
(
string
)
$vv
[
4
]
;
$vv
[
4
]
=
(
string
)
number_format
(
$vv
[
4
],
2
)
;
}
if
(
isset
(
$vv
[
5
]))
{
$vv
[
5
]
=
(
string
)
$vv
[
5
]
;
$vv
[
5
]
=
(
string
)
number_format
(
$vv
[
5
],
2
)
;
}
if
(
isset
(
$vv
[
6
]))
{
$vv
[
6
]
=
(
string
)
$vv
[
6
]
;
$vv
[
6
]
=
(
string
)
number_format
(
$vv
[
6
],
2
)
;
}
if
(
isset
(
$vv
[
7
]))
{
$vv
[
7
]
=
(
string
)
$vv
[
7
]
;
$vv
[
7
]
=
(
string
)
number_format
(
$vv
[
7
],
2
)
;
}
if
(
isset
(
$vv
[
8
]))
{
$vv
[
8
]
=
(
string
)
$vv
[
8
]
;
$vv
[
8
]
=
(
string
)
number_format
(
$vv
[
8
],
2
)
;
}
if
(
isset
(
$vv
[
9
]))
{
$vv
[
9
]
=
(
string
)
$vv
[
9
]
;
$vv
[
9
]
=
(
string
)
number_format
(
$vv
[
9
],
2
)
;
}
if
(
isset
(
$vv
[
10
]))
{
$vv
[
10
]
=
(
string
)
$vv
[
10
]
;
$vv
[
10
]
=
(
string
)
number_format
(
$vv
[
10
],
2
)
;
}
if
(
isset
(
$vv
[
11
]))
{
$vv
[
11
]
=
(
string
)
$vv
[
11
]
;
$vv
[
11
]
=
(
string
)
number_format
(
$vv
[
11
],
2
)
;
}
if
(
isset
(
$vv
[
12
]))
{
$vv
[
12
]
=
(
string
)
$vv
[
12
]
;
$vv
[
12
]
=
(
string
)
number_format
(
$vv
[
12
],
2
)
;
}
if
(
isset
(
$vv
[
'total'
]))
{
$vv
[
'total'
]
=
(
string
)
$vv
[
'total'
]
;
$vv
[
'total'
]
=
(
string
)
number_format
(
$vv
[
'total'
],
2
)
;
}
}
return
$data
;
...
...
app/Admin/Repositories/Covenant.php
View file @
421e9573
...
...
@@ -183,13 +183,13 @@ public function getList(array $param)
//已收款
$receipt_money
=
ModelsCovenantReceivePayment
::
where
([
'cid'
=>
$cid
,
'rtype'
=>
1
])
->
sum
(
'received_amount'
);
$tmp
[
'invoice_amount'
]
=
$invoiced_money
;
$tmp
[
'receipt_money'
]
=
$receipt_money
;
$tmp
[
'invoice_amount'
]
=
number_format
(
$invoiced_money
,
2
)
;
$tmp
[
'receipt_money'
]
=
number_format
(
$receipt_money
,
2
)
;
//已收款未开票
$receipt_noinvoice
=
(
$receipt_money
-
$invoiced_money
)
>
0
?
$receipt_money
-
$invoiced_money
:
'-'
;
$receipt_noinvoice
=
(
$receipt_money
-
$invoiced_money
)
>
0
?
number_format
(
$receipt_money
-
$invoiced_money
,
2
)
:
'-'
;
$tmp
[
'receipt_noinvoice'
]
=
$receipt_noinvoice
;
//已开票未收款
$invoice_noreceipt
=
(
$invoiced_money
-
$receipt_money
)
>
0
?
$invoiced_money
-
$receipt_money
:
'-'
;
$invoice_noreceipt
=
(
$invoiced_money
-
$receipt_money
)
>
0
?
number_format
(
$invoiced_money
-
$receipt_money
,
2
)
:
'-'
;
$tmp
[
'invoice_noreceipt'
]
=
$invoice_noreceipt
;
array_push
(
$data
,
$tmp
);
}
...
...
app/Admin/Repositories/CovenantReceivePaymentCollect.php
View file @
421e9573
...
...
@@ -176,12 +176,12 @@ public function getList(array $param)
$tmp
[
'covenant_type'
]
=
$item
->
ctype
?
ModelsCovenant
::
CTYPE
[
$item
->
ctype
]
:
''
;
$tmp
[
'principal'
]
=
$item
->
principal
;
$tmp
[
'invoice_amount'
]
=
$item
->
invoiced_money
;
$tmp
[
'receipt_money'
]
=
$item
->
received_amount
;
$tmp
[
'invoice_amount'
]
=
number_format
(
$item
->
invoiced_money
,
2
)
;
$tmp
[
'receipt_money'
]
=
number_format
(
$item
->
received_amount
,
2
)
;
$receipt_noinvoice
=
$item
->
received_amount
-
$item
->
invoiced_money
;
$tmp
[
'receipt_noinvoice'
]
=
$receipt_noinvoice
>
0
?
$receipt_noinvoice
:
'-'
;
$tmp
[
'receipt_noinvoice'
]
=
$receipt_noinvoice
>
0
?
number_format
(
$receipt_noinvoice
,
2
)
:
'-'
;
$invoice_noreceipt
=
$item
->
invoiced_money
-
$item
->
received_amount
;
$tmp
[
'invoice_noreceipt'
]
=
$invoice_noreceipt
>
0
?
$invoice_noreceipt
:
'-'
;
$tmp
[
'invoice_noreceipt'
]
=
$invoice_noreceipt
>
0
?
number_format
(
$invoice_noreceipt
,
2
)
:
'-'
;
array_push
(
$data
,
$tmp
);
}
...
...
app/Admin/Repositories/LawyerCollect.php
View file @
421e9573
...
...
@@ -169,17 +169,27 @@ public function getList(array $param)
$tmp
[
'lnumber'
]
=
$item
->
lnumber
;
$tmp
[
'lname'
]
=
$item
->
lname
;
$tmp
[
'commission_ratio'
]
=
$item
->
commission_rate
;
$tmp
[
'receipt_money'
]
=
$receipt_money
;
$tmp
[
'receipt_money'
]
=
number_format
(
$receipt_money
,
2
)
;
$tmp
[
'commission_amount'
]
=
self
::
getCommissionAmount
(
$receipt_money
,
$item
->
commission_rate
);
$tmp
[
'receipt_noinvoice'
]
=
$receipt_noinvoice
;
$tmp
[
'invoice_noreceipt'
]
=
$invoice_noreceipt
;
$tmp
[
'cost'
]
=
ModelsLawyerCost
::
getTotalCost
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'basic_salary'
]
=
ModelsLawyerCost
::
getBasiSalary
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'special_additional'
]
=
ModelsLawyerCost
::
getSpecialAdditional
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'social'
]
=
ModelsLawyerCost
::
getSocial
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'accumulation_fund'
]
=
ModelsLawyerCost
::
getAccumulationFund
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'posting_tickets_fee'
]
=
$tickets_money
;
$tmp
[
'advance_fee'
]
=
ModelsLawyerCost
::
getAdvanceFee
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'receipt_noinvoice'
]
=
number_format
(
$receipt_noinvoice
,
2
);
$tmp
[
'invoice_noreceipt'
]
=
number_format
(
$invoice_noreceipt
,
2
);
$cost
=
ModelsLawyerCost
::
getTotalCost
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'cost'
]
=
number_format
(
$cost
,
2
);
$basic_salary
=
ModelsLawyerCost
::
getBasiSalary
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'basic_salary'
]
=
number_format
(
$basic_salary
,
2
);
$special_additional
=
ModelsLawyerCost
::
getSpecialAdditional
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'special_additional'
]
=
number_format
(
$special_additional
,
2
);
$social
=
ModelsLawyerCost
::
getSocial
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'social'
]
=
number_format
(
$social
,
2
);
$accumulation_fund
=
ModelsLawyerCost
::
getAccumulationFund
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'accumulation_fund'
]
=
number_format
(
$accumulation_fund
,
2
);
$tmp
[
'posting_tickets_fee'
]
=
number_format
(
$tickets_money
,
2
);
$advance_fee
=
ModelsLawyerCost
::
getAdvanceFee
(
$item
->
lawyer_id
,
$year
);
$tmp
[
'advance_fee'
]
=
number_format
(
$advance_fee
,
2
);
$tmp
[
'payable_commission'
]
=
self
::
getPayableAmount
(
$item
->
lawyer_id
,
$year
,
$item
->
commission_rate
,
$receipt_money
);
array_push
(
$data
,
$tmp
);
}
...
...
@@ -194,12 +204,12 @@ public static function getPayableAmount($lawyer_id, $year, $commission_rate, $re
{
$paid_amount
=
ModelsLawyerCost
::
getPaidAmount
(
$lawyer_id
,
$year
);
//已支付款项
$result
=
$receipt_money
*
(
$commission_rate
/
100
)
-
$paid_amount
;
return
sprintf
(
'%.2f'
,
$result
);
return
number_format
(
$result
,
2
);
}
//提成金额
public
static
function
getCommissionAmount
(
$receipt_money
,
$commission_rate
)
{
$result
=
$receipt_money
*
(
$commission_rate
/
100
);
return
sprintf
(
'%.2f'
,
$result
);
return
number_format
(
$result
,
2
);
}
}
app/Admin/Repositories/LawyerCommission.php
View file @
421e9573
...
...
@@ -183,6 +183,52 @@ public function get(Grid\Model $model)
$data
[
$key
]
=
$tmp
;
}
//转成字符串
foreach
(
$data
as
$kk
=>
&
$vv
)
{
if
(
$vv
[
'title'
]
==
'提成比例'
||
$vv
[
'title'
]
==
'提成留底'
)
{
continue
;
}
if
(
isset
(
$vv
[
1
]))
{
$vv
[
1
]
=
(
string
)
number_format
(
$vv
[
1
],
2
);
}
if
(
isset
(
$vv
[
2
]))
{
$vv
[
2
]
=
(
string
)
number_format
(
$vv
[
2
],
2
);
}
if
(
isset
(
$vv
[
3
]))
{
$vv
[
3
]
=
(
string
)
number_format
(
$vv
[
3
],
2
);
}
if
(
isset
(
$vv
[
4
]))
{
$vv
[
4
]
=
(
string
)
number_format
(
$vv
[
4
],
2
);
}
if
(
isset
(
$vv
[
5
]))
{
$vv
[
5
]
=
(
string
)
number_format
(
$vv
[
5
],
2
);
}
if
(
isset
(
$vv
[
6
]))
{
$vv
[
6
]
=
(
string
)
number_format
(
$vv
[
6
],
2
);
}
if
(
isset
(
$vv
[
7
]))
{
$vv
[
7
]
=
(
string
)
number_format
(
$vv
[
7
],
2
);
}
if
(
isset
(
$vv
[
8
]))
{
$vv
[
8
]
=
(
string
)
number_format
(
$vv
[
8
],
2
);
}
if
(
isset
(
$vv
[
9
]))
{
$vv
[
9
]
=
(
string
)
number_format
(
$vv
[
9
],
2
);
}
if
(
isset
(
$vv
[
10
]))
{
$vv
[
10
]
=
(
string
)
number_format
(
$vv
[
10
],
2
);
}
if
(
isset
(
$vv
[
11
]))
{
$vv
[
11
]
=
(
string
)
number_format
(
$vv
[
11
],
2
);
}
if
(
isset
(
$vv
[
12
]))
{
$vv
[
12
]
=
(
string
)
number_format
(
$vv
[
12
],
2
);
}
if
(
isset
(
$vv
[
'total'
]))
{
$vv
[
'total'
]
=
(
string
)
number_format
(
$vv
[
'total'
],
2
);
}
}
return
$data
;
}
}
app/Admin/Repositories/LawyerCost.php
View file @
421e9573
...
...
@@ -209,6 +209,48 @@ public function get(Grid\Model $model)
}
}
array_push
(
$data
,
$heji
);
//转成字符串导出
foreach
(
$data
as
$kk
=>
&
$vv
)
{
if
(
isset
(
$vv
[
1
]))
{
$vv
[
1
]
=
(
string
)
number_format
(
$vv
[
1
],
2
);
}
if
(
isset
(
$vv
[
2
]))
{
$vv
[
2
]
=
(
string
)
number_format
(
$vv
[
2
],
2
);
}
if
(
isset
(
$vv
[
3
]))
{
$vv
[
3
]
=
(
string
)
number_format
(
$vv
[
3
],
2
);
}
if
(
isset
(
$vv
[
4
]))
{
$vv
[
4
]
=
(
string
)
number_format
(
$vv
[
4
],
2
);
}
if
(
isset
(
$vv
[
5
]))
{
$vv
[
5
]
=
(
string
)
number_format
(
$vv
[
5
],
2
);
}
if
(
isset
(
$vv
[
6
]))
{
$vv
[
6
]
=
(
string
)
number_format
(
$vv
[
6
],
2
);
}
if
(
isset
(
$vv
[
7
]))
{
$vv
[
7
]
=
(
string
)
number_format
(
$vv
[
7
],
2
);
}
if
(
isset
(
$vv
[
8
]))
{
$vv
[
8
]
=
(
string
)
number_format
(
$vv
[
8
],
2
);
}
if
(
isset
(
$vv
[
9
]))
{
$vv
[
9
]
=
(
string
)
number_format
(
$vv
[
9
],
2
);
}
if
(
isset
(
$vv
[
10
]))
{
$vv
[
10
]
=
(
string
)
number_format
(
$vv
[
10
],
2
);
}
if
(
isset
(
$vv
[
11
]))
{
$vv
[
11
]
=
(
string
)
number_format
(
$vv
[
11
],
2
);
}
if
(
isset
(
$vv
[
12
]))
{
$vv
[
12
]
=
(
string
)
number_format
(
$vv
[
12
],
2
);
}
if
(
isset
(
$vv
[
'total'
]))
{
$vv
[
'total'
]
=
(
string
)
number_format
(
$vv
[
'total'
],
2
);
}
}
return
$data
;
// $data = [
// ['id' => 1, 'year' => '2016', 'jzsqNum' => '100', 'jzhpNum' => '100', 'sbTotal' => '100'],
...
...
app/Admin/Repositories/LawyerInvoicedPaymentCollect.php
View file @
421e9573
...
...
@@ -45,7 +45,7 @@ public function getList(array $param)
$data
=
[];
for
(
$i
=
1
;
$i
<=
$monthNum
;
$i
++
)
{
$received_amount
=
ModelsCovenantReceivePayment
::
where
([
'rtype'
=>
2
,
'lawyer_id'
=>
$lawyer_id
,
'year'
=>
$year
,
'month'
=>
$i
])
->
sum
(
'invoiced_money'
);
$data
[
$i
]
=
$received_amount
;
$data
[
$i
]
=
number_format
(
$received_amount
,
2
)
;
}
return
[
$data
];
...
...
app/Admin/Repositories/LawyerReceivePaymentCollect.php
View file @
421e9573
...
...
@@ -45,7 +45,7 @@ public function getList(array $param)
$data
=
[];
for
(
$i
=
1
;
$i
<=
$monthNum
;
$i
++
)
{
$received_amount
=
ModelsCovenantReceivePayment
::
where
([
'rtype'
=>
1
,
'lawyer_id'
=>
$lawyer_id
,
'year'
=>
$year
,
'month'
=>
$i
])
->
sum
(
'received_amount'
);
$data
[
$i
]
=
$received_amount
;
$data
[
$i
]
=
number_format
(
$received_amount
,
2
)
;
}
return
[
$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