update pindah lelong dan keuntungan fasa 2

This commit is contained in:
Nur Izzati Zulkifli
2022-12-03 23:27:25 +08:00
parent 92b7062b6a
commit 24373dc67e
8 changed files with 378 additions and 167 deletions
+158 -50
View File
@@ -861,7 +861,14 @@ class LelongController extends Controller
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;
// $keuntungan = bcdiv(($detail_sag['tempoh']-$detail_sag['tempohbayar'])*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $detail_sag['tempoh']-$detail_sag['tempohbayar'];
$jbg2 = 12- $detail_sag['tempohbayar'];
if($detail_sag['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
}
}
$sumhargaasas = 0;
@@ -1315,6 +1322,7 @@ class LelongController extends Controller
$marhuns = LelongBid::where('caw_id', '=', $cawid)
->where('lelong_id', '=', $lelongid)
->orderBy('norujukan', 'ASC')
->get();
// dd($marhuns);
$arraymarhun = [];
@@ -2179,20 +2187,27 @@ class LelongController extends Controller
$cawid = $caw['caw_id'];
$marhun = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id')
->where('lelong_id','=',$lelong_id)
->where('caw_id','=',$caw['caw_id']);
->where('caw_id','=',$caw['caw_id'])
->select('lelongbid.norujukan','lelongbid.fasa','lelongbid.kodcaw');
$arraynorujukan = $marhun->pluck('norujukan')->toArray();
$datalelong = $marhun->get();
// dd($datalelong[$index]['kodcaw']);
// dd($datalelong[$index]['fasa']);
$kodcaw = $datalelong[$index]['kodcaw'];
$senaraisag = Gadai::on($datalelong[$index]['kodcaw'])->whereIn('norujukan', $arraynorujukan)
->get();
// dd($senaraisag);
foreach($senaraisag as $data)
{
// dd($data['norujukan']);
// dd($datalelong[$index]['fasa']);
if($datalelong[$index]['fasa'] == 1){
$marhunitemfasa = LelongBid::where('lelong_id','=',$lelong_id)
->where('kodcaw','=',$kodcaw)
->where('norujukan','=',$data['norujukan'])
->select('lelongbid.norujukan','lelongbid.fasa')
->first();
// dd($marhunitemfasa->fasa);
if($marhunitemfasa->fasa == 1){
//insert lelong_tebus
if($data['sttebus'] == "T")
{
@@ -2259,7 +2274,14 @@ class LelongController extends Controller
$total_untung_rebet = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('keuntungan_rebet');
$total_untung_asal = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('bayaran_keuntungan');
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
$keuntungan = bcdiv(($data['tempoh']-$data['tempohbayar'])*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
// $keuntungan = bcdiv(($data['tempoh']-$data['tempohbayar'])*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $data['tempoh']-$data['tempohbayar'];
$jbg2 = 12- $data['tempohbayar'];
if($data['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($keuntungan);
//update dalam simulasibid
$updatetempoh = LelongBid::where('norujukan', $data['norujukan'])
@@ -2284,24 +2306,32 @@ class LelongController extends Controller
$lelong = Lelong::where('id','=',$lelong_id)->first();
$lelong->masakemaskini_data = $date;
$lelong->save();
}
}else if($datalelong[$index]['fasa'] == 2){
// dd($datasimulasi[$index]['fasa']);
if($data['sttebus'] == "T")
{
$lelongtebus = new LelongTebus;
$lelongtebus->tarikh = $currentdate;
$lelongtebus->kodcaw = $data['kodcaw'];
$lelongtebus->teller = $user->name;
$lelongtebus->norujukan = $data['norujukan'];
$lelongtebus->batch_no = $lelong_id;
$lelongtebus->nilaimarhun = $data['nilaimarhun'];
$lelongtebus->pinjaman = $data['pinjaman'];
$lelongtebus->upah = $data['bakiupah'];
$lelongtebus->jbg = $data['jbg'];
$lelongtebus->jenis_tebus = 'T';
$lelongtebus->save();
}
}else if($marhunitemfasa->fasa == 2){
// dd($datasimulasi[$index]['fasa']);
if($data['sttebus'] == "T")
{
$lelongtebus = new LelongTebus;
$lelongtebus->tarikh = $currentdate;
$lelongtebus->kodcaw = $data['kodcaw'];
$lelongtebus->teller = $user->name;
$lelongtebus->norujukan = $data['norujukan'];
$lelongtebus->batch_no = $lelong_id;
$lelongtebus->nilaimarhun = $data['nilaimarhun'];
$lelongtebus->pinjaman = $data['pinjaman'];
$lelongtebus->upah = $data['bakiupah'];
$lelongtebus->jbg = $data['jbg'];
$lelongtebus->jenis_tebus = 'T';
$lelongtebus->save();
$updategadai = Http::withOptions(['verify' => config('app.api_verify')])
->post(config('app.api_url').'taglel/revert',[
'kodcaw'=>$data['kodcaw'],
'norujukan'=>$data['norujukan']
])
->json();
// dd($data['norujukan']);
$updatelelong = LelongBid::where('norujukan','=',$data['norujukan'])->first();
$updatelelong->delete();
@@ -2315,18 +2345,54 @@ class LelongController extends Controller
$loguser->nota = ' LELONG TEBUS '.$lelong_id;
$loguser->save();
}
else{
//kemaskini keuntungan
$total_untung_rebet = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('keuntungan_rebet');
$total_untung_asal = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('bayaran_keuntungan');
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
// $keuntungan = bcdiv(($data['tempoh']-$data['tempohbayar'])*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $data['tempoh']-$data['tempohbayar'];
$jbg2 = 12- $data['tempohbayar'];
if($data['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($keuntungan);
//update dalam simulasibid
$updatetempoh = LelongBid::where('norujukan', $data['norujukan'])
->where('lelong_id', $lelong_id)
->first();
$updatetempoh->jbg = $data['tempoh'];
$updatetempoh->pinjaman = $data['bakipjm'];
$updatetempoh->bakiupah = bcdiv($keuntungan,1,1);
$updatetempoh->update();
//insert loguser
$loguser = new LogUser;
$loguser->user_id = $user->id;
$loguser->date = $currentdate;
$loguser->username = $user->username;
$loguser->nama_user = $user->name;
$loguser->norujukan = $data['norujukan'];
$loguser->nota = $lelong_id.' Kemaskini Tempoh/Bakipjm/Keuntungan' ;
$loguser->save();
}
$date = Carbon::now()->toDateTimeString();
$lelong = Lelong::where('id','=',$lelong_id)->first();
$lelong->masakemaskini_data = $date;
$lelong->save();
}
}
}
}
// dd($datalelong[$index]['fasa']);
return redirect()->route('lelong.senarailelong')
->with('success','Kemaskini Berjaya');
}
@@ -2338,7 +2404,7 @@ class LelongController extends Controller
$lelong = CawanganLelong::join('lelong', 'cawangan_lelong.lelong_id', '=', 'lelong.id')
->select('lelong_id','tarikh_lelong','lelong.fasa','lelong.masatamat_lelong','harga_emas_asas','jbg','cajlelong','sts_lelong')
->groupBy('lelong_id')
// ->where('lelong.sts_lelong', 3)
->where('lelong.sts_lelong', 0)
->get()->toArray();
foreach($lelong as $laporan)
@@ -2413,10 +2479,15 @@ class LelongController extends Controller
$data = Lelong::where('lelong.id','=',$lelong_id)
->get();
}
$datapindah = lelong::select("id","tarikh_lelong")
->where('sts_lelong', 0)
->where('id','!=', $lelong_id)
->where('kali','=', $kali)
// dd($cawangan['caw_code']);
$datapindah = lelong::join('cawangan_lelong','cawangan_lelong.lelong_id','=','lelong.id')
->join('cawangan','cawangan.id','=','cawangan_lelong.caw_id')
->select("lelong.id","lelong.tarikh_lelong")
->where('cawangan_lelong.caw_id','!=', $cawangan['id'])
->where('lelong.sts_lelong', 0)
->where('cawangan_lelong.lelong_id','!=', $lelong_id)
->where('lelong.id','!=', $lelong_id)
->where('lelong.kali','=', $kali)
->get()->toArray();
foreach($datapindah as $row)
{
@@ -2724,12 +2795,13 @@ class LelongController extends Controller
// $keuntungan = $cal['bakipjm'] - ($cal['bakihargajualan'] - ($cal['upah12'] - $cal['ansakhir'])-(($cal['tempoh']-$cal['tempohbayar'])*$cal['kadarupah']/100*$cal['bakipjm']) );
// $marhuns[$index1]['keuntungan'] = bcdiv($keuntungan,1,1);
// $simulasilel = Lelong::where('id',$lelongid)->get();
// $sumcajlelong = $cal['hargaasas'] * ($simulasilel[0]['cajlelong']/100);
// $totalbaki = $cal['hargaasas'] - $cal['pinjaman'] - bcdiv($keuntungan,1,1) - bcdiv($sumcajlelong,1,1);
$simulasilel = Lelong::where('id',$lelongid)->get();
$sumcajlelong = $cal['hargaasas'] * ($simulasilel[0]['cajlelong']/100);
$cajlelongnew = bcdiv($sumcajlelong,1,1);
$totalbaki = $cal['hargaasas'] - $cal['pinjaman'] - $cal['bakiupah'] - $cajlelongnew;
// $marhuns[$index1]['cajlelong'] = bcdiv($sumcajlelong,1,1);
// $marhuns[$index1]['baki'] = $totalbaki;
$marhuns[$index1]['cajlelong'] = $cajlelongnew;
$marhuns[$index1]['baki'] = $totalbaki;
}
$arrayinfo = [];
@@ -2785,19 +2857,48 @@ class LelongController extends Controller
$pindahlelongsag->lelong_id = $lelongidbaru;
$pindahlelongsag->update();
//insert loguser
$loguser = new LogUser;
$loguser->user_id = $user->id;
$loguser->date = $currentdate;
$loguser->username = $user->username;
$loguser->nama_user = $user->name;
$loguser->norujukan = $norujukan;
$loguser->nota = 'Pindah Lelong '.$lelongidasal.'-'.$lelongidbaru;
$loguser->save();
$checksag = LelongBid::where('lelong_id',$request->lelongid)
->first();
// dd($checksag);
if($checksag)
{
//insert loguser
$loguser = new LogUser;
$loguser->user_id = $user->id;
$loguser->date = $currentdate;
$loguser->username = $user->username;
$loguser->nama_user = $user->name;
$loguser->norujukan = $norujukan;
$loguser->nota = 'Pindah Lelong '.$lelongidasal.'-'.$lelongidbaru;
$loguser->save();
}
else{
$lelongbatch = Lelong::where('id','=',$lelongidasal)->first();
$lelongbatch->delete();
$loguser = new LogUser;
$loguser->user_id = $user->id;
$loguser->date = $currentdate;
$loguser->username = $user->username;
$loguser->nama_user = $user->name;
$loguser->norujukan = $norujukan;
$loguser->nota = 'Pindah Lelong '.$lelongidasal.'-'.$lelongidbaru;
$loguser->save();
}
}
if($checksag){
return redirect()->route('lelong.listsagpindah',['lelongid'=>$request->lelongid,'cawid'=>$request->cawid])
->with('success','Pindah ID Lelong Berjaya');
}else{
return redirect()->route('lelong.pindahsenarailelong')
->with('success','Pindah ID Lelong Berjaya');
}
}
public function temprenewlelongxlaku(Request $request)
@@ -3099,7 +3200,14 @@ class LelongController extends Controller
$total_untung_rebet = TransaksiKeuntungan::on('main')->where('norujukan','=',$listing['norujukan'])->sum('keuntungan_rebet');
$total_untung_asal = TransaksiKeuntungan::on('main')->where('norujukan','=',$listing['norujukan'])->sum('bayaran_keuntungan');
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
$keuntungan = bcdiv(($listing['tempoh']-$listing['tempohbayar'])*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
// $keuntungan = bcdiv(($listing['tempoh']-$listing['tempohbayar'])*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $listing['tempoh']-$listing['tempohbayar'];
$jbg2 = 12- $listing['tempohbayar'];
if($listing['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($keuntungan);
$listsag[$index]['ktlhbyr'] = $ktlhbyr;
$listsag[$index]['keuntungan'] = $keuntungan;
+82 -9
View File
@@ -1137,8 +1137,15 @@ class SimulasiController extends Controller
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;
}
// $keuntungan = bcdiv(($detail_sag['tempoh']-$detail_sag['tempohbayar'])*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $detail_sag['tempoh']-$detail_sag['tempohbayar'];
$jbg2 = 12- $detail_sag['tempohbayar'];
if($detail_sag['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$detail_sag['kadarupah']/100*$detail_sag['bakipjm'],1,1)-$beza_keuntungan;
}
}
$sumhargaasas = 0;
$simulasibidmarhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid['id'])->get();
@@ -1719,8 +1726,14 @@ class SimulasiController extends Controller
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
// dd($beza_keuntungan);
$keuntungan = bcdiv(($surats['tempoh']-$surats['tempohbayar'])*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
// $keuntungan = bcdiv(($surats['tempoh']-$surats['tempohbayar'])*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $surats['tempoh']-$surats['tempohbayar'];
$jbg2 = 12- $surats['tempohbayar'];
if($surats['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($surats['hargajualan']);
$ktlhbyr = $surats['hargajualan']-$surats['bakihargajualan'];
// dd($ktlhbyr);
@@ -1855,7 +1868,14 @@ class SimulasiController extends Controller
$total_untung_rebet = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('keuntungan_rebet');
$total_untung_asal = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('bayaran_keuntungan');
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
$keuntungan = bcdiv(($data['tempoh']-$data['tempohbayar'])*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $data['tempoh']-$data['tempohbayar'];
$jbg2 = 12- $data['tempohbayar'];
if($data['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($keuntungan);
//update dalam simulasibid
$updatetempoh = SimulasiBid::where('norujukan', $data['norujukan'])
@@ -1919,6 +1939,39 @@ class SimulasiController extends Controller
$loguser->nota = ' LELONG TEBUS '.$simulasi_id;
$loguser->save();
}
else{
//kemaskini keuntungan
$total_untung_rebet = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('keuntungan_rebet');
$total_untung_asal = TransaksiKeuntungan::on('main')->where('norujukan','=',$data['norujukan'])->sum('bayaran_keuntungan');
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
$jbg = $data['tempoh']-$data['tempohbayar'];
$jbg2 = 12- $data['tempohbayar'];
if($data['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$data['kadarupah']/100*$data['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($keuntungan);
//update dalam simulasibid
$updatetempoh = SimulasiBid::where('norujukan', $data['norujukan'])
->where('simulasi_id', $simulasi_id)
->first();
$updatetempoh->jbg = $data['tempoh'];
$updatetempoh->pinjaman = $data['bakipjm'];
$updatetempoh->bakiupah = bcdiv($keuntungan,1,1);
$updatetempoh->update();
//insert loguser
$loguser = new LogUser;
$loguser->user_id = $user->id;
$loguser->date = $currentdate;
$loguser->username = $user->username;
$loguser->nama_user = $user->name;
$loguser->norujukan = $data['norujukan'];
$loguser->nota = $simulasi_id.' Kemaskini Tempoh/Bakipjm/Keuntungan' ;
$loguser->save();
}
$date = Carbon::now()->toDateTimeString();
$simulasi = Simulasi::where('id','=',$simulasi_id)->first();
$simulasi->masakemaskini_data = $date;
@@ -1971,8 +2024,16 @@ class SimulasiController extends Controller
$total_untung_rebet = TransaksiKeuntungan::on('main')->where('norujukan','=',$listing['norujukan'])->sum('keuntungan_rebet');
$total_untung_asal = TransaksiKeuntungan::on('main')->where('norujukan','=',$listing['norujukan'])->sum('bayaran_keuntungan');
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
$keuntungan = bcdiv(($listing['tempoh']-$listing['tempohbayar'])*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
// $keuntungan = bcdiv(($listing['tempoh']-$listing['tempohbayar'])*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
// dd($keuntungan);
$jbg = $listing['tempoh']-$listing['tempohbayar'];
$jbg2 = 12- $listing['tempohbayar'];
if($listing['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$listing['kadarupah']/100*$listing['bakipjm'],1,1)-$beza_keuntungan;
}
$listsag[$index]['ktlhbyr'] = $ktlhbyr;
$listsag[$index]['keuntungan'] = $keuntungan;
}
@@ -2370,8 +2431,14 @@ class SimulasiController extends Controller
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
// dd($beza_keuntungan);
$keuntungan = bcdiv(($surats['tempoh']-$surats['tempohbayar'])*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $surats['tempoh']-$surats['tempohbayar'];
$jbg2 = 12- $surats['tempohbayar'];
if($surats['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($surats['hargajualan']);
$ktlhbyr = $surats['hargajualan']-$surats['bakihargajualan'];
// dd($ktlhbyr);
@@ -2470,8 +2537,14 @@ class SimulasiController extends Controller
$beza_keuntungan = $total_untung_asal - $total_untung_rebet;
// dd($beza_keuntungan);
$keuntungan = bcdiv(($surats['tempoh']-$surats['tempohbayar'])*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
// $keuntungan = bcdiv(($surats['tempoh']-$surats['tempohbayar'])*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
$jbg = $surats['tempoh']-$surats['tempohbayar'];
$jbg2 = 12- $surats['tempohbayar'];
if($surats['tempoh'] <= '12.00'){
$keuntungan = bcdiv(($jbg)*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
}else{
$keuntungan = bcdiv(($jbg2)*$surats['kadarupah']/100*$surats['bakipjm'],1,1)-$beza_keuntungan;
}
// dd($surats['hargajualan']);
$ktlhbyr = $surats['hargajualan']-$surats['bakihargajualan'];
// dd($ktlhbyr);
@@ -41,7 +41,7 @@
<th>No.KP</th>
<th>No.Rujukan</th>
<th>Tempoh</th>
<th>Berat(gm)</th>
<th>Berat Asal(gm)</th>
<th>Nilai Marhun Asal(RM)</th>
<th>Pembiayaan Asal(RM)</th>
<th>Baki Pembiayaan(RM)</th>
+48 -20
View File
@@ -10,28 +10,28 @@
<a href="javascript:window.history.go(-1);" class="header-style-icon">
<i class="fas fa-arrow-left"></i>
</a>
@foreach ($arrayinfo as $laporan)
@foreach ($arrayinfo as $laporan)
<div class="header-style-title">
Senarai SAG(Pindah Batch Lelong) : @foreach($laporan['details'] as $details)
<b>{{ $details['caw_name']}}</b>
@endforeach
</div>
</div>
<div class="card-body">
<span class="pt-3" style="margin-left:1%;"><b>Batch Lelong : {{ $laporan['laporan']['lelong_id']}}</b></span><br>
<span class="pt-3" style="margin-left:1%;"><b>Tarikh Lelong : @php
$myDateTime = DateTime::createFromFormat('Y-m-d', $laporan['laporan']['tarikh_lelong'] );
$datez = $myDateTime->format('d-m-Y');
echo($datez);
@endphp</b></span>
@endforeach
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<span class="pt-3" style="margin-left:1%;"><b>Batch Lelong : {{ $laporan['laporan']['lelong_id']}}</b></span><br>
<span class="pt-3" style="margin-left:1%;"><b>Tarikh Lelong : @php
$myDateTime = DateTime::createFromFormat('Y-m-d', $laporan['laporan']['tarikh_lelong'] );
$datez = $myDateTime->format('d-m-Y');
echo($datez);
@endphp</b></span>
@endforeach
<form id="deletesag" action="{{route('lelong.pindahlelongbysag')}}" method="POST">
@csrf
<input type="hidden" name="lelongid" value="{{$lelongid}}">
@@ -47,8 +47,9 @@
<table class="table text-right table-bordered" id="marhun" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" id="checkall"></th>
<th>Pilih</th>
<th>No</th>
{{-- <th>No</th> --}}
<th>No Rujukan</th>
<th>Tempoh</th>
<th>Berat (gm)</th>
@@ -65,8 +66,8 @@
<tbody>
@foreach ($marhuns as $index=> $marhun)
<tr>
<td class="text-center">
<input type="checkbox" aria-label="Checkbox for following text input" onclick="btnDelete(this)" name="checkboxdata[]" value="{{ $marhun['norujukan'] }}">
<td class="text-center">
<input type="checkbox" aria-label="Checkbox for following text input" onclick="btnDelete(this)" name="checkboxdata[]" value="{{ $marhun['norujukan'] }}" class="checkbox">
</td>
<td>{{$loop->iteration}}</td>
<td style="white-space: nowrap;">{{ $marhun['norujukan']}}</td>
@@ -110,7 +111,34 @@
</div>
</div>
</div>
<script type='text/javascript'>
$(document).ready(function(){
// Check or Uncheck All checkboxes
$("#checkall").change(function(){
var checked = $(this).is(':checked');
if(checked){
$(".checkbox").each(function(){
$(this).prop("checked",true);
});
}else{
$(".checkbox").each(function(){
$(this).prop("checked",false);
});
}
});
// Changing state of CheckAll checkbox
$(".checkbox").click(function(){
if($(".checkbox").length == $(".checkbox:checked").length) {
$("#checkall").prop("checked", true);
} else {
$("#checkall").prop("checked", false);
}
});
});
</script>
<script>
$("#btndelete").prop("disabled", true);
function btnDelete(e) {
@@ -21,7 +21,7 @@
<p>{{ $message }}</p>
</div>
@endif
<table class="table text-right table-bordered" id="senarailelongtaklaku" style="width:100%">
<table class="table text-center table-bordered" id="senarailelongtaklaku" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
@@ -70,21 +70,6 @@
<td>{{$data['laporan']['cajlelong']}}</td>
<td class="text-center">
@hasrole('jurulelong')
<a class="btn btn-primary" href="{{ route('lelong.show',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Butiran" style="margin-right:40px" ><i class="far fa-edit"></i></a>
<!-- @if($data['laporan']['sts_lelong'] == 0) -->
<!-- <a href="{{ route('lelong.refresh',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Kemaskini Data" style="margin-right:40px"><i class="fas fa-sync-alt"></i></a> -->
<!-- <a class="startlelong" href="{{ route('lelong.start',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Mula Lelong" style="margin-right:40px"><i class="fa fa-play"></i></a> -->
<!-- <a href="{{ route('lelong.show',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Butiran" style="margin-right:40px" ><i class="far fa-edit"></i></a> -->
<!-- <a class="confirmdel" href="{{ route('lelong.delete',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Padam" ><i class="far fa-trash-alt"></i></a> -->
<!-- @elseif ($data['laporan']['sts_lelong'] == 2) -->
<!-- <a href="{{ route('lelong.janapemenang',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Jana Pemenang"><i class="fas fa-users-cog"></i></a> -->
<!-- @elseif ($data['laporan']['sts_lelong'] == 3) -->
<!-- <a href="{{ route('lelong.senaraipemenang',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Senarai Pemenang"><i class="fas fa-trophy"></i></a> -->
<!-- @else -->
<!-- <a class="stoplelong" href="{{ route('lelong.stop',$data['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Tamat Lelong"><i class="fa fa-stop"></i></a> -->
<!-- @endif -->
@endhasrole
@hasrole('operasi')
@if($data['laporan']['sts_lelong'] == 0)
@@ -133,12 +133,12 @@ tr:nth-child(even) {
<th>No.Rujukan</th>
<th>Tempoh</th>
<th>Berat(gm)</th>
<th>Keuntungan Telah Bayar (RM)</th>
<th>Keuntungan 6 Bulan (RM)</th>
<th>Keuntungan Semasa (RM)</th>
<th>Nilai Marhun (RM)</th>
<th>Pembiayaan Asal (RM)</th>
<th>Baki Pembiayaan (RM)</th>
<th>Nilai Marhun (RM)</th>
<th>Keuntungan 6 Bulan (RM)</th>
<th>Keuntungan Telah Bayar (RM)</th>
<th>Keuntungan Semasa (RM)</th>
</tr>
</thead>
@@ -162,31 +162,64 @@ tr:nth-child(even) {
$jumberat = $jumberat + $item['berat'];
@endphp
{{ number_format($item['berat'], 2, '.', ',') }}<br>
@endforeach
@endforeach
<strong>{{ number_format($jumberat, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumktlhbyr = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumktlhbyr = $jumktlhbyr + $item['ktlhbyr'];
@endphp
{{ number_format($item['ktlhbyr'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumktlhbyr, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jum6bulan = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
</td>
<td align = 'right'>
@php $jumnilaimarhun = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumnilaimarhun = $jumnilaimarhun + $item['nilaimarhun'];
@endphp
{{ number_format($item['nilaimarhun'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumnilaimarhun, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumpinjasal = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumpinjasal = $jumpinjasal + $item['pinjaman'];
@endphp
{{ number_format($item['pinjaman'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumpinjasal, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumpinjaman = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumpinjaman = $jumpinjaman + $item['bakipjm'];
@endphp
{{ number_format($item['bakipjm'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumpinjaman, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jum6bulan = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jum6bulan = $jum6bulan + $item['bakiupah'];
@endphp
{{ number_format($item['bakiupah'], 2, '.', ',') }}<br>
@endforeach
@endforeach
<strong>{{ number_format($jum6bulan, 2, '.', ',') }}</strong>
</td>
</td>
<td align = 'right'>
@php $jumktlhbyr = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumktlhbyr = $jumktlhbyr + $item['ktlhbyr'];
@endphp
{{ number_format($item['ktlhbyr'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumktlhbyr, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jum6bulan = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@@ -198,41 +231,8 @@ tr:nth-child(even) {
<strong>{{ number_format($jum6bulan, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumpinjasal = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumpinjasal = $jumpinjasal + $item['pinjaman'];
@endphp
{{ number_format($item['pinjaman'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumpinjasal, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumpinjaman = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumpinjaman = $jumpinjaman + $item['bakipjm'];
@endphp
{{ number_format($item['bakipjm'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumpinjaman, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumnilaimarhun = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumnilaimarhun = $jumnilaimarhun + $item['nilaimarhun'];
@endphp
{{ number_format($item['nilaimarhun'], 2, '.', ',') }}<br>
@endforeach
<strong>{{ number_format($jumnilaimarhun, 2, '.', ',') }}</strong>
</td>
<!-- <td align = 'right'>
@php $jumhargaasas = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@@ -37,7 +37,7 @@
<th>No.KP</th>
<th>No.Rujukan</th>
<th>Tempoh</th>
<th>Berat(gm)</th>
<th>Berat Asal(gm)</th>
<th>Nilai Marhun Asal(RM)</th>
<th>Pembiayaan Asal (RM)</th>
<th>Baki Pembiayaan (RM)</th>
@@ -66,7 +66,7 @@
<table class="table text-right table-bordered" id="senaraitemp" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" class="check_all"></th>
<th><input type="checkbox" aria-label="Checkbox for following text input" id="checkall"></th>
<th>Bil</th>
<th>Kod Cawangan</th>
<th>Cawangan</th>
@@ -84,7 +84,7 @@
@if($send['bil_lelong'] > 0)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="caw[]" id="caw" value = "{{ $send['kodcaw'] }}" class="custom_name"></td>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="caw[]" id="caw" value = "{{ $send['kodcaw'] }}" class="checkbox"></td>
<td>{{ $count++ }}</td>
<td>{{ $send['kodcaw'] }}</td>
<td >{{ $send['caw_name'] }}</td>
@@ -163,17 +163,34 @@
// $( '.addcaw').removeClass('dt-button');
// $( '.export').removeClass('dt-button');
</script>
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script>
$(".check_all").on("click", function(){
$(".custom_name").each(function(){
$(this).attr("checked", true);
});
});
</script>
<script type='text/javascript'>
$(document).ready(function(){
// Check or Uncheck All checkboxes
$("#checkall").change(function(){
var checked = $(this).is(':checked');
if(checked){
$(".checkbox").each(function(){
$(this).prop("checked",true);
});
}else{
$(".checkbox").each(function(){
$(this).prop("checked",false);
});
}
});
// Changing state of CheckAll checkbox
$(".checkbox").click(function(){
if($(".checkbox").length == $(".checkbox:checked").length) {
$("#checkall").prop("checked", true);
} else {
$("#checkall").prop("checked", false);
}
});
});
</script>
<script>
$(function() {
$( "form" ).submit(function() {