add laporan perubahan marhun

This commit is contained in:
nishaMuhd
2022-09-06 11:19:26 +08:00
parent 2744064552
commit 5d377f72ad
6 changed files with 354 additions and 4 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ class ReportAllController extends Controller
$brglel = LelongBid::join('cawangan_lelong','cawangan_lelong.caw_id','=','lelongbid.caw_id')
->join('lelongbidder','lelongbid.id','=','lelongbidder.lelongbid_id')
->select('lelongbid.id','lelongbid.berat','lelongbid.marhun','lelongbid.hargaasas','lelongbidder.hargabida','lelongbidder.status_bidder')
9 ->where('cawangan_lelong.caw_id','=',$cawlel->caw_id)
->where('cawangan_lelong.caw_id','=',$cawlel->caw_id)
->where('cawangan_lelong.lelong_id','=',$cawlel->lelong_id)
->get();
+59 -1
View File
@@ -32,6 +32,7 @@ use App\Models\LelKarat_temp;
use App\Models\Resit;
use App\Models\Customer;
use App\Models\LelongTebus;
use App\Models\Pengesahan;
use Carbon\Carbon;
@@ -749,7 +750,64 @@ class ReportController extends Controller
}
public function lapubahmarhunlelongindex (){
$arraydetails = [];
$laporan= Pengesahan::join('lelongbidmarhun','pengesahan.lelongbidmarhun_id','=','lelongbidmarhun.id')
->join('lelongbid','lelongbid.norujukan','=','pengesahan.norujukan')
->select('pengesahan.norujukan','pengesahan.lelong_id','lelongbid.caw_id','pengesahan.diminta_pada','pengesahan.disahkan_oleh','pengesahan.disahkan_pada','pengesahan.diminta_oleh','pengesahan.status','pengesahan.status_ubah','lelongbidmarhun.old_karat','lelongbidmarhun.karat','lelongbidmarhun.old_berat','lelongbidmarhun.berat','lelongbid.kodcaw','lelongbid.norujukan','lelongbid.lelong_id')
->whereNotNull('pengesahan.disahkan_oleh')
->orderBy('pengesahan.id')
->get()
->toArray();
foreach($laporan as $lap) //stop here 01.09.2022
{
$details = CawanganLelong ::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('lelong_id',$lap['lelong_id'])
->where('caw_id',$lap['caw_id'])
->distinct()
->orderBy('lelong_id')
->get()
->toArray();
array_push($arraydetails, ['lap' =>$lap,'details' =>$details]);
}
return view('marhun.ubahmarhun', compact('laporan','arraydetails'));
}
public function exportubahmarhun (){
$arraydetails = [];
$laporan= Pengesahan::join('lelongbidmarhun','pengesahan.lelongbidmarhun_id','=','lelongbidmarhun.id')
->join('lelongbid','lelongbid.norujukan','=','pengesahan.norujukan')
->select('pengesahan.norujukan','pengesahan.lelong_id','lelongbid.caw_id','pengesahan.diminta_pada','pengesahan.disahkan_oleh','pengesahan.disahkan_pada','pengesahan.diminta_oleh','pengesahan.status','pengesahan.status_ubah','lelongbidmarhun.old_karat','lelongbidmarhun.karat','lelongbidmarhun.old_berat','lelongbidmarhun.berat','lelongbid.kodcaw','lelongbid.norujukan','lelongbid.lelong_id')
->whereNotNull('pengesahan.disahkan_oleh')
->orderBy('pengesahan.id')
->get()
->toArray();
foreach($laporan as $lap) //stop here 01.09.2022
{
$details = CawanganLelong ::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('lelong_id',$lap['lelong_id'])
->where('caw_id',$lap['caw_id'])
->distinct()
->orderBy('lelong_id')
->get()
->toArray();
array_push($arraydetails, ['lap' =>$lap,'details' =>$details]);
}
$pdf = PDF::loadView('pdf.listubahmarhun',compact('laporan','arraydetails'))
->setPaper('a4', 'landscape');
return $pdf->download('Senarai Perubahan Marhun.pdf');
}
@@ -340,6 +340,11 @@
<a href="{{url('report/lapbrglelongdetailsindex')}}">Butiran Barang Lelong</a>
</li>
</ul>
<ul class="list-unstyled collapse {{ (request()->is('report/*')) ? 'show' : '' }}" id="reportSubmenu" >
<li class="{{ (request()->is('report/lapubahmarhunlelongindex/*') || request()->is('report/lapubahmarhunlelongindex') ) ? 'active' : '' }}">
<a href="{{url('report/lapubahmarhunlelongindex')}}">Perubahan Marhun</a>
</li>
</ul>
<ul class="list-unstyled collapse {{ (request()->is('report/*')) ? 'show' : '' }}" id="reportSubmenu" >
<li class="{{ (request()->is('report/lapbidaanpembidaindex/*') || request()->is('report/lapbidaanpembidaindex') ) ? 'active' : '' }}">
<a href="{{url('report/lapbidaanpembidaindex')}}">Nama Pembida</a>
+159
View File
@@ -0,0 +1,159 @@
@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('report.exportubahmarhun')}}" method="POST">
@csrf
<h4> Senarai Perubahan Marhun </h4>
<table class="table table-striped table-xl text-center" id="senaraiubahmarhun" style="width:100%">
<thead class="bg-primary text-white">
<!--<tr>
<th width="5%" align="left"></th>
<th width="25%" align="left"></th>
<th width="5%" align="left"></th>
<th width="25%" align="left"></th>
<th width="25%" align="left" colspan='4'>Maklumat Marhun</th>
<th width="25%" align="left">Marhun Asal</th>
<th width="25%" align="left">Marhun Ubah</th>
<th width="25%" align="left">Marhun Ubah</th>
<th width="25%" align="left"></th>
<th width="25%" align="left"></th>
</tr>-->
<tr>
<th width="5%" align="left">No</th>
<th width="25%" align="left">Cawangan</th>
<th width="5%" align="left">Lelong ID</th>
<th width="25%" align="left">No Rujukan</th>
<th width="5%" align="left">Karat Asal</th>
<th width="5%" align="left">Karat Baru</th>
<th width="5%" align="left">Berat Asal</th>
<th width="5%" align="left">Berat Baru</th>
<th width="15%" align="left">Tarikh Mohon</th>
<th width="15%" align="left">Tarikh Disahkan</th>
</tr>
</thead>
<tbody>
@foreach ($arraydetails as $info)
<tr>
<td width="5%" align="center">{{ $loop->iteration }} </td>
@foreach($info['details'] as $details)
<td width="14%" align="center">{{ $details['caw_name'] }}</td>
@endforeach
<td width="14%" align="center">{{ $info['lap']['lelong_id'] }}</td>
<td width="14%" align="center">{{ $info['lap']['norujukan'] }}</td>
<td width="17%" align="center">{{ $info['lap']['old_karat'] }}</td>
<td width="17%" align="center">{{ $info['lap']['karat'] }}</td>
<td width="17%" align="center">{{ number_format($info['lap']['old_berat'], 2, '.', ',') }}</td>
<td width="17%" align="center">{{ number_format($info['lap']['berat'], 2, '.', ',') }}</td>
<td width="17%" align="center">{{ $info['lap']['diminta_pada'] }}</td>
<td width="17%" align="center">{{ $info['lap']['disahkan_pada'] }}</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
var tablesenarailelongonline = $('#senarailelongonline').DataTable({
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 3,
"orderable": false
}
],
order: [[1, 'asc']],
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
// buttons: [
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
// text: '<i class="fas fa-plus" id="test"></i>',
// titleAttr: 'Tambah Cawangan',
// action: function ( e, dt, node, config ) {
// // alert( 'Button activated' );
// // console.log('hye');
// $('#myModal').modal("show");
// $('#myModal').on('shown.bs.modal', function () {
// $('#rolename').trigger('focus')
// })
// }
// },
// {
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
// titleAttr: 'Export to CSV',
// text: '<i class="fas fa-download"></i>',
// action: function ( e, dt, node, config ) {
// $("#exportform").submit();
// }
// }
// ]
});
// $('.addcaw').tooltip();
// $('.export').tooltip();
// // $( '.dt-buttons').addClass('btn-group');
// $( '.addcaw').removeClass('dt-button');
// $( '.export').removeClass('dt-button');
var tableubah = $('#senaraiubahmarhun').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
}
],
order: [[0, 'asc']],
// "ordering": false,
"searching":false,
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
{
className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export',
titleAttr: 'Muat Turun PDF',
text: '<h8><b>PDF</b></h8>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
}
}
]
});
$('.addsim').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addsim').removeClass('dt-button');
$( '.export').removeClass('dt-button');
</script>
@endsection
@@ -0,0 +1,128 @@
<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;
}
</style>
<body>
<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 PERUBAHAN MARHUN</b></u></td>
</tr>
</table>
<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="20%" align="left">Cawangan</th>
<th width="5%" align="left">Lelong ID</th>
<th width="15%" align="left">No Rujukan</th>
<th width="7%" align="left">Karat Asal</th>
<th width="7%" align="left">Karat Baru</th>
<th width="7%" align="left">Berat Asal</th>
<th width="7%" align="left">Berat Baru</th>
<th width="13%" align="left">Tarikh Mohon</th>
<th width="14%" align="left">Tarikh Disahkan</th>
</tr>
</thead>
<tbody>
@foreach ($arraydetails as $info)
<tr>
<td width="5%" align="center">{{ $loop->iteration }} </td>
@foreach($info['details'] as $details)
<td width="20%" align="center">{{ $details['caw_name'] }}</td>
@endforeach
<td width="5%" align="center">{{ $info['lap']['lelong_id'] }}</td>
<td width="15%" align="center">{{ $info['lap']['norujukan'] }}</td>
<td width="7%" align="center">{{ $info['lap']['old_karat'] }}</td>
<td width="7%" align="center">{{ $info['lap']['karat'] }}</td>
<td width="7%" align="center">{{ number_format($info['lap']['old_berat'], 2, '.', ',') }}</td>
<td width="7%" align="center">{{ number_format($info['lap']['berat'], 2, '.', ',') }}</td>
<td width="13%" align="center">{{ $info['lap']['diminta_pada'] }}</td>
<td width="14%" align="center">{{ $info['lap']['disahkan_pada'] }}</td>
</tr>
@endforeach
</tbody>
+2 -2
View File
@@ -414,8 +414,8 @@ Route::get('/simulasireport/{simulasi_id}/{cawid}',['as'=>'report.simulasireport
Route::get('/lelongreport/{lelongid}/{cawid}',['as'=>'report.lelongreport','uses'=>'ReportController@lelongreport']);
Route::get('/lapubahmarhunlelongindex',['as'=>'report.lapubahmarhunlelongindex','uses'=>'ReportController@lapubahmarhunlelongindex']);
Route::post('/export',['as'=>'report.exportubahmarhun','uses'=>'ReportController@exportubahmarhun']);
});