Commit 421e9573 by lizhilin

更新

parent f919ce34
...@@ -36,11 +36,18 @@ protected function grid() ...@@ -36,11 +36,18 @@ protected function grid()
$grid->column('sign_at'); $grid->column('sign_at');
$grid->column('principal', '委托人'); $grid->column('principal', '委托人');
$grid->column('lawyer.name', '办案律师'); $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) { $grid->column('payment_method')->display(function ($val) {
return $val == 1 ? '开票付款' : '付款开票'; 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) { $grid->column('is_closed', '结案状态')->display(function ($val) {
return $val ? '已结案' : '未结案'; return $val ? '已结案' : '未结案';
}); });
......
...@@ -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 ? 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) { // $grid->header(function () use ($invoicedMoney, $receivedMoney, $receiptNoinvoice, $invoiceNoreceipt) {
// return '<div class="row" style="text-align:center;">' . // return '<div class="row" style="text-align:center;">' .
...@@ -62,8 +62,8 @@ protected function grid() ...@@ -62,8 +62,8 @@ 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">' . sprintf('%.2f', $invoicedMoney) . '</th> <th width="90">' . number_format($invoicedMoney, 2) . '</th>
<th width="90">' . sprintf('%.2f', $receivedMoney) . '</th> <th width="90">' . number_format($receivedMoney, 2) . '</th>
<th width="90">' . $receiptNoinvoice . '</th> <th width="90">' . $receiptNoinvoice . '</th>
<th width="90"> ' . $invoiceNoreceipt . '</th> <th width="90"> ' . $invoiceNoreceipt . '</th>
</tr> </tr>
......
...@@ -55,21 +55,21 @@ protected function grid() ...@@ -55,21 +55,21 @@ protected function grid()
//提成金额 //提成金额
$commissionAmount = $totalInfo['commission_amount']; //ModelsCovenantReceivePayment::getCommissionAmount($number, $year, $received_at); $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) { $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 ">
...@@ -78,10 +78,10 @@ protected function grid() ...@@ -78,10 +78,10 @@ protected function grid()
<tr> <tr>
<th width="100" style="text-align:right;">合计</th> <th width="100" style="text-align:right;">合计</th>
<th width="90">&nbsp;&nbsp;</th> <th width="90">&nbsp;&nbsp;</th>
<th width="90" style="text-align:left;">' . sprintf('%.2f', $received_amount) . '</th> <th width="90" style="text-align:left;">' . number_format($received_amount, 2) . '</th>
<th width="80" style="text-align:left;">' . sprintf('%.2f', $commissionAmount) . '</th> <th width="80" style="text-align:left;">' . number_format($commissionAmount, 2) . '</th>
<th width="90" style="text-align:left;">' . sprintf('%.2f', $received_noinvoiced) . '</th> <th width="90" style="text-align:left;">' . number_format($received_noinvoiced, 2) . '</th>
<th width="90" style="text-align:left;">' . sprintf('%.2f', $invoiced_noreceived) . '</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;">' . $costTotal . '</th>
<th width="90" style="text-align:left;">' . $basicSalary . '</th> <th width="90" style="text-align:left;">' . $basicSalary . '</th>
<th width="90" style="text-align:left;">' . $special_additional . '</th> <th width="90" style="text-align:left;">' . $special_additional . '</th>
...@@ -99,26 +99,7 @@ protected function grid() ...@@ -99,26 +99,7 @@ protected function grid()
</table> </table>
</div>'; </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([ $grid->column('lname', '律师名称')->width(90)->style([
'text-align:left', 'text-align:left',
]); ]);
......
...@@ -29,33 +29,33 @@ protected function grid() ...@@ -29,33 +29,33 @@ protected function grid()
$grid->column('name', '律师姓名'); $grid->column('name', '律师姓名');
$grid->column('received_money', '创收已收款')->display(function ($val) use ($year) { $grid->column('received_money', '创收已收款')->display(function ($val) use ($year) {
$money = self::getReceivedMoney($year, $this->id); $money = self::getReceivedMoney($year, $this->id);
return $money; return number_format($money, 2);
}); });
$grid->column('commission_rate', '提成比例 %'); $grid->column('commission_rate', '提成比例 %');
$grid->column('paid_amount', '已支付款项')->display(function ($val) use ($year) { $grid->column('paid_amount', '已支付款项')->display(function ($val) use ($year) {
$paid_amount = self::getPaidAmount($year, $this->id); $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) { $grid->column('posting_tickets_money', '贴票金额')->display(function () use ($year) {
$tickets_money = ModelLawyerCost::getAllPostingTicketsMoney($this->id, $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) { $grid->column('commission_retention', '预留结案费')->display(function () use ($year) {
$received_money = ModelCovenantReceivePayment::getReceivedMoney($this->id, $year); //创收已收款 $received_money = ModelCovenantReceivePayment::getReceivedMoney($this->id, $year); //创收已收款
$commission_rate = $this->commission_rate; //提成比例 $commission_rate = $this->commission_rate; //提成比例
$result = $received_money * ($commission_rate / 100) * 0.05; $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) { $grid->column('payable_amount', '可支付提成结算金额')->display(function () use ($year) {
$received_money = ModelCovenantReceivePayment::getReceivedMoney($this->id, $year); //创收已收款 $received_money = ModelCovenantReceivePayment::getReceivedMoney($this->id, $year); //创收已收款
$paid_amount = ModelLawyerCost::getPaidAmount($this->id, $year); //已支付款项 $paid_amount = ModelLawyerCost::getPaidAmount($this->id, $year); //已支付款项
$commission_rate = $this->commission_rate; //提成比例 $commission_rate = $this->commission_rate; //提成比例
$result = $received_money * ($commission_rate / 100) - $paid_amount; $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) { $grid->column('personal_income_tax', '个人所得税')->display(function ($val) use ($year) {
$amount = self::getPersonalIncomeTax($year, $this->id); $amount = self::getPersonalIncomeTax($year, $this->id);
return sprintf('%.2f', $amount); return number_format($amount, 2);
}); });
// $grid->column('created_at'); // $grid->column('created_at');
......
...@@ -48,7 +48,8 @@ protected function grid() ...@@ -48,7 +48,8 @@ protected function grid()
return self::getAnnuity($this->number, $year); return self::getAnnuity($this->number, $year);
}); });
$grid->column('posting_tickets_fee', '贴票成本')->display(function ($val) use ($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) { $grid->column('assistant_fee', '助理律师成本')->display(function ($val) use ($year) {
return self::getAssistantFee($this->number, $year); return self::getAssistantFee($this->number, $year);
...@@ -97,12 +98,14 @@ protected function grid() ...@@ -97,12 +98,14 @@ protected function grid()
//基本工资 //基本工资
public static function getBasiSalary($number, $year) 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) 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) ...@@ -110,7 +113,8 @@ public static function getSocial($number, $year)
{ {
$social_person_fee = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('social_person_fee'); $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'); $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) ...@@ -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_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'); $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) public static function getAnnualInspectionFee($number, $year)
{ {
$annual_inspection_fee = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('annual_inspection_fee'); $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) public static function getAnnuity($number, $year)
{ {
$annuity = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('annuity'); $annuity = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('annuity');
return $annuity; return number_format($annuity, 2);
} }
//助理律师成本 //助理律师成本
public static function getAssistantFee($number, $year) public static function getAssistantFee($number, $year)
{ {
$annuity = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('assistant_fee'); $annuity = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('assistant_fee');
return $annuity; return number_format($annuity, 2);
} }
//办公室租赁成本 //办公室租赁成本
public static function getOfficeRentalFee($number, $year) public static function getOfficeRentalFee($number, $year)
{ {
$office_rental_fee = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('office_rental_fee'); $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) public static function getPersonalIncomeTax($number, $year)
{ {
$personal_income_tax = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('personal_income_tax'); $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) public static function getNoticketCost($number, $year)
{ {
$noticket_cost = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('noticket_cost'); $noticket_cost = ModelLawyerCost::where(['number' => $number, 'year' => $year])->sum('noticket_cost');
return $noticket_cost; return number_format($noticket_cost, 2);
} }
/** /**
......
...@@ -35,14 +35,14 @@ protected function grid() ...@@ -35,14 +35,14 @@ protected function grid()
$invoiced_money = ModelCovenantReceivePayment::where(['lawyer_id' => $this->id, 'rtype' => 2]) $invoiced_money = ModelCovenantReceivePayment::where(['lawyer_id' => $this->id, 'rtype' => 2])
->where('invoiced_at', 'like', $year . '%') ->where('invoiced_at', 'like', $year . '%')
->sum('invoiced_money'); ->sum('invoiced_money');
return $invoiced_money; return number_format($invoiced_money, 2);
}); });
$grid->column('field2', '已收款')->display(function () use ($year) { $grid->column('field2', '已收款')->display(function () use ($year) {
//已收款 //已收款
$receipt_money = ModelCovenantReceivePayment::where(['lawyer_id' => $this->id, 'rtype' => 1]) $receipt_money = ModelCovenantReceivePayment::where(['lawyer_id' => $this->id, 'rtype' => 1])
->where('received_at', 'like', $year . '%') ->where('received_at', 'like', $year . '%')
->sum('received_amount'); ->sum('received_amount');
return $receipt_money; return number_format($receipt_money, 2);
}); });
$grid->column('field3', '已收款未开票')->display(function () use ($year) { $grid->column('field3', '已收款未开票')->display(function () use ($year) {
//开票金额 //开票金额
...@@ -54,7 +54,7 @@ protected function grid() ...@@ -54,7 +54,7 @@ protected function grid()
->where('received_at', 'like', $year . '%') ->where('received_at', 'like', $year . '%')
->sum('received_amount'); ->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; return $receipt_noinvoice;
}); });
$grid->column('field4', '已开票未收款')->display(function ($val) { $grid->column('field4', '已开票未收款')->display(function ($val) {
......
...@@ -49,7 +49,9 @@ protected function grid() ...@@ -49,7 +49,9 @@ protected function grid()
$grid->model()->where(['rtype' => 2, 'lawyer_id' => $lawyer_id, 'cid' => $cid])->orderBy("id", "desc"); $grid->model()->where(['rtype' => 2, 'lawyer_id' => $lawyer_id, 'cid' => $cid])->orderBy("id", "desc");
//$grid->column('id')->sortable(); //$grid->column('id')->sortable();
$grid->column('invoiced_at', '开票时间'); $grid->column('invoiced_at', '开票时间');
$grid->column('invoiced_money', '开票金额'); $grid->column('invoiced_money', '开票金额')->display(function ($val) {
return number_format($val, 2);
});
$grid->disableViewButton(); $grid->disableViewButton();
$grid->disableCreateButton(); $grid->disableCreateButton();
...@@ -71,13 +73,13 @@ protected function grid() ...@@ -71,13 +73,13 @@ protected function grid()
//已收款 //已收款
$received_money = self::getReceivedByCid($cid); $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 = "&nbsp;&nbsp;合同编号:{$cnumber}&nbsp;&nbsp;&nbsp;委托人:{$principal}"; $card_info = "&nbsp;&nbsp;合同编号:{$cnumber}&nbsp;&nbsp;&nbsp;委托人:{$principal}";
$card_info .= "&nbsp;&nbsp;律师编号:{$lnumber}&nbsp;&nbsp;&nbsp;律师姓名:{$lname}"; $card_info .= "&nbsp;&nbsp;律师编号:{$lnumber}&nbsp;&nbsp;&nbsp;律师姓名:{$lname}";
$card_info .= "&nbsp;&nbsp;开票金额:{$invoiced_money}&nbsp;&nbsp;&nbsp;已收款:{$received_money}"; $card_info .= "&nbsp;&nbsp;开票金额:" . number_format($invoiced_money, 2) . "&nbsp;&nbsp;&nbsp;已收款:" . number_format($received_money, 2);
$card_info .= "&nbsp;&nbsp;已收款未开票:{$received_noinvoiced}&nbsp;&nbsp;&nbsp;已开票未收款:{$invoiced_noreceived}"; $card_info .= "&nbsp;&nbsp;已收款未开票:{$received_noinvoiced}&nbsp;&nbsp;&nbsp;已开票未收款:{$invoiced_noreceived}";
$tools->append($card_info); $tools->append($card_info);
}); });
......
...@@ -59,7 +59,9 @@ protected function grid() ...@@ -59,7 +59,9 @@ protected function grid()
return ModelsCovenantReceivePayment::PAYMENT_METHOD[$val]; return ModelsCovenantReceivePayment::PAYMENT_METHOD[$val];
}); });
$grid->column('received_at', '收款时间'); $grid->column('received_at', '收款时间');
$grid->column('received_amount', '收款金额'); $grid->column('received_amount', '收款金额')->display(function ($val) {
return number_format($val, 2);
});
$grid->column('paymenter', '付款人'); $grid->column('paymenter', '付款人');
$grid->disableViewButton(); $grid->disableViewButton();
...@@ -82,13 +84,13 @@ protected function grid() ...@@ -82,13 +84,13 @@ protected function grid()
//已收款 //已收款
$received_money = self::getReceivedByCid($cid); $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 = "&nbsp;&nbsp;合同编号:{$cnumber}&nbsp;&nbsp;&nbsp;委托人:{$principal}"; $card_info = "&nbsp;&nbsp;合同编号:{$cnumber}&nbsp;&nbsp;&nbsp;委托人:{$principal}";
$card_info .= "&nbsp;&nbsp;律师编号:{$lnumber}&nbsp;&nbsp;&nbsp;律师姓名:{$lname}"; $card_info .= "&nbsp;&nbsp;律师编号:{$lnumber}&nbsp;&nbsp;&nbsp;律师姓名:{$lname}";
$card_info .= "&nbsp;&nbsp;开票金额:{$invoiced_money}&nbsp;&nbsp;&nbsp;已收款:{$received_money}"; $card_info .= "&nbsp;&nbsp;开票金额:" . number_format($invoiced_money, 2) . "&nbsp;&nbsp;&nbsp;已收款:" . number_format($received_money, 2);
$card_info .= "&nbsp;&nbsp;已收款未开票:{$received_noinvoiced}&nbsp;&nbsp;&nbsp;已开票未收款:{$invoiced_noreceived}"; $card_info .= "&nbsp;&nbsp;已收款未开票:{$received_noinvoiced}&nbsp;&nbsp;&nbsp;已开票未收款:{$invoiced_noreceived}";
$tools->append($card_info); $tools->append($card_info);
}); });
......
...@@ -68,7 +68,7 @@ public function getList($param) ...@@ -68,7 +68,7 @@ public function getList($param)
} else { //已开票 } else { //已开票
$amount = ModelsCovenantReceivePayment::where(['rtype' => $rtype, 'lawyer_id' => $lawyer_id, 'year' => $year, 'month' => $i])->sum('invoiced_money'); $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]; return [$data];
......
...@@ -218,44 +218,47 @@ public function getList($param) ...@@ -218,44 +218,47 @@ public function getList($param)
} }
//转成字符串导出 //转成字符串导出
foreach ($data as $kk => &$vv) { foreach ($data as $kk => &$vv) {
if ($vv['title'] == '提成比例' || $vv['title'] == '提成留底') {
continue;
}
if (isset($vv[1])) { if (isset($vv[1])) {
$vv[1] = (string)$vv[1]; $vv[1] = (string)number_format($vv[1], 2);
} }
if (isset($vv[2])) { if (isset($vv[2])) {
$vv[2] = (string)$vv[2]; $vv[2] = (string)number_format($vv[2], 2);
} }
if (isset($vv[3])) { if (isset($vv[3])) {
$vv[3] = (string)$vv[3]; $vv[3] = (string)number_format($vv[3], 2);
} }
if (isset($vv[4])) { if (isset($vv[4])) {
$vv[4] = (string)$vv[4]; $vv[4] = (string)number_format($vv[4], 2);
} }
if (isset($vv[5])) { if (isset($vv[5])) {
$vv[5] = (string)$vv[5]; $vv[5] = (string)number_format($vv[5], 2);
} }
if (isset($vv[6])) { if (isset($vv[6])) {
$vv[6] = (string)$vv[6]; $vv[6] = (string)number_format($vv[6], 2);
} }
if (isset($vv[7])) { if (isset($vv[7])) {
$vv[7] = (string)$vv[7]; $vv[7] = (string)number_format($vv[7], 2);
} }
if (isset($vv[8])) { if (isset($vv[8])) {
$vv[8] = (string)$vv[8]; $vv[8] = (string)number_format($vv[8], 2);
} }
if (isset($vv[9])) { if (isset($vv[9])) {
$vv[9] = (string)$vv[9]; $vv[9] = (string)number_format($vv[9], 2);
} }
if (isset($vv[10])) { if (isset($vv[10])) {
$vv[10] = (string)$vv[10]; $vv[10] = (string)number_format($vv[10], 2);
} }
if (isset($vv[11])) { if (isset($vv[11])) {
$vv[11] = (string)$vv[11]; $vv[11] = (string)number_format($vv[11], 2);
} }
if (isset($vv[12])) { if (isset($vv[12])) {
$vv[12] = (string)$vv[12]; $vv[12] = (string)number_format($vv[12], 2);
} }
if (isset($vv['total'])) { if (isset($vv['total'])) {
$vv['total'] = (string)$vv['total']; $vv['total'] = (string)number_format($vv['total'], 2);
} }
} }
return $data; return $data;
......
...@@ -229,43 +229,43 @@ public function getList($param) ...@@ -229,43 +229,43 @@ public function getList($param)
//转成字符串导出 //转成字符串导出
foreach ($data as $kk => &$vv) { foreach ($data as $kk => &$vv) {
if (isset($vv[1])) { if (isset($vv[1])) {
$vv[1] = (string)$vv[1]; $vv[1] = (string)number_format($vv[1], 2);
} }
if (isset($vv[2])) { if (isset($vv[2])) {
$vv[2] = (string)$vv[2]; $vv[2] = (string)number_format($vv[2], 2);
} }
if (isset($vv[3])) { if (isset($vv[3])) {
$vv[3] = (string)$vv[3]; $vv[3] = (string)number_format($vv[3], 2);
} }
if (isset($vv[4])) { if (isset($vv[4])) {
$vv[4] = (string)$vv[4]; $vv[4] = (string)number_format($vv[4], 2);
} }
if (isset($vv[5])) { if (isset($vv[5])) {
$vv[5] = (string)$vv[5]; $vv[5] = (string)number_format($vv[5], 2);
} }
if (isset($vv[6])) { if (isset($vv[6])) {
$vv[6] = (string)$vv[6]; $vv[6] = (string)number_format($vv[6], 2);
} }
if (isset($vv[7])) { if (isset($vv[7])) {
$vv[7] = (string)$vv[7]; $vv[7] = (string)number_format($vv[7], 2);
} }
if (isset($vv[8])) { if (isset($vv[8])) {
$vv[8] = (string)$vv[8]; $vv[8] = (string)number_format($vv[8], 2);
} }
if (isset($vv[9])) { if (isset($vv[9])) {
$vv[9] = (string)$vv[9]; $vv[9] = (string)number_format($vv[9], 2);
} }
if (isset($vv[10])) { if (isset($vv[10])) {
$vv[10] = (string)$vv[10]; $vv[10] = (string)number_format($vv[10], 2);
} }
if (isset($vv[11])) { if (isset($vv[11])) {
$vv[11] = (string)$vv[11]; $vv[11] = (string)number_format($vv[11], 2);
} }
if (isset($vv[12])) { if (isset($vv[12])) {
$vv[12] = (string)$vv[12]; $vv[12] = (string)number_format($vv[12], 2);
} }
if (isset($vv['total'])) { if (isset($vv['total'])) {
$vv['total'] = (string)$vv['total']; $vv['total'] = (string)number_format($vv['total'], 2);
} }
} }
return $data; return $data;
......
...@@ -183,13 +183,13 @@ public function getList(array $param) ...@@ -183,13 +183,13 @@ public function getList(array $param)
//已收款 //已收款
$receipt_money = ModelsCovenantReceivePayment::where(['cid' => $cid, 'rtype' => 1])->sum('received_amount'); $receipt_money = ModelsCovenantReceivePayment::where(['cid' => $cid, 'rtype' => 1])->sum('received_amount');
$tmp['invoice_amount'] = $invoiced_money; $tmp['invoice_amount'] = number_format($invoiced_money, 2);
$tmp['receipt_money'] = $receipt_money; $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; $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; $tmp['invoice_noreceipt'] = $invoice_noreceipt;
array_push($data, $tmp); array_push($data, $tmp);
} }
......
...@@ -176,12 +176,12 @@ public function getList(array $param) ...@@ -176,12 +176,12 @@ public function getList(array $param)
$tmp['covenant_type'] = $item->ctype ? ModelsCovenant::CTYPE[$item->ctype] : ''; $tmp['covenant_type'] = $item->ctype ? ModelsCovenant::CTYPE[$item->ctype] : '';
$tmp['principal'] = $item->principal; $tmp['principal'] = $item->principal;
$tmp['invoice_amount'] = $item->invoiced_money; $tmp['invoice_amount'] = number_format($item->invoiced_money, 2);
$tmp['receipt_money'] = $item->received_amount; $tmp['receipt_money'] = number_format($item->received_amount, 2);
$receipt_noinvoice = $item->received_amount - $item->invoiced_money; $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; $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); array_push($data, $tmp);
} }
......
...@@ -169,17 +169,27 @@ public function getList(array $param) ...@@ -169,17 +169,27 @@ public function getList(array $param)
$tmp['lnumber'] = $item->lnumber; $tmp['lnumber'] = $item->lnumber;
$tmp['lname'] = $item->lname; $tmp['lname'] = $item->lname;
$tmp['commission_ratio'] = $item->commission_rate; $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['commission_amount'] = self::getCommissionAmount($receipt_money, $item->commission_rate);
$tmp['receipt_noinvoice'] = $receipt_noinvoice; $tmp['receipt_noinvoice'] = number_format($receipt_noinvoice, 2);
$tmp['invoice_noreceipt'] = $invoice_noreceipt; $tmp['invoice_noreceipt'] = number_format($invoice_noreceipt, 2);
$tmp['cost'] = ModelsLawyerCost::getTotalCost($item->lawyer_id, $year); $cost = ModelsLawyerCost::getTotalCost($item->lawyer_id, $year);
$tmp['basic_salary'] = ModelsLawyerCost::getBasiSalary($item->lawyer_id, $year); $tmp['cost'] = number_format($cost, 2);
$tmp['special_additional'] = ModelsLawyerCost::getSpecialAdditional($item->lawyer_id, $year); $basic_salary = ModelsLawyerCost::getBasiSalary($item->lawyer_id, $year);
$tmp['social'] = ModelsLawyerCost::getSocial($item->lawyer_id, $year); $tmp['basic_salary'] = number_format($basic_salary, 2);
$tmp['accumulation_fund'] = ModelsLawyerCost::getAccumulationFund($item->lawyer_id, $year);
$tmp['posting_tickets_fee'] = $tickets_money; $special_additional = ModelsLawyerCost::getSpecialAdditional($item->lawyer_id, $year);
$tmp['advance_fee'] = ModelsLawyerCost::getAdvanceFee($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); $tmp['payable_commission'] = self::getPayableAmount($item->lawyer_id, $year, $item->commission_rate, $receipt_money);
array_push($data, $tmp); array_push($data, $tmp);
} }
...@@ -194,12 +204,12 @@ public static function getPayableAmount($lawyer_id, $year, $commission_rate, $re ...@@ -194,12 +204,12 @@ public static function getPayableAmount($lawyer_id, $year, $commission_rate, $re
{ {
$paid_amount = ModelsLawyerCost::getPaidAmount($lawyer_id, $year); //已支付款项 $paid_amount = ModelsLawyerCost::getPaidAmount($lawyer_id, $year); //已支付款项
$result = $receipt_money * ($commission_rate / 100) - $paid_amount; $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) public static function getCommissionAmount($receipt_money, $commission_rate)
{ {
$result = $receipt_money * ($commission_rate / 100); $result = $receipt_money * ($commission_rate / 100);
return sprintf('%.2f', $result); return number_format($result, 2);
} }
} }
...@@ -183,6 +183,52 @@ public function get(Grid\Model $model) ...@@ -183,6 +183,52 @@ public function get(Grid\Model $model)
$data[$key] = $tmp; $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; return $data;
} }
} }
...@@ -209,6 +209,48 @@ public function get(Grid\Model $model) ...@@ -209,6 +209,48 @@ public function get(Grid\Model $model)
} }
} }
array_push($data, $heji); 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; return $data;
// $data = [ // $data = [
// ['id' => 1, 'year' => '2016', 'jzsqNum' => '100', 'jzhpNum' => '100', 'sbTotal' => '100'], // ['id' => 1, 'year' => '2016', 'jzsqNum' => '100', 'jzhpNum' => '100', 'sbTotal' => '100'],
......
...@@ -45,7 +45,7 @@ public function getList(array $param) ...@@ -45,7 +45,7 @@ public function getList(array $param)
$data = []; $data = [];
for ($i = 1; $i <= $monthNum; $i++) { for ($i = 1; $i <= $monthNum; $i++) {
$received_amount = ModelsCovenantReceivePayment::where(['rtype' => 2, 'lawyer_id' => $lawyer_id, 'year' => $year, 'month' => $i])->sum('invoiced_money'); $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]; return [$data];
......
...@@ -45,7 +45,7 @@ public function getList(array $param) ...@@ -45,7 +45,7 @@ public function getList(array $param)
$data = []; $data = [];
for ($i = 1; $i <= $monthNum; $i++) { for ($i = 1; $i <= $monthNum; $i++) {
$received_amount = ModelsCovenantReceivePayment::where(['rtype' => 1, 'lawyer_id' => $lawyer_id, 'year' => $year, 'month' => $i])->sum('received_amount'); $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]; return [$data];
......
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