Merge branch 'atie' into 'main'

update table pembayaran pemenang

See merge request online-sistem1/lelong!401
This commit is contained in:
Nur Izzati Zulkifli
2023-03-02 08:17:22 +00:00
2 changed files with 95 additions and 2 deletions
+16 -1
View File
@@ -110,13 +110,28 @@ class PaymentController extends Controller
$listwinner[$index1]['totalBid'] = $SAGWin->sum('hargabida');
$listwinner[$index1]['totalPay'] = $total_payment;
$listwinner[$index1]['sts_payment'] = $sts_payment[0]['status_payment'];
$listwinner[$index1]['jenisbayaran'] = $payment;
}
$sum = 0;
$kaedah = Payment::where('kodcaw',$user->kodcaw)
->where('status', '=', 2)
->where('lelong_id', $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');
$datacaw = Cawangan::where('caw_code','=', $user->kodcaw)
->get();
return view('pembayaran.kaunterpembayaran',compact('datacaw','listwinner','lelong_id'));
return view('pembayaran.kaunterpembayaran',compact('bilcdm','bilfpx','biltunai','datacaw','listwinner','lelong_id','kaedah_cdm','kaedah_fpx','kaedah_tunai'));
}
@@ -38,6 +38,7 @@
<th>Penyata Pemenang</th>
<th class="text-center">Lakukan Bayaran Tunai</th>
<th>Status Bayaran</th>
<th>Kaedah Bayaran</th>
<th>Maklumat Bayaran</th>
<th>Slip Serahan Marhun</th>
{{-- <th>Resit Pembayaran</th> --}}
@@ -71,6 +72,22 @@
<button class="btn btn-danger" disabled>BELUM BAYAR</button>
@endif
</td>
<td>
@if($winner['jenisbayaran'] != NULL)
{{-- {{ dump($winner['jenisbayaran'])}} --}}
@if($winner['jenisbayaran']['status_payment_opt'] == 1)
<span class="badge badge-pill badge-dark">TUNAI</span>
@elseif($winner['jenisbayaran']['status_payment_opt'] == 2)
<span class="badge badge-pill badge-primary">FPX</span>
@elseif($winner['jenisbayaran']['status_payment_opt'] == 3)
<span class="badge badge-pill badge-secondary">CDM</span>
@endif
@else
-
@endif
</td>
<td>
@if($winner['sts_payment'] == 1)
<a href="{{ route('report.detailsbayaran', [ $lelong_id, 'user_id'=>$winner['details']['id'], $datacaw[0]->caw_code ]) }}" class="btn btn-warning" data-toggle="tooltip" data-placement="top" title="Butiran Bayaran"><i class="far fa-list-alt"></i></a>
@@ -93,7 +110,7 @@
<td colspan="4"><b>JUMLAH KESELURUHAN</b></td>
<td align='center'><b><b>{{$totalsurat}}</b></td>
<td align='center'><b>{{ number_format($totalbid, 2, '.', ',') }}</b></td>
<td colspan="5"></td>
<td colspan="6"></td>
</tr>
</tfoot>
</table>
@@ -101,6 +118,67 @@
</div>
</div>
{{-- //table cdm/ppx/tunai --}}
<div class="container-fluid">
<div class="row ">
<div class="col-4 mx-auto p-4">
<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 Bidaan</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>
$(function() {
$('[data-toggle="tooltip"]').tooltip()