add table kaedah bayaran dalam oeprasi dan acc

This commit is contained in:
Nur Izzati Zulkifli
2023-03-14 12:04:59 +08:00
parent cb37884e77
commit d06192955e
2 changed files with 74 additions and 3 deletions
+15 -2
View File
@@ -316,13 +316,26 @@ class PembidaController extends Controller
$listwinner[$index1]['jenisbayaran']['kaedah_bayaran'] = ($detailspayment) ? $detailspayment['status_payment_opt'] : 0;
}
$sum = 0;
$kaedah = Payment::where('kodcaw',$request->kodcaw)
->where('status', '=', 2)
->where('lelong_id', $request->lelong_id)
->select('payment.status_payment_opt', 'payment.total_payment')
// ->groupBy('payment.status_payment_opt')
->get();
$kaedah_cdm = $kaedah->where('status_payment_opt', 3)->sum('total_payment');
$kaedah_fpx = $kaedah->where('status_payment_opt', 2)->sum('total_payment');
$kaedah_tunai = $kaedah->where('status_payment_opt', 1)->sum('total_payment');
$bilcdm = $kaedah->where('status_payment_opt', 3)->count('norujukan');
$bilfpx = $kaedah->where('status_payment_opt', 2)->count('norujukan');
$biltunai = $kaedah->where('status_payment_opt', 1)->count('norujukan');
$kodcaw = $request->kodcaw;
$lelong_id = $request->lelong_id;
$payment_id = $request->payment_id;
// dd($kodcaw);
return view('pembida.pembayaranbidaan',compact('listwinner','lelong_id', 'getkodcaw', 'kodcaw'));
return view('pembida.pembayaranbidaan',compact('bilcdm','bilfpx','biltunai','kaedah_cdm','kaedah_fpx','kaedah_tunai','listwinner','lelong_id', 'getkodcaw', 'kodcaw'));
}
@@ -102,7 +102,65 @@
</div>
</div>
{{-- //table cdm/ppx/tunai --}}
<div class="container-fluid">
<div class="row ">
<div class="col-6 mx-auto p-6">
<div class="card">
<div class="card-header header-style">
<div class="header-style-title">
Jumlah Kaedah Bayaran
</div>
</div>
<div class="card-body">
<table class="table text-center table-bordered" id="tablekaunter" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>Kaedah Bayaran</th>
<th>Bilangan SAG</th>
<th>Jumlah Bayaran (RM)</th>
</tr>
</thead>
<tbody>
@php $totalsurat = 0;
$totalbid = 0;
$totalpay = 0;
@endphp
<tr>
<td> 1 </td>
<td style='white-space:nowrap;' align='left'><span class="badge badge-pill badge-dark">TUNAI</span></td>
<td align='center'>{{$biltunai}}</td>
<td align='right'>{{ number_format($kaedah_tunai, 2, '.', ',') }}</td>
</tr>
<tr>
<td> 2 </td>
<td style='white-space:nowrap;' align='left'><span class="badge badge-pill badge-primary">FPX</span></td>
<td align='center'>{{$bilfpx}}</td>
<td align='right'>{{ number_format($kaedah_fpx, 2, '.', ',') }}</td>
</tr>
<tr>
<td> 3 </td>
<td style='white-space:nowrap;' align='left'><span class="badge badge-pill badge-secondary">CDM</span></td>
<td align='center'>{{$bilcdm}}</td>
<td align='right'>{{ number_format($kaedah_cdm, 2, '.', ',') }}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2"><b>JUMLAH KESELURUHAN</b></td>
<td align='center'><b><b>{{$biltunai+$bilfpx+$bilcdm}}</b></td>
<td align='right'><b>{{ number_format($kaedah_tunai+$kaedah_fpx+$kaedah_cdm, 2, '.', ',') }}</b></td>
{{-- <td colspan="5"></td> --}}
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<script>
//Enable tooltips everywhere
$(function () {