Merge branch 'main' into amir_dev_2

This commit is contained in:
Amir
2023-01-25 14:32:56 +08:00
6 changed files with 302 additions and 1 deletions
@@ -903,9 +903,46 @@ class ReportCawanganController extends Controller
return $pdf->download('Laporan Tuntut/Belum Baki Lelong.pdf');
}
public function indexubahmarhun (){
$arraydetails = [];
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
->first();
// dd($caw);
$laporan= Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
->join('pengesahan','lelong.id','=','pengesahan.lelong_id')
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('cawangan.caw_code','=',$user['kodcaw'])
->select('cawangan_lelong.lelong_id','tarikh_lelong','lelong.fasa')
->distinct()
->orderBy('cawangan_lelong.lelong_id')
->get()
->toArray();
// dd($laporan);
foreach($laporan as $brg)
{
$details = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('lelong_id', $brg['lelong_id'])
->where('cawangan.caw_code','=',$user['kodcaw'])
->distinct()
->orderBy('lelong_id')
->get()
->toArray();
array_push($arraydetails,['brg' => $brg, 'detailsbrg' => $details ]);
}
return view('marhun.ubahmarhuncaw', compact('arraydetails'));
}
+47
View File
@@ -144,6 +144,8 @@ class ReportController extends Controller
return view('lelong.brgleldetails', compact('arraydetails'));
}
public function senaraibrglelongdetails ($lelong_id, $kodcaw){
$lelongs= LelongBid::where('lelong_id','=',$lelong_id)
@@ -1011,6 +1013,51 @@ class ReportController extends Controller
return view('marhun.ubahmarhun', compact('cawangan','lelong_id','getpengesahan'));
}
public function lapubahmarhunlelongindexpdf ($lelong_id, $kodcaw, $t_lelong){
$cawangan = Pengesahan::where('pengesahan.lelong_id', $lelong_id)
->where('pengesahan.status', 1)
->where('pengesahan.norujukan', 'LIKE', '%'.$kodcaw.'%')
->whereNotNull('pengesahan.disahkan_oleh')
->select('pengesahan.lelongbid_id','pengesahan.diminta_oleh','pengesahan.disahkan_oleh', 'pengesahan.disahkan_pada', 'pengesahan.norujukan', 'pengesahan.lelong_id')
->orderBy('pengesahan.lelongbid_id')
->distinct()
->get();
foreach($cawangan as $index1=>$caw)
{
$getpengesahan = Cawangan::where('caw_code', $kodcaw)->first();
$getdisahkanoleh = User::where('id', $caw['disahkan_oleh'])->first();
$getdimintaoleh = User::where('id', $caw['diminta_oleh'])->first();
$status = Pengesahan::where('lelongbid_id', $caw['lelongbid_id'])
->select('id as sahid','status_ubah', 'request_karat', 'request_berat', 'request_marhun')
->get();
$marhuns = LelongBidMarhun::where('lelongbid_id', $caw['lelongbid_id'])
->get()
->toArray();
$cawangan[$index1]['namacaw'] = $getpengesahan['caw_name'];
$cawangan[$index1]['disahkan_oleh'] = $getdisahkanoleh['name'];
$cawangan[$index1]['diminta_oleh'] = $getdimintaoleh['name'];
$cawangan[$index1]['detailmarhun']=$status;
$cawangan[$index1]['detail']=$marhuns;
}
$getpengesahan = Cawangan::where('caw_code', $kodcaw)->first();
// return view('pdf.laporanubahmarhun', compact('cawangan','lelong_id','getpengesahan','t_lelong'));
$pdf = PDF::loadView('pdf.laporanubahmarhun',compact('cawangan','lelong_id','getpengesahan','t_lelong'))
->setPaper('a4', 'potrait');
return $pdf->download('Senarai Ubah Marhun.pdf');
}
public function exportubahmarhun (){
$arraydetails = [];
@@ -176,6 +176,11 @@
<a href="{{url('reportcaw/indexbrglelpembidacaw')}}">Barang Lelong Pembida</a>
</li>
</ul>
<ul class="list-unstyled collapse {{ (request()->is('reportcaw/*')) ? 'show' : '' }}" id="reportSubmenu">
<li class="{{ (request()->is('reportcaw/indexubahmarhun/*') || request()->is('reportcaw/indexubahmarhun') ) ? 'active' : '' }}">
<a href="{{url('reportcaw/indexubahmarhun')}}">Perubahan Marhun</a>
</li>
</ul>
</li>
@@ -44,6 +44,7 @@
<td>{{ $laporan['brg']['fasa']}}</td>
<td align="left">
@foreach($laporan['detailsbrg'] as $details)
<a class="confirmrefresh btn m-1 btn-danger" href="{{ route('report.lapubahmarhunlelongindexpdf', ['lelong_id'=>$laporan['brg']['lelong_id'], 'kodcaw'=>$details['caw_code'], 't_lelong'=>$t_lelong ]) }} " data-toggle="tooltip" data-placement="top" title="Muat Turun"><i class="fas fa-download"></i></a>
<a class="btn m-1 btn-primary" href=" {{ route('report.lapubahmarhunlelongindex', ['lelong_id'=>$laporan['brg']['lelong_id'], 'kodcaw'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Senarai Perubahan Marhun"><i class="far fa-edit"></i></a>
<span class="badge badge-pill badge-info text-white" style="font-size:100%">{{ $details['caw_name']}}</span><br>
@endforeach
@@ -0,0 +1,207 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style>
#sim {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:10px;
border-collapse: collapse;
width: 100%;
}
#sim td {padding:3px 5px 3px 5px; padding-right:10px;}, #sim th {
border: 0px solid;
padding: 1px;
/* text-align: left; */
}
#sim tr:nth-child(even){}
#sim tr:hover {}
#sim th {
/* text-align: left; */
border: 0px solid;
table-layout:auto;
color: black;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
}
.row {
margin-left:-5px;
margin-right:-5px;
}
.column {
/* float: left; */
width: 100%;
padding: 5px;
}
/* Clearfix (clear floats) */
.row::after {
content: "";
clear: both;
display: table;
}
table {
border-collapse: collapse;
border-spacing: 0;
width: 200%;
border: 0px solid #ddd;
}
td {
/* text-align: left; */
padding: 16px;
}
th{
/* text-align: left; */
padding: 16px;
/* background-color:gainsboro; */
}
tr:nth-child(even) {
/* background-color: #f2f2f2; */
}
.table th,
.table td {
padding: 0.75rem;
vertical-align: top;
border-top: 1px solid #dee2e6;
}
</style>
<table width="100%" border="0" id="sim">
<tr>
<td width="50%"><h3>PERMODALAN KELANTAN BERHAD</h3></td>
</tr>
<tr>
<td colspan="2"><u><b>Laporan Ubah Marhun</b></u></td>
</tr>
</table>
<table cellspacing="" cellpadding="5" text-align="left" border="0" height="25" align="left" id="sim">
<thead>
<br>
<tr>
<td>Batch Lelong: {{$lelong_id}}</td>
<td>Cawangan : {{$getpengesahan['caw_name']}}
<tr>
<td>Tarikh Lelong : {{$t_lelong}} </td>
<tr>
</tr>
</thead>
</table>
<br>
<table class='table text-center table-bordered table-hover' style="width:100%" cellspacing="0" cellpadding="5" style="float:right;" border="0" width="100%" height="80" align="left" id="sim">
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Perubahan</th>
<th>Marhun Asal</th>
<th>Marhun Baru</th>
<th>Mutu Asal</th>
<th>Mutu Baru</th>
<th>Berat Asal (gm)</th>
<th>Berat Baru (gm)</th>
<th>Diminta Oleh</th>
<th>Disahkan Oleh</th>
{{-- <th>Status</th> --}}
</tr>
</thead>
<tbody>
@forelse($cawangan as $marhun)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $marhun['norujukan'] }}</td>
<td>@foreach ($marhun['detailmarhun'] as $item)
@if($item['status_ubah'] == 1)
Mutu
@elseif($item['status_ubah'] == 2)
Pertambahan Marhun
@elseif($item['status_ubah'] == 3)
Hapus Marhun
@elseif($item['status_ubah'] == 4)
Berat
@elseif($item['status_ubah'] == 5)
Mutu & Berat
@elseif($item['status_ubah'] == 7)
Marhun
@elseif($item['status_ubah'] == 8)
Mutu, Berat & Marhun
@elseif($item['status_ubah'] == 9)
Mutu & Marhun
@elseif($item['status_ubah'] == 10)
Berat & Marhun
@endif
<br>
@endforeach</td>
<td>@foreach ($marhun['detail'] as $item)
{{$item['old_marhun']}}<br>
@endforeach</td>
<td>@foreach ($marhun['detailmarhun'] as $item)
@if($item['request_marhun'] == null)
@else
<i class="btn fa fa-arrow-right" aria-hidden="true" style="font-size: 10px"></i>
@endif {{$item['request_marhun']}}<br>
@endforeach</td>
<td>@foreach ($marhun['detail'] as $item)
{{$item['old_karat']}}<br>
@endforeach</td>
<td>@foreach ($marhun['detailmarhun'] as $item)
@if($item['request_karat'] == null)
@else
<i class="btn fa fa-arrow-right" aria-hidden="true" style="font-size: 10px"></i>
@endif{{$item['request_karat']}}<br>
@endforeach</td>
<td>@foreach ($marhun['detail'] as $item)
{{$item['old_berat']}}<br>
@endforeach</td>
<td>@foreach ($marhun['detailmarhun'] as $item)
@if($item['request_berat'] == null)
@else
<i class="btn fa fa-arrow-right" aria-hidden="true" style="font-size: 10px"></i>
@endif{{$item['request_berat']}}<br>
@endforeach</td>
<td>{{ $marhun['diminta_oleh'] }}</td>
<td>{{ $marhun['disahkan_oleh'] }}</td>
{{-- <td><button class="btn btn-success btn-sm hovernone-success" disabled>BERJAYA DISAHKAN</button></td> --}}
</tr>
@empty
<tr>
<td colspan="12">No Data</td>
</tr>
@endforelse
</tbody>
</table>
{{-- @endsection --}}
+4
View File
@@ -533,6 +533,8 @@ Route::get('/lelongreport/{lelongid}/{cawid}',['as'=>'report.lelongreport','uses
Route::get('/lapubahmarhunlelong',['as'=>'report.lapubahmarhunlelong','uses'=>'ReportController@lapubahmarhunlelong']);
Route::get('/lapubahmarhunlelongindex/{lelong_id}/{kodcaw}',['as'=>'report.lapubahmarhunlelongindex','uses'=>'ReportController@lapubahmarhunlelongindex']);
Route::get('/lapubahmarhunlelongindexpdf/{lelong_id}/{kodcaw}/{t_lelong}',['as'=>'report.lapubahmarhunlelongindexpdf','uses'=>'ReportController@lapubahmarhunlelongindexpdf']);
Route::post('/export',['as'=>'report.exportubahmarhun','uses'=>'ReportController@exportubahmarhun']);
@@ -583,6 +585,8 @@ Route::get('laporanlelfullcaw/{lelong_id}',['as'=>'reportcaw.laporanlelfullcaw',
Route::get('indexbrglelpembidacaw',['as'=>'reportcaw.indexbrglelpembidacaw','uses'=>'ReportCawanganController@indexbrglelpembidacaw']);
Route::get('laporanbrglelpembidacaw/{lelong_id}',['as'=>'reportcaw.laporanbrglelpembidacaw','uses'=>'ReportCawanganController@laporanbrglelpembidacaw']);
Route::get('indexubahmarhun',['as'=>'reportcaw.indexubahmarhun','uses'=>'ReportCawanganController@indexubahmarhun']);
});
//Report by cawangan KHAS