Commit 0fd866fa by lizhilin

更新

parent 775f3c44
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
use App\Admin\Actions\CovenantReturn; use App\Admin\Actions\CovenantReturn;
use Dcat\Admin\Admin; use Dcat\Admin\Admin;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use App\Models\CovenantReceivePayment as ModelCovenantReceivePayment;
class CovenantController extends AdminController class CovenantController extends AdminController
{ {
...@@ -162,4 +163,16 @@ function (Form $form, $result) { ...@@ -162,4 +163,16 @@ function (Form $form, $result) {
); );
return $form; return $form;
} }
public function destroy($id)
{
$res = $this->form()->destroy($id);
if ($res) {
//收款开票信息
ModelCovenantReceivePayment::where('cid', $id)->delete();
}
return $res;
}
} }
...@@ -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 = $totalInfo['cost']; $costTotal = sprintf('%.2f', $totalInfo['cost']);
//基本工资 //基本工资
$basicSalary = $totalInfo['salary']; $basicSalary = sprintf('%.2f', $totalInfo['salary']);
//专项附加 //专项附加
$special_additional = $totalInfo['special_additional']; $special_additional = sprintf('%.2f', $totalInfo['special_additional']);
//社保 //社保
$social = $totalInfo['social']; $social = sprintf('%.2f', $totalInfo['social']);
//公积金 //公积金
$accumulation_fund = $totalInfo['accumulation_fund']; $accumulation_fund = sprintf('%.2f', $totalInfo['accumulation_fund']);
//贴票金额 //贴票金额
$posting_tickets = $totalInfo['tickets_money']; $posting_tickets = sprintf('%.2f', $totalInfo['tickets_money']);
//预支款 //预支款
$advance_fee = $totalInfo['advance_fee']; $advance_fee = sprintf('%.2f', $totalInfo['advance_fee']);
//可结算提成 //可结算提成
$payable_amount = $totalInfo['payable_commission']; $payable_amount = sprintf('%.2f', $totalInfo['payable_commission']);
// 添加一行表头数据 // 添加一行表头数据
$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 ">
...@@ -79,10 +79,10 @@ protected function grid() ...@@ -79,10 +79,10 @@ protected function grid()
<th width="90">&nbsp;&nbsp;&nbsp;</th> <th width="90">&nbsp;&nbsp;&nbsp;</th>
<th width="100" style="text-align:center;">合计</th> <th width="100" style="text-align:center;">合计</th>
<th width="90">&nbsp;&nbsp;</th> <th width="90">&nbsp;&nbsp;</th>
<th width="100" style="text-align:center;">' . $received_amount . '</th> <th width="100" style="text-align:center;">' . sprintf('%.2f', $received_amount) . '</th>
<th width="80" style="text-align:center;">' . $commissionAmount . '</th> <th width="80" style="text-align:center;">' . sprintf('%.2f', $commissionAmount) . '</th>
<th width="90" style="text-align:center;">' . $received_noinvoiced . '</th> <th width="90" style="text-align:center;">' . sprintf('%.2f', $received_noinvoiced) . '</th>
<th width="90" style="text-align:center;">' . $invoiced_noreceived . '</th> <th width="90" style="text-align:center;">' . sprintf('%.2f', $invoiced_noreceived) . '</th>
<th width="90" style="text-align:center;">' . $costTotal . '</th> <th width="90" style="text-align:center;">' . $costTotal . '</th>
<th width="90" style="text-align:center;">' . $basicSalary . '</th> <th width="90" style="text-align:center;">' . $basicSalary . '</th>
<th width="90" style="text-align:center;">' . $special_additional . '</th> <th width="90" style="text-align:center;">' . $special_additional . '</th>
......
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
use Dcat\Admin\Traits\HasDateTimeFormatter; use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Principal extends Model class Principal extends Model
{ {
use HasDateTimeFormatter; use HasDateTimeFormatter;
use SoftDeletes;
protected $table = 'principal'; protected $table = 'principal';
} }
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