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'));
}