update lap lelong full

This commit is contained in:
Amirah22
2022-04-13 10:45:01 +08:00
parent 0090307e35
commit 0158fa195d
8 changed files with 287 additions and 22 deletions
+63 -6
View File
@@ -795,7 +795,7 @@ class LelongController extends Controller
}
public function laporansenarailelong(Request $request){
public function lapbrglelongindex (Request $request){
// $user = Auth::user();
@@ -815,19 +815,28 @@ class LelongController extends Controller
->get()->toArray();
$keuntungan=0;
$total_hargaasas = 0;
$total_upahkeuntungan = 0;
$total_nmarhun = 0;
$total_pinjaman = 0;
foreach($brglelong as $index1=>$upah)
{
$keuntungan = $upah['bakipjm'] - ($upah['bakihargajualan'] - ($upah['upah12'] - $upah['ansakhir'])-(($upah['tempoh']-$upah['tempohbayar'])*$upah['kadarupah']/100*$upah['bakipjm']) );
$brglelong[$index1]['keuntungan'] = $keuntungan;
$total_hargaasas = $total_hargaasas + $upah['hargaasas'];
$total_upahkeuntungan = $total_upahkeuntungan + $keuntungan;
$total_nmarhun = $total_nmarhun + $upah['nilaimarhun'];
$total_pinjaman = $total_pinjaman + $upah['pinjaman'];
}
return view('lelong.senaraibrglelong',compact('brglelong','lelong_id','keuntungan'));
return view('lelong.senaraibrglelong',compact('brglelong','lelong_id','keuntungan','total_hargaasas','total_upahkeuntungan','total_nmarhun','total_pinjaman'));
}
@@ -874,7 +883,7 @@ class LelongController extends Controller
}
public function lapbidaan (Request $request){
public function lapbidaanpembidaindex (Request $request){
@@ -951,6 +960,54 @@ class LelongController extends Controller
return $pdf->download('Senarai Nama Bidaan Pembida.pdf');
}
Public function laplelongindex (Request $request){
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->get();
return view('lelong.laplelongindex',compact('lelongid'));
}
Public function laplelong ($lelong_id){
$total_nmarhun = 0;
$total_pembiayaan = 0;
$total_upahsimpan = 0;
$total_cajlelong = 0;
$total_hargalelong = 0;
$total_bakirugi = 0;
$total_hargaasas = 0;
$laporanlelong= LelongBid::join('lelongbidder','lelongbid.id','=','lelongbidder.lelongbid_id')
->where('lelongbid.lelong_id','=',$lelong_id)
->where('lelongbidder.status_bidder','=','1')
->select('lelongbid.norujukan','lelongbid.nilaimarhun','lelongbid.pinjaman','lelongbid.upahsimpan',
'lelongbid.cajlelong','lelongbidder.hargabida','lelongbid.baki','lelongbid.hargaasas','lelongbidder.nama_bidder')
->get()->toArray();
foreach($laporanlelong as $index1=>$laplelong)
{
$total_nmarhun = $total_nmarhun + $laplelong['nilaimarhun'];
$total_pembiayaan = $total_pembiayaan + $laplelong['pinjaman'];
$total_upahsimpan = $total_upahsimpan + $laplelong['upahsimpan'];
$total_cajlelong = $total_cajlelong + $laplelong['cajlelong'];
$total_hargalelong = $total_hargalelong $laplelong['hargabida'];
$total_bakirugi = $total_bakirugi + $laplelong['baki'];
$total_hargaasas = $total_hargaasas + $laplelong['hargaasas'];
}
return view('lelong.laplelong', compact('laporanlelong','lelong_id','total_nmarhun'));
}
}
+9 -4
View File
@@ -139,13 +139,18 @@
<li class="{{ (request()->is('Laporan/*')) ? 'active' : '' }}">
<a href="#laporanSubmenu" data-toggle="collapse" aria-expanded="false" style="">Laporan</a>
<ul class="list-unstyled collapse {{ (request()->is('lelong/*')) ? 'show' : '' }}" id="laporanSubmenu" >
<li class="{{ (request()->is('lelong/laporansenarailelong/*') || request()->is('lelong/laporansenarailelong') ) ? 'active' : '' }}">
<a href="{{url('lelong/laporansenarailelong')}}">Laporan Senarai Lelong</a>
<li class="{{ (request()->is('lelong/lapbrglelongindex/*') || request()->is('lelong/lapbrglelongindex') ) ? 'active' : '' }}">
<a href="{{url('lelong/lapbrglelongindex')}}">Laporan Barang Lelong</a>
</li>
</ul>
<ul class="list-unstyled collapse {{ (request()->is('lelong/*')) ? 'show' : '' }}" id="laporanSubmenu" >
<li class="{{ (request()->is('lelong/lapbidaan/*') || request()->is('lelong/lapbidaan') ) ? 'active' : '' }}">
<a href="{{url('lelong/lapbidaan')}}">Laporan Senarai Nama Bidaan Pembida</a>
<li class="{{ (request()->is('lelong/lapbidaanpembidaindex/*') || request()->is('lelong/lapbidaanpembidaindex') ) ? 'active' : '' }}">
<a href="{{url('lelong/lapbidaanpembidaindex')}}">Laporan Nama Pembida</a>
</li>
</ul>
<ul class="list-unstyled collapse {{ (request()->is('lelong/*')) ? 'show' : '' }}" id="laporanSubmenu" >
<li class="{{ (request()->is('lelong/laplelongindex/*') || request()->is('lelong/laplelongindex') ) ? 'active' : '' }}">
<a href="{{url('lelong/laplelongindex')}}">Laporan Lelong Keseluruhan</a>
</li>
</ul>
</li>
+117
View File
@@ -0,0 +1,117 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="{{route('lelong.pdfsenarailapbidaan')}}" method="POST">
@csrf
<input type="hidden" name="type" value="User">
<input type="hidden" name="lelongid" value="{{$lelong_id}}">
<table class="table table-striped table-xl text-center" id="notis" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>No Rujukan</th>
<th>Nilai Marhun</th>
<th>Pembiayaan</th>
<th>Upah Simpan</th>
<th>Caj Lelong</th>
<th>Harga Lelong</th>
<th>Baki Rugi</th>
<th>Harga Asas</th>
<th>Nama Pembeli</th>
</tr>
</thead>
<tbody>
@foreach ($laporanlelong as $laporan)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $laporan['norujukan']}}</td>
<td>{{ $laporan['nilaimarhun']}}</td>
<td>{{ $laporan['pinjaman']}}</td>
<td>{{ $laporan['upahsimpan']}}</td>
<td>{{ $laporan['cajlelong']}}</td>
<td>{{ $laporan['hargabida']}}</td>
<td>{{ $laporan['baki']}}</td>
<td>{{ $laporan['hargaasas']}}</td>
<td>{{ $laporan['nama_bidder']}}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="2" align="left"><b>JUMLAH KESELURUHAN</b></td>
<td>{{ number_format($total_nmarhun, 2, '.', ',') }}</td>
{{-- <td>{{ number_format($total_upahkeuntungan, 2, '.', ',') }}</td>
<td></td>
<td>{{ number_format($total_nmarhun, 2, '.', ',') }}</td>
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td> --}}
<td></td>
</tr>
</tfoot>
</table>
<div class="modal-footer" style="margin-top:2%;">
<a href="{{ route('lelong.laplelongindex') }}" class="btn btn-primary">Kembali</a>
</div>
</div>
</div>
</div>
<script>
var tablelelongbid= $('#notis').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
{
className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export',
titleAttr: 'Download to PDF',
text: '<h8><b>PDF</b></h8>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
}
}
]
});
$('.export').tooltip();
$( '.export').removeClass('dt-button');
</script>
@endsection
@@ -0,0 +1,73 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="" method="POST">
<input type="hidden" name="type" value="User">
<table class="table table-striped table-xl" id="tablenotislelong" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
<th>Lelong ID</th>
<th>Cawangan</th>
<th>Tarikh Lelong</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach ($lelongid as $bid)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $bid->id }}"></td>
<td>{{ $bid->lelong_id}}</td>
<td>{{ $bid->caw_name}}</td>
<td>{{ $bid->tarikh_lelong }}</td>
<td class="text-center">
<a href="{{ route('lelong.laplelong',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Senarai Lelong Keseluruhan" ><i class="far fa-edit"></i></a>
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
var tablenotislelong = $('#tablenotislelong').DataTable({
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 3,
"orderable": false
}
],
order: [[1, 'asc']],
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
});
</script>
@endsection
@@ -31,7 +31,7 @@
<td>{{ $bid->caw_name}}</td>
<td>{{ $bid->tarikh_lelong }}</td>
<td class="text-center">
<a href="{{ route('lelong.senarailapbidaan',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Senarai Barang Lelong" ><i class="far fa-edit"></i></a>
<a href="{{ route('lelong.senarailapbidaan',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Senarai Nama Pembida" ><i class="far fa-edit"></i></a>
</td>
</tr>
@endforeach
@@ -46,13 +46,19 @@
<tfoot>
<tr>
{{-- <td colspan="2"><b>JUMLAH KESELURUHAN</b></td>
<td>{{ number_format($tot_hargaasas, 2, '.', ',') }}</td> --}}
<td colspan="2" align="left"><b><strong>JUMLAH KESELURUHAN</strong></b></td>
<td><strong>{{ number_format($total_hargaasas, 2, '.', ',') }}</strong></td>
<td><strong>{{ number_format($total_upahkeuntungan, 2, '.', ',') }}</strong></td>
<td></td>
<td><strong>{{ number_format($total_nmarhun, 2, '.', ',') }}</strong></td>
<td><strong>{{ number_format($total_pinjaman, 2, '.', ',') }}</strong></td>
<td></td>
</tr>
</tfoot>
</table>
<div class="modal-footer" style="margin-top:2%;">
<a href="{{ route('lelong.laporansenarailelong') }}" class="btn btn-primary">Kembali</a>
<a href="{{ route('lelong.lapbrglelongindex') }}" class="btn btn-primary">Kembali</a>
</div>
</div>
</div>
@@ -73,14 +79,14 @@
"info": false,
"lengthChange": false,
"pageLength": 15,
"pageLength": 999999999,
dom: 'Bfrtip',
buttons: [
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
// titleAttr: 'Download to PDF',
className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export',
titleAttr: 'Download to PDF',
text: '<h8><b>PDF</b></h8>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
@@ -56,7 +56,7 @@
</table>
<div class="modal-footer" style="margin-top:2%;">
<a href="{{ route('lelong.laporansenarailelong') }}" class="btn btn-primary">Kembali</a>
<a href="{{ route('lelong.lapbidaanpembidaindex') }}" class="btn btn-primary">Kembali</a>
</div>
</div>
</div>
+11 -4
View File
@@ -89,15 +89,22 @@ Route::group(['prefix'=>'lelong'], function () {
Route::get('/deletelelong/{id}',['as'=>'lelong.delete','uses'=>'LelongController@delete']);
Route::get('/export/{id}',['as'=>'lelong.exportnotis','uses'=>'LelongController@exportnotis']);
Route::get('/janapemenang/{id}', ['as'=>'lelong.janapemenang','uses'=>'LelongController@janapemenang']);
Route::get('/laporansenarailelong',['as'=>'lelong.laporansenarailelong','uses'=>'LelongController@laporansenarailelong']);
Route::get('/senaraibrglelong/{lelong_id}',['as'=>'lelong.senaraibrglelong','uses'=>'LelongController@senaraibrglelong']);
Route::post('/pdfsenarailelong',['as'=>'lelong.pdfsenarailelong','uses'=>'LelongController@pdfsenarailelong']);
Route::get('/senaraimarhun/{lelongid}/{cawid}', ['as'=>'lelong.senaraimarhun','uses'=>'LelongController@senaraimarhun']);
Route::post('/deletemarhun', ['as'=>'lelong.deletemarhun','uses'=>'LelongController@deletemarhun']);
Route::get('/lapbidaan', ['as'=>'lelong.lapbidaan','uses'=>'LelongController@lapbidaan']);
Route::get('/lapbrglelongindex',['as'=>'lelong.lapbrglelongindex','uses'=>'LelongController@lapbrglelongindex']);
Route::get('/senaraibrglelong/{lelong_id}',['as'=>'lelong.senaraibrglelong','uses'=>'LelongController@senaraibrglelong']);
Route::post('/pdfsenarailelong',['as'=>'lelong.pdfsenarailelong','uses'=>'LelongController@pdfsenarailelong']);
Route::get('/lapbidaanpembidaindex', ['as'=>'lelong.lapbidaanpembidaindex','uses'=>'LelongController@lapbidaanpembidaindex']);
Route::get('/senarailapbidaan/{lelong_id}',['as' =>'lelong.senarailapbidaan','uses'=>'LelongController@senarailapbidaan']);
Route::post('/pdfsenarailapbidaan',['as' =>'lelong.pdfsenarailapbidaan','uses'=>'LelongController@pdfsenarailapbidaan']);
Route::get('/laplelongindex',['as' =>'lelong.laplelongindex','uses'=>'LelongController@laplelongindex']);
Route::get('/laplelong/{lelong_id}',['as' =>'lelong.laplelong','uses'=>'LelongController@laplelong']);
});