notis lelong

This commit is contained in:
Amirah22
2022-02-27 11:55:17 +08:00
parent 22307503c6
commit 2a5335340f
8 changed files with 356 additions and 61 deletions
+65 -34
View File
@@ -6,18 +6,17 @@ use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
use Illuminate\Support\Facades\Auth;
use Carbon\Carbon;
use App\Models\User;
use PDF;
use App\Models\Cawangan;
use App\Models\JenisEmas;
use App\Models\JenisKarat;
use App\Models\LelongBidder;
use App\Models\Lelong;
use App\Models\CawanganLelong;
use App\Models\LelongBid;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
use App\Models\LelKarat_temp;
use App\Models\Payment;
use App\Models\Resit;
class NotisController extends Controller
{
@@ -36,45 +35,77 @@ class NotisController extends Controller
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function notislelong()
{
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)->first();
$lelongbid = LelongBid::where('caw_id','=',$caw->id)->get();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
->first();
$lelongid = LelongBid::select('lelong_id')->where('caw_id','=',$caw->id)->groupBy('lelong_id')->get();
$lelong = Lelong::whereIn('id', $lelongid)->get();
$lelongbid = LelongBid::where('caw_id','=',$caw->id)
->get();
$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();
$lelong = Lelong::where('id', $lelongid)->get();
return view('jananotis.notislelong',compact('lelongbid','lelongid'));
}
public function senarainotis($lelong_id){
$lelong_id = $lelong_id;
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
->where('lelongbid.lelong_id', $lelong_id)
->get()->toArray();
return view('jananotis.senarainotis',compact('payment','lelong_id'));
return view('marhun.senaraimarhun',compact('lelongbid','lelong'));
}
public function jananotis($lelong_id){
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)
->first();
$lelong_id = $lelong_id;
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
// -join('customer','gadai.')
->where('lelongbid.lelong_id', $lelong_id)
->get()->toArray();
$lelongid = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
->join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
->where('cawangan.caw_code','=',$user->kodcaw)
->where('cawangan_lelong.lelong_id', $lelong_id)
->get();
$lelong = Lelong::where('id', $lelongid)->get();
// return view ('pdf.jananotis',compact('payment','lelong_id','lelongid','caw'));
$pdf = PDF::loadView('pdf.jananotis',compact('payment','lelong_id','lelongid','caw'))
->setPaper('a4', 'potrait');
return $pdf->download('Penjanaan Notis.pdf');
}
// public function exportmarhundetails(Request $request)
// {
// $lelongbid = LelongBid::where('id','=',$request->lelongbid)->first();
// $marhun = LelongBidMarhun::where('lelongbid_id','=',$request->lelongbid)->get();
// $karatall = JenisKarat::all();
// $emasall = JenisEmas::all();
// $pdf = PDF::loadView('pdf.marhundetails',compact('marhun',
// 'lelongbid',
// 'karatall',
// 'emasall'))->setPaper('a4', 'landscape');
// return $pdf->download('Senarai Lelong Details.pdf');
// }
}
+5 -22
View File
@@ -10,26 +10,13 @@ use Carbon\Carbon;
use App\Models\User;
use PDF;
use App\Models\Cawangan;
use App\Models\Gadai;
use App\Models\GadaiMarhun;
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\JenisEmas;
use App\Models\JenisKarat;
use App\Models\LelongBidder;
use App\Models\Lelong;
use App\Models\CawanganLelong;
use App\Models\LelongBid;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
use App\Models\Payment;
use App\Models\Resit;
class SerahanController extends Controller
{
@@ -57,14 +44,14 @@ class SerahanController extends Controller
->first();
$lelongbid = LelongBid::where('caw_id','=',$caw->id)
->get();
->get();
$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();
$lelong = Lelong::whereIn('id', $lelongid)->get();
$lelong = Lelong::where('id', $lelongid)->get();
return view('serahan.laporanserahan',compact('lelongbid','lelongid'));
}
@@ -218,11 +205,7 @@ class SerahanController extends Controller
return $pdf->download('Senarai Bidaan.pdf');
}
}
@@ -0,0 +1,46 @@
@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="senaraimarhun" 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>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->tarikh_lelong }}</td>
<td class="text-center">
<a href="{{ route('jananotis.jananotis',$bid->lelong_id) }}"><i class="fas fa-download"></i></a>
<a href="{{ route('jananotis.senarainotis',$bid->lelong_id) }}"><i class="far fa-edit"></i></a>
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,114 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
<table class="table table-striped table-xl text-center" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>No Rujukan</th>
<th>JBG</th>
<th>No KP</th>
<th>Pembiayaan</th>
<th>Keuntungan 6 Bulan</th>
<th>Bayaran Telah Dibuat</th>
</tr>
</thead>
<tbody>
@foreach($payment as $pay)
<tr>
<td> {{ $loop->iteration }} </td>
<td>{{ $pay['norujukan']}}</td>
<td>{{ $pay['jbg']}}</td>
<td>{{ $pay['nokp']}}</td>
<td>{{ $pay['pinjaman']}}</td>
<td>{{ $pay['bakiupah']}}</td>
<td></td>
{{-- join online_arrahn table (transaksi_keuntungan) --}}
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<script>
$('a.confirmdel').confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'orange',
typeAnimated: true,
buttons: {
Delete: {
btnClass: 'btn-warning',
action: function () {
location.href = this.$target.attr('href');
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
var tablesimulasi = $('#simulasi').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
order: [[1, 'asc']],
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
// 'copy', 'excel', 'pdf'
// { text: 'copy', className: 'btn btn-primary' },
{
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
text: '<i class="fas fa-plus" id="test"></i>',
titleAttr: 'Tambah Simulasi',
action: function ( e, dt, node, config ) {
alert( 'Button activated' );
}
},
{
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();
}
}
]
});
$('.addsim').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addsim').removeClass('dt-button');
$( '.export').removeClass('dt-button');
function selectall(cb) {
tablesimulasi.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
$(this).prop('checked', cb.checked);
})
}
</script>
@endsection
+112
View File
@@ -0,0 +1,112 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<style>
.letter{
font-family:'Times New Roman', Times, serif;
}
.row::after {
content: "";
clear: both;
display: table;
}
.first-prgph{
float: left;
width: 10%;
padding: 2px;
}
.first-prgph1{
float: left;
width: 30%;
padding-left: 50px;
}
.page-break {
page-break-before: always;
}
.name{
padding-top: 40px;
}
</style>
<body>
<div class = "letter">
@foreach ($payment as $notis)
<div class="row">
<div class="first-prgph">
<img src="http://lelongrpt.test/img/icon_pkb.png" alt="PKB LOGO" width="100" height="100">
</div>
<div class="first-prgph1">
<p> {{$caw['caw_name']}}<br>
{{$caw['alamat1']}}<br>
{{$caw['alamat2']}}<br>
No Tel: {{$caw['notel']}}<br>
No Faks: {{$caw['nofaks']}}
<p>
</div>
</div>
{{-- No Rujukan: {{$surat['norujukan']}}<br> --}}
No Rujukan:{{$notis['norujukan']}} <br>
Kepada: <br>
No Telefon: <br>
No K/P:
</p>
@foreach ($lelongid as $bid)
<p class="name"> Tuan/Puan, <br>
<b><h3>LELONGAN BARANGAN GADAIAN SECARA TENDER PADA {{ $bid->tarikh_lelong }}</h3></b>
@endforeach
<p>Dengan hormatnya kami ingin memaklumkan bahawa barang-barang cagaran tuan/puan yang digadai di cawangan seperti di atas akan dilelong.</p>
<p>Butiran lelongan adalah seperti berikut :-</p>
<p>Tarikh: <br>
Cawangan: <br>
Waktu:
</p>
<p>Tuan/Puan adalah dikehendaki untuk membuat urusan berikut <b>pada atau sebelum (tarikh):-</b></p>
<p>1. Tebus sepenuhnya <br>
2. Tebus gadai semula
<p>Pelanggan hanya perlu menjelaskan upah simpan sehingga sembilan (9) bulan sahaja.<br>
<i>*Permohonan tangguh lelong adalah tidak dibenarkan.</i></p>
<p>Notis:<br>
<i>Sila bawa bersama Surat Akuan Gadai(SAG) untuk sebarang urusan.</i><br>
<i>Sila abaikan notis ini sekiranya penebusan telah dibuat.</i><br></p>
<p>Surat ini adalah cetakan komputer dan tiada tandatangan diperlukan</p>
<div class="page-break"></div>
@endforeach
</div>
</body>
@@ -26,11 +26,10 @@
@foreach ($lelongid as $bid)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $bid->id }}"></td>
<td>{{ $bid->id }}</td>
<td>{{ $bid->lelong_id}}</td>
<td>{{ $bid->tarikh_lelong }}</td>
<td class="text-center">
<a href="{{ route('serahan.pembayaran',$bid->id) }}"><i class="far fa-edit"></i></a>
{{-- <a class="confirmdel" href="{{ route('marhun.delete',$bid->id) }}"><i class="far fa-trash-alt"></i></a> --}}
<a href="{{ route('serahan.pembayaran',$bid->lelong_id) }}"><i class="far fa-edit"></i></a>
</td>
</tr>
@endforeach
+8 -2
View File
@@ -14,9 +14,11 @@
<th>No Telefon</th>
<th>Bilangan Surat</th>
<th>Jumlah Bidaan(RM)</th>
<th>Penyata Bayaran</th>
{{-- <th>Penyata Bayaran</th> --}}
<th>Resit Bayaran</th>
<th>Barang Bidaan</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@@ -29,9 +31,13 @@
<td>{{ $pay['total_surat']}}</td>
<td>{{ $pay['totalBid']}}</td>
<td> <a href="{{ route('serahan.penyatabayaran',['user_id'=>$pay['details']['id'],'lelong_id'=>$lelong_id]) }}"><i class="fas fa-download"></i></a></td>
{{-- <td> <a href="{{ route('serahan.penyatabayaran',['user_id'=>$pay['details']['id'],'lelong_id'=>$lelong_id]) }}"><i class="fas fa-download"></i></a></td> --}}
<td> <a href="{{ route('serahan.resitpembayaran',['user_id'=>$pay['details']['id'],'lelong_id'=>$lelong_id]) }}"><i class="fas fa-download"></i></a></td>
<td> <a href="{{ route('serahan.senaraibid',['user_id'=>$pay['details']['id'],'lelong_id'=>$lelong_id]) }}"><i class="fas fa-download"></i></a></td>
<td class="text-center">
<a href=""><i class="far fa-edit"></i></a>
</td>
</tr>
@endforeach
</tbody>
+4
View File
@@ -158,5 +158,9 @@ Route::group(['middleware' => ['permission:pengesahanbayarancash'],'prefix'=>'pe
Route::group(['middleware' => ['permission:jananotis'],'prefix'=>'jananotis'], function () {
Route::get('/notislelong',['as'=>'jananotis.notislelong','uses'=>'NotisController@notislelong']);
Route::get('/senarainotis/{lelong_id}',['as'=>'jananotis.senarainotis','uses'=>'NotisController@senarainotis']);
Route::get('/jananotis/{lelong_id}',['as'=>'jananotis.jananotis','uses'=>'NotisController@jananotis']);
});