update design table dan customize semakan marhun
This commit is contained in:
@@ -856,7 +856,11 @@ class LelongController extends Controller
|
||||
$total_untung_asal = TransaksiKeuntungan::where('norujukan','=',$bid['norujukan'])->sum('bayaran_keuntungan');
|
||||
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
|
||||
$detail_sag = Gadai::on($bid->kodcaw)->where('norujukan',$bid->norujukan)->first();
|
||||
$keuntungan = bcdiv(($detail_sag['tempoh']-$detail_sag['tempohbayar'])*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
|
||||
if($detail_sag['tempohbayar'] == $detail_sag['tempoh'] ){
|
||||
$keuntungan = 0.00;
|
||||
}else{
|
||||
$keuntungan = bcdiv(($detail_sag['tempoh']-$detail_sag['tempohbayar'])*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
|
||||
}
|
||||
|
||||
$sumhargaasas = 0;
|
||||
$sumnmarhuns = 0;
|
||||
|
||||
@@ -59,10 +59,9 @@ class MarhunController extends Controller
|
||||
|
||||
$caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first();
|
||||
|
||||
$lelongbid = LelongBid::where('lelong_id', '=', $lelong_id) //keseluruhan
|
||||
->where('caw_id', '=', $caw->id)
|
||||
->get();
|
||||
// dd($lelongbid->toArray());
|
||||
|
||||
|
||||
// dd($lelongbid);
|
||||
|
||||
$sag = LelongBid::where('lelong_id', $lelong_id) //belum disemak
|
||||
->where('caw_id', $caw->id)
|
||||
@@ -127,15 +126,20 @@ class MarhunController extends Controller
|
||||
->distinct()
|
||||
->get();
|
||||
|
||||
$lelongbid = LelongBid::where('lelong_id', '=', $lelong_id) //keseluruhan
|
||||
->where('caw_id', '=', $caw->id)
|
||||
->get();
|
||||
foreach ($lelongbid as $index1 => $bid) {
|
||||
$sudahdisahkan = Pengesahan::where('lelongbid_id', $bid['id'])
|
||||
->where('lelong_id', $lelong_id)
|
||||
->get();
|
||||
|
||||
|
||||
$statusdrpdpc = Pengesahan::where('lelongbid_id', $bid['id'])
|
||||
->where('lelong_id', $lelong_id)
|
||||
->where('status_ubah', 6)
|
||||
->first();
|
||||
|
||||
// $status = Pengesahan::where('lelongbid_id', $bid['id'])
|
||||
// ->where('lelong_id', $lelong_id)
|
||||
// ->first();
|
||||
|
||||
$statusSemakMarhun = ScanSemak::where('lelongbid_id', $bid['id'])
|
||||
->whereNotNull('scan_keluar')
|
||||
@@ -147,32 +151,47 @@ class MarhunController extends Controller
|
||||
}
|
||||
|
||||
$lelongbid[$index1]['statustangguhlel'] = $statusdrpdpc;
|
||||
// $lelongbid[$index1]['status'] = $status;
|
||||
|
||||
if ($sudahdisahkan) {
|
||||
$sudahdisahkan = Pengesahan::where('lelongbid_id', $bid['id'])
|
||||
->where('lelong_id', $lelong_id)
|
||||
->get();
|
||||
// dump($sudahdisahkan);
|
||||
// if ($sudahdisahkan) {
|
||||
foreach ($sudahdisahkan as $sahkan) {
|
||||
// dd($sahkan);
|
||||
$lelongbidmarhun = LelongBidMarhun::join('pengesahan', 'lelongbidmarhun.id', '=', 'pengesahan.lelongbidmarhun_id')
|
||||
$status = LelongBidMarhun::join('pengesahan', 'lelongbidmarhun.id', '=', 'pengesahan.lelongbidmarhun_id')
|
||||
->where('lelongbidmarhun.id', $sahkan['lelongbidmarhun_id'])
|
||||
->where('pengesahan.status', '0')
|
||||
->select('pengesahan.disahkan_oleh',
|
||||
'pengesahan.disahkan_pada'
|
||||
'pengesahan.disahkan_pada',
|
||||
'pengesahan.status'
|
||||
)
|
||||
->first();
|
||||
|
||||
$lelongbid[$index1]['pengesahan'] = $lelongbidmarhun;
|
||||
$lelongbid[$index1]['status'] = $status;
|
||||
// $lelongbid[$index1]['pengesahanbysag'] = $sudahdisahkan;
|
||||
// dd($lelongbid[$index1]['pengesahan']);
|
||||
}
|
||||
} else {
|
||||
//
|
||||
}
|
||||
// } else {
|
||||
|
||||
// }
|
||||
|
||||
|
||||
$marhun = LelongBidMarhun::where('lelongbid_id', '=', $bid['id'])
|
||||
->get()
|
||||
->toArray();
|
||||
$lelongbid[$index1]['marhun'] = $marhun;
|
||||
}
|
||||
|
||||
return view('marhun.senaraimarhun', compact('lelongbid', 'lelong_id', 'caw', 'sag', 'dalamproses', 'sdhdisemak', 'sdhdisahkan', 'sdhdisemaktangguhlel', 'dalamprosestangguhlel', 'sdhdisahkantangguhlel'));
|
||||
|
||||
// dd($status);
|
||||
|
||||
|
||||
// $index->status = $status;
|
||||
}
|
||||
// dd($sudahdisahkan);
|
||||
|
||||
return view('marhun.senaraimarhun', compact('sudahdisahkan','lelongbid', 'lelong_id', 'caw', 'sag', 'dalamproses', 'sdhdisemak', 'sdhdisahkan', 'sdhdisemaktangguhlel', 'dalamprosestangguhlel', 'sdhdisahkantangguhlel'));
|
||||
}
|
||||
|
||||
public function kemaskini(Request $request)
|
||||
|
||||
@@ -1133,7 +1133,12 @@ class SimulasiController extends Controller
|
||||
$total_untung_asal = TransaksiKeuntungan::where('norujukan','=',$bid['norujukan'])->sum('bayaran_keuntungan');
|
||||
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
|
||||
$detail_sag = Gadai::on($bid->kodcaw)->where('norujukan',$bid->norujukan)->first();
|
||||
$keuntungan = bcdiv(($detail_sag['tempoh']-$detail_sag['tempohbayar'])*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
|
||||
// $keuntungan = bcdiv(($detail_sag['tempoh']-$detail_sag['tempohbayar'])*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
|
||||
if($detail_sag['tempohbayar'] == $detail_sag['tempoh'] ){
|
||||
$keuntungan = 0.00;
|
||||
}else{
|
||||
$keuntungan = bcdiv(($detail_sag['tempoh']-$detail_sag['tempohbayar'])*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
|
||||
}
|
||||
|
||||
$sumhargaasas = 0;
|
||||
$simulasibidmarhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid['id'])->get();
|
||||
@@ -1167,13 +1172,13 @@ class SimulasiController extends Controller
|
||||
$simulasi = Simulasi::where('id',$request->idsimulasi)->get();
|
||||
$sumcajlelong = $sumhargaasas * ($simulasi[0]['cajlelong']/100);
|
||||
$sumcajlel = round($sumcajlelong,1,1);
|
||||
$keuntungannew = bcdiv($keuntungan,1,1);
|
||||
// $keuntungannew = bcdiv($keuntungan,1,1);
|
||||
|
||||
$totalbaki = $sumhargaasas - $detail_sag->bakipjm - $keuntungannew - $sumcajlel;
|
||||
$totalbaki = $sumhargaasas - $detail_sag->bakipjm - $keuntungan - $sumcajlel;
|
||||
// dump($sumhargaasas);
|
||||
$kirakeuntungan = SimulasiBid::where('norujukan',$bid['norujukan'])
|
||||
->update([
|
||||
'bakiupah'=> $keuntungannew,
|
||||
'bakiupah'=> $keuntungan,
|
||||
'hargaasas'=> $sumhargaasas,
|
||||
'cajlelong'=> $sumcajlel,
|
||||
'baki'=> $totalbaki,
|
||||
@@ -1186,7 +1191,7 @@ class SimulasiController extends Controller
|
||||
$loguser->username = $user->username;
|
||||
$loguser->nama_user = $user->name;
|
||||
$loguser->norujukan = $bid['norujukan'];
|
||||
$loguser->nota = ' Kemaskini Harga Asas/Keuntungan '.$keuntungannew;
|
||||
$loguser->nota = ' Kemaskini Harga Asas/Keuntungan '.$keuntungan;
|
||||
$loguser->save();
|
||||
|
||||
}
|
||||
|
||||
@@ -43,10 +43,6 @@ class TangguhLelongController extends Controller
|
||||
foreach($lelong as $info)
|
||||
{
|
||||
|
||||
// $detailsinfo = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
// ->where('lelong_id',$info['lelong_id'])
|
||||
|
||||
|
||||
$detailsinfo = CawanganLelong::select('cawangan_lelong.caw_id','caw_name','lelongbid.status_jual','caw_code')
|
||||
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->join('lelongbid','lelongbid.kodcaw','=','cawangan.caw_code')
|
||||
|
||||
Reference in New Issue
Block a user