update sah tangguh lelong pc & operasi

This commit is contained in:
faiqahzaman
2022-05-08 11:46:29 +08:00
parent c5e6030e09
commit b78a75f7ea
4 changed files with 61 additions and 18 deletions
+46 -6
View File
@@ -399,6 +399,7 @@ class MarhunController extends Controller
$mutumarhun = Lelong::join('pengesahan', 'lelong.id', '=', 'pengesahan.lelong_id')
->where('lelong.id', $id)
->whereNull('disahkan_oleh')
->where('pengesahan.status_ubah', [1,2,3,4,5])
->selectRaw('count(*) as total, sum(status) as tstat,norujukan')
->groupBy('pengesahan.norujukan')
->get()->toArray();
@@ -653,10 +654,22 @@ class MarhunController extends Controller
public function senarailelong()
{
$lelong = Lelong::where('sts_lelong', 0)
->get();
$arrayinfo = [];
return view('pengesahan.senarailelong',compact('lelong'));
$lelong = Lelong::where('sts_lelong', 0)
->get()->toArray();
foreach($lelong as $details)
{
$detailsinfo = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('lelong_id', $details['id'])
->get()
->toArray();
array_push($arrayinfo,['detail'=>$details, 'detailsinfo'=>$detailsinfo]);
}
return view('pengesahan.senarailelong',compact('lelong', 'arrayinfo'));
}
public function senaraitangguhlelong($id)
@@ -679,14 +692,41 @@ class MarhunController extends Controller
)
->get();
foreach($tangguhlelong as $index1=>$tanguhlel)
{
$getkodcaw = LelongBid::join('cawangan', 'lelongbid.kodcaw', '=', 'cawangan.caw_code')
->where('lelong_id', $id)
->first();
$tangguhlelong[$index1]['details'] = $tanguhlel;
$tangguhlelong[$index1]['nama_caw'] = $getkodcaw;
}
return view('pengesahan.senaraitangguhlelong',compact('tangguhlelong','id'));
}
public function lelbidmarhun($id, $norujukan, $tangguhlelong_id)
{
$marhuns = LelongBidMarhun::join('tangguhlelong', 'lelongbidmarhun.lelongbid_id', '=', 'tangguhlelong.lelongbid_id')
->where('tangguhlelong.lelong_id', $id)
->where('tangguhlelong.norujukan', $norujukan)
$tangguhlelong = TangguhLelong::join('gadaimarhun', 'tangguhlelong.norujukan', '=', 'gadaimarhun.norujukan')
->where('gadaimarhun.norujukan', $norujukan)
->where('tangguhlelong.id', $tangguhlelong_id)
->select('tangguhlelong.id as tangguhlelong_id',
'tangguhlelong.lelong_id',
'tangguhlelong.lelongbid_id',
'tangguhlelong.norujukan',
'tangguhlelong.pinjaman',
'tangguhlelong.tarikhtangguh',
'tangguhlelong.nota as tangguh_nota',
'tangguhlelong.pinjaman',
'gadaimarhun.id as gadaimarhun_id',
'gadaimarhun.bil',
'gadaimarhun.marhun',
'gadaimarhun.nota as gadai_nota',
'gadaimarhun.karat',
'gadaimarhun.berat',
'gadaimarhun.harga',
'gadaimarhun.n_marhun'
)
->get();
return view('pengesahan.lelbidmarhun',compact('tangguhlelong', 'id', 'norujukan'));
@@ -92,6 +92,7 @@ class TangguhLelongController extends Controller
}
$getic[$index1]['user_details'] = $getnorujukan;
// dd($getic[$index1]['user_details']);
}
$lelong_id = $request->lelong_id;
@@ -109,14 +110,14 @@ class TangguhLelongController extends Controller
$currentdate = $currentdate->toDateTimeString();
$lelbidmarhun = $request->checkboxdata;
// dd($lelbidmarhun);
$lelong = Lelong::where('id', $request->lelong_id)->get()->toArray();
foreach($lelbidmarhun as $bidmarhun)
{
// dd($bidmarhun);
$lelongbidmarhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbidmarhun.id', $bidmarhun)
->where('lelongbid.id', $bidmarhun)
->select('lelongbidmarhun.id as lelongbidmarhun_id',
'lelongbidmarhun.bil',
'lelongbidmarhun.marhun',
@@ -152,10 +153,11 @@ class TangguhLelongController extends Controller
'lelongbid.marhun',
)
->get()->toArray();
// dd($lelongbidmarhun);
$pengesahan = new Pengesahan();
$pengesahan->lelong_id = $request->lelong_id;
$pengesahan->lelongbid_id = $lelongbidmarhun[0]['lelongbid_id'];
$pengesahan->lelongbid_id = $bidmarhun;
$pengesahan->lelongbidmarhun_id = $lelongbidmarhun[0]['lelongbidmarhun_id'];
$pengesahan->norujukan = $lelongbidmarhun[0]['norujukan'];
$pengesahan->diminta_oleh = $user->id;
@@ -285,7 +287,7 @@ class TangguhLelongController extends Controller
$tangguhlelong = new TangguhLelong();
$tangguhlelong->lelong_id = $request->lelong_id;
$tangguhlelong->lelongbid_id = $lelongbidmarhun[0]['lelongbid_id'];
$tangguhlelong->lelongbid_id = $bidmarhun;
$tangguhlelong->norujukan = $lelongbidmarhun[0]['norujukan'];
$tangguhlelong->pinjaman = $lelongbidmarhun[0]['pinjaman'];
$tangguhlelong->tarikhtangguh = $currentdate;
@@ -11,10 +11,10 @@
</div>
@endif
<form id="formtangguhlelong" action="{{route('tangguhlelong.tangguhlelong')}}" method="POST">
<form id="formtangguhlel" action="{{route('tangguhlelong.tangguhlelong')}}" method="POST">
@csrf
<input type="hidden" name="lelong_id" value="{{ $lelong_id }}">
<table class="table table-striped table-xl text-center" id="tangguhlelong" style="width:100%">
<table class="table table-striped table-xl text-center" id="tangguhlel" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
@@ -48,10 +48,10 @@
</tbody>
</table>
<div class="modal-footer" style="margin-top:2%;">
<a href="{{ route('tangguhlelong.carian', ['lelong_id'=>$ic['user_details'][0]['lelong_id']]) }}" class="btn btn-primary">Kembali</a>
<a href="{{ route('tangguhlelong.carian', ['lelong_id'=>$lelong_id]) }}" class="btn btn-primary">Kembali</a>
<button type="submit" class="btn btn-danger">Tangguh Lelong</button>
</div>
</form>
</div>
</div>
</div>
</div>
@@ -101,7 +101,7 @@
}
var tabletangguhlelong = $('#tangguhlelong').DataTable( {
var tabletangguhlel = $('#tangguhlel').DataTable( {
"columnDefs": [
{
"targets": 0,
@@ -25,12 +25,13 @@
<th>Narhun</th>
<th>Nilai Marhun (RM)</th>
<th>Pembiayaan (RM)</th>
<th>Berat</th>
<th>Berat</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach ($pengesahan as $sah)
<tr>
<td>{{$loop->iteration}}</td>
@@ -51,8 +52,8 @@
<div class="modal-footer" style="margin-top:2%;">
<a href="{{ route('pengesahan.senarailelongtangguh') }}" class="btn btn-primary">Kembali</a>
<button type="submit" class="btn btn-warning">Sahkan</button>
</div>
</form>
</div>
</div>
</div>
</div>
@@ -138,7 +139,7 @@
// $("#formtangguhlelong").submit();
// }
// }
]
// ]
});
$('.addsim').tooltip();