lap senarai brg lelong

This commit is contained in:
Amirah22
2022-05-18 11:58:24 +08:00
parent 80a88ba873
commit 6062b004d5
11 changed files with 116 additions and 237 deletions
+25 -56
View File
@@ -259,6 +259,7 @@ class LelongController extends Controller
'lelong_id',
'jeniskarat',
'data',
'keuntungan',
'total_upahkeuntungan',
'total_nilaimarhun'));
}
@@ -838,11 +839,27 @@ class LelongController extends Controller
$marhuns[$index1]['keuntungan'] = $keuntungan;
}
$arrayinfo = [];
$lelong_id = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
->where('cawangan_lelong.lelong_id','=',$lelongid)
->select('lelong_id','tarikh_lelong')
->groupBy('lelong_id')
->get()->toArray();
foreach($lelong_id as $laporan)
{
$details = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('lelong_id',$laporan['lelong_id'])
->get()
->toArray();
array_push($arrayinfo,['laporan' => $laporan,'details' => $details]);
}
return view('lelong.senaraimarhun',compact('marhuns','lelongid','cawid'));
return view('lelong.senaraimarhun',compact('marhuns','lelongid','cawid','arrayinfo'));
}
public function deletemarhun(Request $request){
@@ -911,73 +928,25 @@ class LelongController extends Controller
$keuntungan=0;
$total_hargaasas = 0;
$total_upahkeuntungan = 0;
$total_nmarhun = 0;
$total_pinjaman = 0;
$total_berat = 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'];
$total_berat = $total_berat + $upah['berat'];
}
return view('lelong.senaraibrglelong',compact('arrayinfo','lelongid','brglelong','lelong_id','keuntungan','total_hargaasas','total_upahkeuntungan','total_nmarhun','total_pinjaman'));
}
public function pdfsenarailelong(Request $request){
$lelong_id = $request->lelongid;
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
->where('lelong.id', $lelong_id)
->get();
$brglelong = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
->where('lelongbid.lelong_id', $lelong_id)
->get();
$keuntungan=0;
$totharga_asas=0;
$totkeuntungan=0;
$totnilai_marhun=0;
$tot_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;
}
$totharga_asas = $totharga_asas + ($upah->sum('hargaasas'));
$totkeuntungan = $totkeuntungan + ($brglelong->sum('keuntungan'));
$totnilai_marhun = $totnilai_marhun + ($upah->sum('nilaimarhun'));
$tot_pinjaman = $tot_pinjaman + ($upah->sum('pinjaman'));
$pdf = PDF::loadView('pdf.listlelong',compact('brglelong','totharga_asas','totkeuntungan','totnilai_marhun','tot_pinjaman','lelong_id','lelongid'))
$pdf = PDF::loadView('pdf.listlelong',compact('arrayinfo','lelongid','brglelong','lelong_id','keuntungan','total_hargaasas','total_berat'))
->setPaper('a4', 'potrait');
return $pdf->download('Senarai Lelong.pdf');
return $pdf->download('Senarai Barang Lelong.pdf');
}
public function lapbrglelongdetailsindex (Request $request){
// dd('hiio');
}
@@ -439,6 +439,9 @@ class SimulasiController extends Controller
}
//total keuntungaan full
array_push($arraycaw,[
'id_cawangan'=> $cawangan['id'],
'cawangan'=>$cawangan['caw_name'],
@@ -181,6 +181,14 @@
</li>
</ul>
</li>
<li class="{{ (request()->is('Laporancaw/*')) ? 'active' : '' }}">
<a href="#laporancawSubmenu" data-toggle="collapse" aria-expanded="false" style="">Laporan by Cawangan</a>
<ul class="list-unstyled collapse {{ (request()->is('')) ? 'show' : '' }}" id="laporancawSubmenu" >
{{-- <li class="{{ (request()->is('') || request()->is('') ) ? 'active' : '' }}">
<a href="{{url('')}}">Barang Lelong</a>
</li> --}}
</ul>
</li>
@endhasrole
@hasrole('account')
{{-- <li class="{{ (request()->is('home')) ? 'active' : '' }}">
@@ -20,7 +20,7 @@
<th>Lelong ID</th>
<th>Tarikh Lelong</th>
<th>Cawangan</th>
<th class="text-center">Action</th>
<th class="text-center">Muat Turun</th>
</tr>
</thead>
<tbody>
@@ -37,7 +37,7 @@
</td>
<td class="text-center">
<a href="{{ route('lelong.senaraibrglelong',$laporan['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Senarai Barang Lelong" ><i class="far fa-edit"></i></a>
<a href="{{ route('lelong.senaraibrglelong',$laporan['laporan']['lelong_id']) }}" data-toggle="tooltip" data-placement="top" title="Senarai Barang Lelong" ><i class="fas fa-download"></i></a>
</td>
</tr>
@@ -1,120 +0,0 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@foreach ($arrayinfo as $laporan)
<span class="pt-3" style="margin-left:1%;"><b>Laporan Barang Lelong </b></span>
<span class="pt-3" style="margin-left:1%;">Lelong ID: {{ $laporan['laporan']['lelong_id']}}</span>
<span class="pt-3" style="margin-left:1%;">Tarikh Lelong: {{ $laporan['laporan']['tarikh_lelong']}}</span>
@foreach($laporan['details'] as $details)
<span class="pt-3" style="margin-left:1%;">Cawangan: {{ $details['caw_name']}}</span>
@endforeach
<br>
@endforeach
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="{{route('lelong.pdfsenarailelong')}}" 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>Harga Asas</th>
<th>Upah Keuntungan</th>
<th>JBG</th>
<th>Nilai Marhun Asal</th>
<th>Pinjaman</th>
<th>Marhun</th>
</tr>
</thead>
<tbody>
@foreach($brglelong as $brg)
<tr>
<td width="5%" align="center">{{ $loop->iteration }} </td>
<td width="14%" align="center">{{ $brg['norujukan']}}</td>
<td width="12%" align="center">{{$brg['hargaasas']}}</td>
<td width="12%" align="center">{{ $brg['keuntungan'] }}</td>
<td width="9%" align="center">{{ $brg['jbg']}}</td>
<td width="13%" align="center">{{ $brg['nilaimarhun']}}</td>
<td width="13%" align="center">{{ $brg['pinjaman']}}</td>
<td width="17%" align="center">{{ $brg['marhun']}}</td>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="2" align="left"><b>JUMLAH KESELURUHAN</b></td>
<td>{{ number_format($total_hargaasas, 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.lapbrglelongindex') }}" 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": 99999999999,
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
+15 -6
View File
@@ -5,6 +5,21 @@
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@foreach ($arrayinfo as $laporan)
<span class="pt-3" style="margin-left:1%;"><b>Lelong ID : {{ $laporan['laporan']['lelong_id']}}</b></span>
<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>
@foreach($laporan['details'] as $details)
<span class="pt-3" style="margin-left:1%;"><b>Nama Cawangan : {{ $details['caw_name']}}</b></span>
<span class="pt-3" style="margin-left:1%;"><b>Kod Cawangan : {{ $details['caw_code']}}</b></span>
@endforeach
@endforeach
@if ($message = Session::get('success'))
<div class="alert alert-success">
@@ -19,9 +34,6 @@
<thead class="bg-primary text-white">
<tr>
<th>No.</th>
<th>Tarikh Lelong</th>
<th>Kod Cawangan</th>
<th>Nama Cawangan</th>
<th>Norujukan</th>
<th>Pinjaman (RM)</th>
<th>Tempoh</th>
@@ -39,9 +51,6 @@
@foreach ($marhuns as $index=> $marhun)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{ $marhun['t_lelong'] }}</td>
<td class="text-center">{{ $marhun['kodcaw'] }}</td>
<td>{{ $marhun['caw_name'] }}</td>
<td>{{ $marhun['norujukan']}}</td>
<td>{{ $marhun['pinjaman'] }}</td>
<td>{{ $marhun['jbg']}}</td>
+16 -6
View File
@@ -33,7 +33,19 @@
<td>Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
</tr>
<tr>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_upah, 2, '.', ',') }}</td>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_upahkeuntungan, 2, '.', ',') }}</td>
</tr>
<tr>
@foreach($data as $data1)
<td>Tarikh Lelong :
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $data1['tarikh_lelong'] );
$datez = $myDateTime->format('d-m-Y');
echo($datez);
@endphp
</td>
@endforeach
</tr>
</table>
</div>
@@ -51,7 +63,7 @@
</tr>
<tr>
@foreach($data as $data)
<td>Tempoh: {{$data['jbg'] }}</td>
<td>Tempoh : {{$data['jbg'] }}</td>
@endforeach
</tr>
</table>
@@ -64,7 +76,6 @@
<tr class="text-center">
<th>No</th>
<th>Cawangan</th>
<th>Tarikh Lelong</th>
<th>Bil Marhun (Paket)</th>
<th>Berat (gm)</th>
<th>Nilai Marhun (RM)</th>
@@ -82,12 +93,11 @@
<tr>
<td>{{$index+1}}</td>
<td><a href=" {{ route('lelong.senaraimarhun',['lelongid'=>$lelong_id,'cawid'=>$caw['id_cawangan']]) }} " target="blank" style="color:#3490dc">{{ $caw['cawangan'] }}</a></td>
<td>{{ $caw['t_lelong'] }}</td>
<td>{{ $caw['bil_marhun'] }}</td>
<td>{{ number_format($caw['berat'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['n_marhun'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['pinjaman'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['upah'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['keuntungan'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['hargaasas'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['cajlelong'], 2, '.', ',') }}</td>
<td>{{ number_format($caw['bakilelong'], 2, '.', ',') }}</td>
@@ -97,7 +107,7 @@
</tbody>
<tfoot>
<tr>
<td colspan="3"><b>JUMLAH KESELURUHAN</b></td>
<td colspan="2"><b>JUMLAH KESELURUHAN</b></td>
<td>{{ $total_marhun }}</td>
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
<td>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</td>
+35 -43
View File
@@ -56,11 +56,17 @@ table {
border: 0px solid #ddd;
}
th, td {
td {
text-align: left;
padding: 16px;
}
th{
text-align: left;
padding: 16px;
background-color:gainsboro;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
@@ -75,7 +81,7 @@ tr:nth-child(even) {
</tr>
<tr>
<td colspan="2"><u><b>LAPORAN SENARAI LELONGAN</b></u></td>
<td colspan="2"><u><b>LAPORAN BARANG LELONG</b></u></td>
</tr>
</table>
@@ -84,63 +90,49 @@ tr:nth-child(even) {
<thead>
<br>
<tr>
<td>Lelong ID: {{$lelong_id}}</td>
@foreach ($lelongid as $tarikh)
<td>Tarikh Lelong: {{ $tarikh->tarikh_lelong }}</td>
</tr>
@foreach ($arrayinfo as $laporan)
<td>Lelong ID : {{$laporan['laporan']['lelong_id']}}</td>
<td>Tarikh Lelong : {{$laporan['laporan']['tarikh_lelong']}}
@foreach ($laporan['details'] as $details)
<td>Cawangan : {{$details['caw_name']}}
@endforeach
@endforeach
</tr>
</thead>
</table>
<br>
<table cellspacing="0" cellpadding="5" style="float:right;" border="0" width="100%" height="80" align="left" id="sim">
<thead>
<tr>
<th width="5%" align="left">No</th>
<th width="15%" align="left">No Rujukan</th>
<th width="10%" align="left">Harga Asas</th>
<th width="10%" align="left">Keuntungan</th>
<th width="7%" align="left">Jbg</th>
<th width="15%" align="left">Nilai Marhun Asal(RM)</th>
<th width="12%" align="left">Pembiayaan(RM)</th>
<th width="10%" align="left">Marhun</th>
<th width="5%" align="left">No</th>
<th width="25%" align="left">No Rujukan</th>
<th width="25%" align="left">Marhun</th>
<th width="25%" align="left">Berat (gm)</th>
<th width="25%" align="left">Harga Asas</th>
</tr>
</thead>
@foreach($brglelong as $brg)
<tr>
<td> {{ $loop->iteration }} </td>
<td>{{ $brg['norujukan'] }}</td>
<td>{{ number_format($brg['hargaasas'], 2, '.', ',') }}</td>
<td>{{ number_format($brg['keuntungan'], 2, '.', ',') }}</td>
<td>{{ $brg['jbg'] }}</td>
<td>{{ number_format($brg['nilaimarhun'], 2, '.', ',') }}</td>
<td>{{ number_format($brg['pinjaman'], 2, '.', ',') }}</td>
<td>{{ ($brg['marhun']) }}</td>
@endforeach
<tr>
<td colspan="2"><b>JUMLAH KESELURUHAN</b></td>
<td>{{ number_format($totharga_asas, 2, '.', ',') }}</td>
<td>{{ number_format($totkeuntungan, 2, '.', ',') }}</td>
<td></td>
<td>{{ number_format($totnilai_marhun, 2, '.', ',') }}</td>
<td>{{ number_format($tot_pinjaman, 2, '.', ',') }}</td>
<td></td>
<td width="5%" align="center">{{ $loop->iteration }} </td>
<td width="14%" align="center">{{ $brg['norujukan']}}</td>
<td width="17%" align="center">{{ $brg['marhun']}}</td>
<td width="17%" align="center">{{ $brg['berat']}}</td>
<td width="12%" align="center">{{$brg['hargaasas']}}</td>
{{-- <td>{{ number_format($brg['hargaasas'], 2, '.', ',') }}</td> --}}
</tr>
@endforeach
<tr>
<td colspan="3"><b>JUMLAH KESELURUHAN</b></td>
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
</tr>
</table>
@@ -6,6 +6,7 @@
<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>
@@ -30,12 +30,20 @@
<td>Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
</tr>
<tr>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_upah, 2, '.', ',') }}</td>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_upahkeuntungan, 2, '.', ',') }}</td>
</tr>
<tr>
@foreach ($data as $data1)
<td>Tarikh Lelong: {{ $data1['tarikh_lelong']}}</td>
@foreach($data as $data1)
<td>Tarikh Lelong :
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $data1['tarikh_lelong'] );
$datez = $myDateTime->format('d-m-Y');
echo($datez);
@endphp
</td>
@endforeach
</tr>
</table>
</div>
-1
View File
@@ -108,7 +108,6 @@ Route::group(['prefix'=>'lelong'], function () {
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('/lapbrglelongdetailsindex',['as'=>'lelong.lapbrglelongdetailsindex','uses'=>'LelongController@lapbrglelongdetailsindex']);