Merge branch 'amirah' into 'main'

new update

See merge request online-sistem1/lelong!60
This commit is contained in:
Nur Izzati Zulkifli
2022-06-13 08:44:35 +00:00
10 changed files with 371 additions and 8 deletions
+7
View File
@@ -55,9 +55,15 @@ class NotisController extends Controller
public function senarainotis($lelong_id){
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
->first();
$lelong_id = $lelong_id;
$senarai = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
->where('gadai.kodcaw','=',$user->kodcaw)
->where('lelongbid.lelong_id', $lelong_id)
->get()->toArray();
@@ -121,6 +127,7 @@ class NotisController extends Controller
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
->join('customer','gadai.nokp','=','customer.kpbaru')
->where('gadai.kodcaw','=',$user->kodcaw)
->where('lelongbid.lelong_id', $lelong_id)
->get()->toArray();
@@ -0,0 +1,117 @@
<?php
namespace App\Http\Controllers;
use App\Events\LelongNotify;
use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
use Illuminate\Support\Facades\Auth;
use PDF;
use App\Models\User;
use App\Models\Cawangan;
use App\Models\Gadai;
use App\Models\JenisEmas;
use App\Models\JenisKarat;
use App\Models\Simulasi;
use App\Models\SimulasiBid;
use App\Models\SimulasiBidMarhun;
use App\Models\SimKarat;
use App\Models\SimKarat_temp;
use App\Models\CawanganSimulasi;
use App\Models\Lelong;
use App\Models\CawanganLelong;
use App\Models\LelongBid;
use App\Models\LelongBidder;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
use App\Models\LelKarat_temp;
use App\Models\Resit;
use Carbon\Carbon;
class ReportCawanganController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
// Laporan by cawangan
public function laporancawindex(request $request)
{
$user = Auth::user();
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('cawangan.caw_code','=',$user->kodcaw)
->get();
return view('lelong.laporancawindex',compact('lelongid'));
}
public function laporanbrglelcaw($lelong_id){
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
->first();
$brglelongcaw = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
->where('lelongbid.lelong_id', $lelong_id)
->where('gadai.kodcaw','=',$user['kodcaw'])
->get()->toArray();
$keuntungan=0;
$total_hargaasas = 0;
$total_berat = 0;
foreach($brglelongcaw as $index1=>$upah)
{
$total_hargaasas = $total_hargaasas + $upah['hargaasas'];
$total_berat = $total_berat + $upah['berat'];
}
$info = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id')
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('cawangan_lelong.lelong_id','=',$lelong_id)
->where('cawangan.caw_code','=',$user['kodcaw'])
->select('lelong_id','tarikh_lelong','caw_name')
->groupBy('lelong_id','caw_name')
->get()->toArray();
$pdf = PDF::loadView('pdf.brglelcaw',compact('brglelongcaw','lelong_id','keuntungan','total_hargaasas','total_berat','info'))
->setPaper('a4', 'potrait');
return $pdf->download('Senarai Barang Lelong.pdf');
}
}
+9 -5
View File
@@ -52,7 +52,7 @@ class ReportController extends Controller
public function lapbrglelongindex (Request $request){
public function lapbrglelongindex (){
$arraydetails = [];
@@ -120,7 +120,7 @@ class ReportController extends Controller
return $pdf->download('Senarai Barang Lelong.pdf');
}
public function lapbrglelongdetailsindex (Request $request){
public function lapbrglelongdetailsindex (){
$arraydetails = [];
@@ -193,7 +193,7 @@ class ReportController extends Controller
}
public function lapbidaanpembidaindex (Request $request){
public function lapbidaanpembidaindex (){
$arraydetails = [];
@@ -270,7 +270,7 @@ class ReportController extends Controller
}
Public function laplelongindex (Request $request){
Public function laplelongindex (){
$arraydetails =[];
@@ -354,7 +354,7 @@ class ReportController extends Controller
Public function lapbrglelpembidaindex (Request $request){
Public function lapbrglelpembidaindex (){
$arraydetails = [];
@@ -423,6 +423,10 @@ class ReportController extends Controller
return $pdf->download('Laporan Barang Lelong Pembida.pdf');
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 266 KiB

@@ -98,6 +98,18 @@
<li class="{{ ( request()->is('pembayaran/kaunter/*')) ? 'active' : '' }}">
<a href="{{url('pembayaran/SenaraiLelongBayar')}}">Pembayaran Pemenang</a>
</li>
{{-- laporan --}}
<li class="{{ (request()->is('report/')) ? 'active' : '' }}">
<a href="#reportSubmenu" data-toggle="collapse" aria-expanded="false" style="">Laporan</a>
<ul class="list-unstyled collapse {{ (request()->is('reportcaw/*')) ? 'show' : '' }}" id="reportSubmenu" >
<li class="{{ (request()->is('reportcaw/laporancawindex/*') || request()->is('reportcaw/laporancawindex') ) ? 'active' : '' }}">
<a href="{{url('reportcaw/laporancawindex')}}">Barang Lelong</a>
</li>
</ul>
</li>
{{-- end laporan --}}
@endhasrole
@hasrole('jurulelong')
<li class="{{ (request()->is('lelong/*')) ? 'active' : '' }}">
@@ -211,6 +223,7 @@
</li>
</ul>
</li>
{{-- end laporan --}}
@endhasrole
@@ -19,7 +19,7 @@
<th>Lelong ID</th>
<th>Cawangan</th>
<th>Tarikh Lelong</th>
<th class="text-center">Action</th>
<th class="text-center">Muat Turun</th>
</tr>
</thead>
<tbody>
@@ -19,7 +19,7 @@
<th>Lelong ID</th>
<th>Cawangan</th>
<th>Tarikh Lelong</th>
<th class="text-center">Action</th>
<th class="text-center">Muat Turun</th>
</tr>
</thead>
<tbody>
@@ -0,0 +1,72 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@foreach ($lelongid as $bid)
<h4 class="pt-3" style="margin-left:1%;">Laporan Barang Lelong: {{$bid->caw_name}} </h4>
@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>Bil</th>
<th>Lelong ID</th>
<th>Tarikh Lelong</th>
<th class="text-center">Muat Turun</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{$loop->iteration}}
<td>{{ $bid->lelong_id}}</td>
<td>{{ $bid->tarikh_lelong }}</td>
<td class="text-center">
<a href="{{ route('reportcaw.laporanbrglelcaw',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Senarai Nama Pembida" ><i class="fas fa-download"></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": 99999,
dom: 'Bfrtip',
});
</script>
@endsection
+143
View File
@@ -0,0 +1,143 @@
<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 BARANG LELONG</b></u></td>
</tr>
</table>
<table cellspacing="" cellpadding="5" text-align="left" border="0" height="25" align="left" id="sim">
<thead>
<br>
<tr>
@foreach ($info as $info)
<td>Lelong ID : {{$info['lelong_id']}}</td>
<td>Tarikh Lelong : {{$info['tarikh_lelong']}}
<td>Nama Cawangan : {{$info['caw_name']}}
@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="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($brglelongcaw as $brg)
<tr>
<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">{{ number_format($brg['berat'], 2, '.', ',') }}</td>
<td width="12%" align="center">{{ 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>
</tbody>
+8 -1
View File
@@ -308,10 +308,17 @@ Route::get('/laplelong/{lelong_id}',['as' =>'report.laplelong','uses'=>'ReportCo
Route::get('/lapbrglelpembidaindex',['as'=>'report.lapbrglelpembidaindex','uses'=>'ReportController@lapbrglelpembidaindex']);
Route::get('/lapbrglelpembida/{lelong_id}',['as'=>'report.lapbrglelpembida','uses'=>'ReportController@lapbrglelpembida']);
});
//Report
Route::group(['middleware' => ['permission:report'],'prefix'=>'reportcaw'], function () {
Route::get('laporancawindex',['as'=>'reportcaw.laporancawindex','uses'=>'ReportCawanganController@laporancawindex']);
Route::get('laporanbrglelcaw/{lelong_id}',['as'=>'reportcaw.laporanbrglelcaw','uses'=>'ReportCawanganController@laporanbrglelcaw']);
});