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 @@
| No | +Kaedah Bayaran | +Bilangan SAG | +Jumlah 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, '.', ',') }} | + {{----}} + | |||||