Commit 584bad92 by lizhilin

更新

parent b1339123
...@@ -39,9 +39,9 @@ protected function grid() ...@@ -39,9 +39,9 @@ protected function grid()
//开票金额 //开票金额
$invoicedMoney = ModelsCovenantReceivePayment::getTotalInvoicedMoney($params, $received_at, $invoiced_at); $invoicedMoney = ModelsCovenantReceivePayment::getTotalInvoicedMoney($params, $received_at, $invoiced_at);
//已收款未开票 //已收款未开票
$receiptNoinvoice = ($receivedMoney - $invoicedMoney) > 0 ? $receivedMoney - $invoicedMoney : 0; $receiptNoinvoice = ($receivedMoney - $invoicedMoney) > 0 ? sprintf('%.2f', $receivedMoney - $invoicedMoney) : 0;
//已开票未收款 //已开票未收款
$invoiceNoreceipt = ($invoicedMoney - $receivedMoney) > 0 ? $invoicedMoney - $receivedMoney : 0; $invoiceNoreceipt = ($invoicedMoney - $receivedMoney) > 0 ? sprintf('%.2f', $invoicedMoney - $receivedMoney) : 0;
// 添加一行表头数据 // 添加一行表头数据
// $grid->header(function () use ($invoicedMoney, $receivedMoney, $receiptNoinvoice, $invoiceNoreceipt) { // $grid->header(function () use ($invoicedMoney, $receivedMoney, $receiptNoinvoice, $invoiceNoreceipt) {
// return '<div class="row" style="text-align:center;">' . // return '<div class="row" style="text-align:center;">' .
...@@ -63,9 +63,9 @@ protected function grid() ...@@ -63,9 +63,9 @@ protected function grid()
<th width="90">合计</th> <th width="90">合计</th>
<th width="90"></th> <th width="90"></th>
<th width="90"></th> <th width="90"></th>
<th width="90" text-align="center"> ' . $invoicedMoney . '</th> <th width="90">&nbsp;&nbsp;&nbsp;&nbsp;' . sprintf('%.2f', $invoicedMoney) . '</th>
<th width="90"> ' . $receivedMoney . '</th> <th width="90">&nbsp;&nbsp;' . sprintf('%.2f', $receivedMoney) . '</th>
<th width="90"> ' . $receiptNoinvoice . '</th> <th width="90">&nbsp;&nbsp;' . $receiptNoinvoice . '</th>
<th width="90"> ' . $invoiceNoreceipt . '</th> <th width="90"> ' . $invoiceNoreceipt . '</th>
</tr> </tr>
</thead> </thead>
......
...@@ -28,7 +28,8 @@ protected function grid() ...@@ -28,7 +28,8 @@ protected function grid()
//筛选参数 //筛选参数
$received_at = $invoiced_at = $params = []; $received_at = $invoiced_at = $params = [];
$params['number'] = $_GET['number'] ?? ''; //律师编号 $params['number'] = $_GET['number'] ?? ''; //律师编号
$params['year'] = $_GET['number'] ?? date('Y'); //律师编号 $params['name'] = $_GET['name'] ?? ''; //律师姓名
$params['year'] = $_GET['year'] ?? date('Y'); //律师编号
$received_at['start'] = isset($_GET['received_at']['start']) && $_GET['received_at']['start'] ? $_GET['received_at']['start'] . "-01" : ''; $received_at['start'] = isset($_GET['received_at']['start']) && $_GET['received_at']['start'] ? $_GET['received_at']['start'] . "-01" : '';
$received_at['end'] = isset($_GET['received_at']['end']) && $_GET['received_at']['end'] ? $_GET['received_at']['end'] . "-31" : ''; $received_at['end'] = isset($_GET['received_at']['end']) && $_GET['received_at']['end'] ? $_GET['received_at']['end'] . "-31" : '';
$invoiced_at['start'] = isset($_GET['invoiced_at']['start']) && $_GET['invoiced_at']['start'] ? $_GET['invoiced_at']['start'] . '-01' : ''; $invoiced_at['start'] = isset($_GET['invoiced_at']['start']) && $_GET['invoiced_at']['start'] ? $_GET['invoiced_at']['start'] . '-01' : '';
...@@ -72,13 +73,13 @@ protected function grid() ...@@ -72,13 +73,13 @@ protected function grid()
// 添加一行表头数据 // 添加一行表头数据
$grid->header(function () use ($received_amount, $commissionAmount, $received_noinvoiced, $invoiced_noreceived, $costTotal, $basicSalary, $special_additional, $social, $accumulation_fund, $posting_tickets, $advance_fee, $payable_amount) { $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 "> return '<div class="table-responsive table-wrapper complex-container table-middle mt-1 table-collapse ">
<table class="table custom-data-table data-table" border=1 id="grid-table"> <table class="table custom-data-table data-table" border=0 id="grid-table">
<thead> <thead>
<tr> <tr>
<th width="90">&nbsp;&nbsp;&nbsp;</th> <th width="90">&nbsp;&nbsp;&nbsp;</th>
<th width="90">&nbsp;&nbsp;合计&nbsp;&nbsp;</th> <th width="100" style="text-align:center;">合计</th>
<th width="90">&nbsp;&nbsp;</th> <th width="90">&nbsp;&nbsp;</th>
<th width="90" style="text-align:center;">' . $received_amount . '</th> <th width="100" style="text-align:center;">' . $received_amount . '</th>
<th width="80" style="text-align:center;">' . $commissionAmount . '</th> <th width="80" style="text-align:center;">' . $commissionAmount . '</th>
<th width="90" style="text-align:center;">' . $received_noinvoiced . '</th> <th width="90" style="text-align:center;">' . $received_noinvoiced . '</th>
<th width="90" style="text-align:center;">' . $invoiced_noreceived . '</th> <th width="90" style="text-align:center;">' . $invoiced_noreceived . '</th>
...@@ -116,20 +117,48 @@ protected function grid() ...@@ -116,20 +117,48 @@ protected function grid()
// '</div>'; // '</div>';
// }); // });
//$grid->column('id')->sortable(); //$grid->column('id')->sortable();
$grid->column('lnumber', '律师编号')->width(90); $grid->column('lnumber', '律师编号')->width(90)->style([
$grid->column('lname', '律师名称')->width(90); 'text-align:center',
$grid->column('commission_ratio', '提成比例(%)')->width(90); ]);
$grid->column('receipt_money', '创收已收款')->width(90); $grid->column('lname', '律师名称')->width(90)->style([
$grid->column('commission_amount', '提成金额')->width(80); 'text-align:center',
$grid->column('receipt_noinvoice', '已收款未开票')->width(90); ]);
$grid->column('invoice_noreceipt', '已开票未收款')->width(90); $grid->column('commission_ratio', '提成比例(%)')->width(90)->style([
$grid->column('cost', '成本合计')->width(90); 'text-align:center',
$grid->column('basic_salary', '基本工资')->width(90); ]);
$grid->column('special_additional', '专项附加')->width(90); $grid->column('receipt_money', '创收已收款')->width(90)->style([
$grid->column('social', '社保')->width(90); 'text-align:center',
$grid->column('accumulation_fund', '公积金')->width(90); ]);
$grid->column('posting_tickets_fee', '贴票金额')->width(90); $grid->column('commission_amount', '提成金额')->width(80)->style([
$grid->column('advance_fee', '预支款')->width(90); 'text-align:center',
]);
$grid->column('receipt_noinvoice', '已收款未开票')->width(90)->style([
'text-align:center',
]);
$grid->column('invoice_noreceipt', '已开票未收款')->width(90)->style([
'text-align:center',
]);
$grid->column('cost', '成本合计')->width(90)->style([
'text-align:center',
]);
$grid->column('basic_salary', '基本工资')->width(90)->style([
'text-align:center',
]);
$grid->column('special_additional', '专项附加')->width(90)->style([
'text-align:center',
]);
$grid->column('social', '社保')->width(90)->style([
'text-align:center',
]);
$grid->column('accumulation_fund', '公积金')->width(90)->style([
'text-align:center',
]);
$grid->column('posting_tickets_fee', '贴票金额')->width(90)->style([
'text-align:center',
]);
$grid->column('advance_fee', '预支款')->width(90)->style([
'text-align:center',
]);
$grid->column('payable_commission', '可结算提成')->width(90); $grid->column('payable_commission', '可结算提成')->width(90);
// $grid->column('created_at'); // $grid->column('created_at');
......
...@@ -220,11 +220,10 @@ protected function form() ...@@ -220,11 +220,10 @@ protected function form()
$form->text('accumulation_fund', '公积金')->readOnly(); $form->text('accumulation_fund', '公积金')->readOnly();
$form->text('annual_inspection_fee')->required(); $form->text('annual_inspection_fee')->required();
$form->text('annuity')->required(); $form->text('annuity')->required();
$form->text('assistant_fee')->required();
$form->text('office_rental_fee')->required(); $form->text('office_rental_fee')->required();
$form->text('noticket_cost')->readOnly(); $form->text('noticket_cost')->readOnly();
//$form->text('posting_tickets_fee'); //$form->text('posting_tickets_fee');
$form->text('assistant_fee')->required();
$form->text('special_additional')->required();
$form->text('advance_fee'); $form->text('advance_fee');
$form->text('personal_income_tax')->required(); $form->text('personal_income_tax')->required();
...@@ -262,7 +261,7 @@ protected function form() ...@@ -262,7 +261,7 @@ protected function form()
//专项附加 //专项附加
var additional = $("input[name='special_additional']").val().length>0?$("input[name='special_additional']").val():0; var additional = $("input[name='special_additional']").val().length>0?$("input[name='special_additional']").val():0;
//社保单位部分 //社保单位部分
var social_company = $("input[name='social_company_fee']").val().lenght>0?$("input[name='social_company_fee']").val():0; var social_company = $("input[name='social_company_fee']").val().length>0?$("input[name='social_company_fee']").val():0;
//公积金单位部分 //公积金单位部分
var accumulation_fund = $("input[name='accumulation_fund_company_fee']").val().length>0?$("input[name='accumulation_fund_company_fee']").val():0; var accumulation_fund = $("input[name='accumulation_fund_company_fee']").val().length>0?$("input[name='accumulation_fund_company_fee']").val():0;
//助理律师成本 //助理律师成本
......
...@@ -23,7 +23,7 @@ protected function grid() ...@@ -23,7 +23,7 @@ protected function grid()
{ {
return Grid::make(new ModelLawyerCost(), function (Grid $grid) { return Grid::make(new ModelLawyerCost(), function (Grid $grid) {
$number = $grid->model()->filter()->input('no') ?? ''; //律师编号 $number = $grid->model()->filter()->input('no') ?? ''; //律师编号
$year = $grid->model()->filter()->input('year') ?? ''; $year = $grid->model()->filter()->input('year') ?? date('Y');
$where = []; $where = [];
if ($number) { if ($number) {
$where['number'] = $number; $where['number'] = $number;
...@@ -51,8 +51,9 @@ protected function grid() ...@@ -51,8 +51,9 @@ protected function grid()
$grid->column('accumulation_fund_company_fee', '公积金公司部分'); $grid->column('accumulation_fund_company_fee', '公积金公司部分');
$grid->column('annual_inspection_fee', '律所年检费'); $grid->column('annual_inspection_fee', '律所年检费');
$grid->column('annuity', '律所年金'); $grid->column('annuity', '律所年金');
$grid->column('posting_tickets_fee', '贴票成本')->display(function () { $grid->column('posting_tickets_fee', '贴票成本')->display(function () use ($year) {
return $this->assistant_fee; $lawyerObj = ModelsLawyer::find($this->lawyer_id);
return ModelLawyerCost::getPostingTicketsMoney($this->lawyer_id, $year, $lawyerObj->commission_rate, $lawyerObj->ticket_ratio);
}); });
$grid->column('assistant_fee', '助理律师成本'); $grid->column('assistant_fee', '助理律师成本');
$grid->column('office_rental_fee', '办公租赁成本'); $grid->column('office_rental_fee', '办公租赁成本');
...@@ -138,6 +139,7 @@ protected function form() ...@@ -138,6 +139,7 @@ protected function form()
$form->display('number'); $form->display('number');
$form->text('lname')->required(); $form->text('lname')->required();
$form->text('basic_salary')->required(); $form->text('basic_salary')->required();
$form->text('special_additional')->required();
$form->text('social_person_fee')->required(); $form->text('social_person_fee')->required();
$form->text('social_company_fee')->required(); $form->text('social_company_fee')->required();
//$social = $form->model()->social; //$social = $form->model()->social;
...@@ -147,11 +149,10 @@ protected function form() ...@@ -147,11 +149,10 @@ protected function form()
$form->text('accumulation_fund', '公积金')->readOnly(); $form->text('accumulation_fund', '公积金')->readOnly();
$form->text('annual_inspection_fee')->required(); $form->text('annual_inspection_fee')->required();
$form->text('annuity')->required(); $form->text('annuity')->required();
$form->text('assistant_fee')->required();
$form->text('office_rental_fee')->required(); $form->text('office_rental_fee')->required();
$form->text('noticket_cost')->readOnly(); $form->text('noticket_cost')->readOnly();
//$form->text('posting_tickets_fee'); //$form->text('posting_tickets_fee');
$form->text('assistant_fee')->required();
$form->text('special_additional')->required();
$form->text('advance_fee'); $form->text('advance_fee');
$form->text('personal_income_tax')->required(); $form->text('personal_income_tax')->required();
...@@ -177,9 +178,9 @@ protected function form() ...@@ -177,9 +178,9 @@ protected function form()
}); });
//公积金 //公积金
$("input[name='accumulation_fund_company_fee']").on('blur', function() { $("input[name='accumulation_fund_company_fee']").on('blur', function() {
var person_fee = $("input[name='accumulation_fund_person_fee']").val().length>0?$("input[name='accumulation_fund_person_fee']").val():0; var fund_person_fee = $("input[name='accumulation_fund_person_fee']").val().length>0?$("input[name='accumulation_fund_person_fee']").val():0;
var company_fee = $("input[name='accumulation_fund_company_fee']").val().length>0?$("input[name='accumulation_fund_company_fee']").val():0; var fund_company_fee = $("input[name='accumulation_fund_company_fee']").val().length>0?$("input[name='accumulation_fund_company_fee']").val():0;
var accumulation_fund = parseFloat(person_fee) + parseFloat(company_fee); var accumulation_fund = parseFloat(fund_person_fee) + parseFloat(fund_company_fee);
$("input[name='accumulation_fund']").val(accumulation_fund); $("input[name='accumulation_fund']").val(accumulation_fund);
}); });
//无票成本 //无票成本
...@@ -189,7 +190,7 @@ protected function form() ...@@ -189,7 +190,7 @@ protected function form()
//专项附加 //专项附加
var additional = $("input[name='special_additional']").val().length>0?$("input[name='special_additional']").val():0; var additional = $("input[name='special_additional']").val().length>0?$("input[name='special_additional']").val():0;
//社保单位部分 //社保单位部分
var social_company = $("input[name='social_company_fee']").val().lenght>0?$("input[name='social_company_fee']").val():0; var social_company = $("input[name='social_company_fee']").val().length>0?$("input[name='social_company_fee']").val():0;
//公积金单位部分 //公积金单位部分
var accumulation_fund = $("input[name='accumulation_fund_company_fee']").val().length>0?$("input[name='accumulation_fund_company_fee']").val():0; var accumulation_fund = $("input[name='accumulation_fund_company_fee']").val().length>0?$("input[name='accumulation_fund_company_fee']").val():0;
//助理律师成本 //助理律师成本
......
...@@ -76,6 +76,7 @@ public function getList(array $param) ...@@ -76,6 +76,7 @@ public function getList(array $param)
$received_at = $param['search']['received_at'] ?? []; $received_at = $param['search']['received_at'] ?? [];
$list = []; $list = [];
DB::enableQueryLog();
$note_monitor = DB::table('covenant_receive_payment AS rp') $note_monitor = DB::table('covenant_receive_payment AS rp')
->select(DB::raw('rp.lawyer_id,rp.year,l.number as lnumber,l.name as lname,l.commission_rate,sum(invoiced_money) as invoiced_money,sum(received_amount) as received_amount')) ->select(DB::raw('rp.lawyer_id,rp.year,l.number as lnumber,l.name as lname,l.commission_rate,sum(invoiced_money) as invoiced_money,sum(received_amount) as received_amount'))
//->select(['rp.*', 'l.name as lname', 'l.number as lnumber', 'l.commission_rate']) //->select(['rp.*', 'l.name as lname', 'l.number as lnumber', 'l.commission_rate'])
...@@ -137,7 +138,12 @@ public function getList(array $param) ...@@ -137,7 +138,12 @@ public function getList(array $param)
} }
} }
// 计算列表总数 // 计算列表总数
$count = $note_monitor->count(); $count = 0;
$cObj = $note_monitor->groupBy('rp.lawyer_id')->get();
if ($cObj->toArray()) {
$count = count($cObj->toArray());
}
//$queries = DB::getQueryLog();
// 获取列表 // 获取列表
$data = []; $data = [];
$list = $note_monitor->limit($prePage)->offset($offsetstart)->groupBy('rp.lawyer_id')->get()->toArray(); $list = $note_monitor->limit($prePage)->offset($offsetstart)->groupBy('rp.lawyer_id')->get()->toArray();
......
...@@ -98,8 +98,8 @@ public static function getTotalBasiSalary($params, $received_at, $invoiced_at) ...@@ -98,8 +98,8 @@ public static function getTotalBasiSalary($params, $received_at, $invoiced_at)
public static function getTotalInfo($params, $received_at, $invoiced_at) public static function getTotalInfo($params, $received_at, $invoiced_at)
{ {
// 获取筛选条件 // 获取筛选条件
$lnum = $params['lnum'] ?? ''; $lnum = $params['number'] ?? '';
$lname = $params['lname'] ?? ''; $lname = $params['name'] ?? '';
$year = $params['year'] ?? date('Y'); $year = $params['year'] ?? date('Y');
DB::enableQueryLog(); DB::enableQueryLog();
......
...@@ -209,7 +209,7 @@ public static function getPostingTicketsMoney($lawyer_id, $year, $commission_rat ...@@ -209,7 +209,7 @@ public static function getPostingTicketsMoney($lawyer_id, $year, $commission_rat
$ticket = ($commission - $paid_amount) * ($ticket_ratio / 100); $ticket = ($commission - $paid_amount) * ($ticket_ratio / 100);
} }
} elseif ($commission_rate == 88 || $commission_rate == 90) { } elseif ($commission_rate == 88 || $commission_rate == 90) {
if ($commission > 200000) { if ($commission > 120000) {
$ticket = ($commission - $paid_amount) * ($ticket_ratio / 100); $ticket = ($commission - $paid_amount) * ($ticket_ratio / 100);
} }
} }
...@@ -249,7 +249,7 @@ public static function getAllPostingTicketsMoney($lawyer_id, $year) ...@@ -249,7 +249,7 @@ public static function getAllPostingTicketsMoney($lawyer_id, $year)
$ticket = ($commission - $paid_amount) * ($ticket_ratio / 100); $ticket = ($commission - $paid_amount) * ($ticket_ratio / 100);
} }
} elseif ($commission_rate == 88 || $commission_rate == 90) { } elseif ($commission_rate == 88 || $commission_rate == 90) {
if ($commission > 200000) { if ($commission > 120000) {
$ticket = ($commission - $paid_amount) * ($ticket_ratio / 100); $ticket = ($commission - $paid_amount) * ($ticket_ratio / 100);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment