diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index a9e08c85..b55746f2 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -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')); } diff --git a/resources/views/pembayaran/kaunterpembayaran.blade.php b/resources/views/pembayaran/kaunterpembayaran.blade.php index 6f2b7efc..144bf41f 100644 --- a/resources/views/pembayaran/kaunterpembayaran.blade.php +++ b/resources/views/pembayaran/kaunterpembayaran.blade.php @@ -38,6 +38,7 @@ Penyata Pemenang Lakukan Bayaran Tunai Status Bayaran + Kaedah Bayaran Maklumat Bayaran Slip Serahan Marhun {{-- Resit Pembayaran --}} @@ -71,6 +72,22 @@ @endif + + @if($winner['jenisbayaran'] != NULL) + {{-- {{ dump($winner['jenisbayaran'])}} --}} + @if($winner['jenisbayaran']['status_payment_opt'] == 1) + TUNAI + @elseif($winner['jenisbayaran']['status_payment_opt'] == 2) + FPX + @elseif($winner['jenisbayaran']['status_payment_opt'] == 3) + CDM + + @endif + @else + - + @endif + + @if($winner['sts_payment'] == 1) @@ -93,7 +110,7 @@ JUMLAH KESELURUHAN {{$totalsurat}} {{ number_format($totalbid, 2, '.', ',') }} - + @@ -101,6 +118,67 @@ + + {{-- //table cdm/ppx/tunai --}} +
+
+
+
+
+ +
+ Jumlah Kaedah Bayaran +
+
+
+ + + + + + + + + + + + @php $totalsurat = 0; + $totalbid = 0; + $totalpay = 0; + @endphp + + + + + + + + + + + + + + + + + + + + + + + + + + {{-- --}} + + +
NoKaedah BayaranBilangan SAGJumlah Bidaan
1 TUNAI{{$biltunai}}{{ number_format($kaedah_tunai, 2, '.', ',') }}
2 FPX{{$bilfpx}}{{ number_format($kaedah_fpx, 2, '.', ',') }}
3 CDM{{$bilcdm}}{{ number_format($kaedah_cdm, 2, '.', ',') }}
JUMLAH KESELURUHAN{{$biltunai+$bilfpx+$bilcdm}}{{ number_format($kaedah_tunai+$kaedah_fpx+$kaedah_cdm, 2, '.', ',') }}
+
+
+
+