Merged in stokaudit-cherry-pick (pull request #101)

Merge cherry-pick combine laporan stokaudit aktif, tak aktif
This commit is contained in:
Amir Hassan Hamzan
2024-01-18 05:55:41 +00:00
5 changed files with 539 additions and 7 deletions
+35 -6
View File
@@ -4287,7 +4287,41 @@ class KhazanahController extends Controller
return view('print.laporan_imbangduga-akru',compact('tarikh_imbangan', 'tarikh_imbangan2','hartasemasa','tanggungansemasa','totalhartasemasa','totaltanggungansemasa','tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail'));
}
public function laporanStokAuditCombine(){
$auth_user = Auth::user();
$api_url = config('api.url');
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/gadai/cawangan/'. $auth_user['cawangan'])->json();
return view('khazanah.laporan.stokauditcombine',compact('cawangan_info','api_url'));
}
public function cetakLaporanStokAuditCombine(Request $request){
$api_url = config('api.url');
$auth_user = Auth::user();
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
if($request->datetimepicker1 == null){
$stokaudit_date = $current->toDateString();
}else{
$split_date = explode('-',$request->datetimepicker1);
$stokaudit_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0];
$stokaudit_aktif = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokaudit/aktif/'. $auth_user['cawangan'],['tarikh' => $stokaudit_date])->json();
$stokaudit_takaktif = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokaudit/takaktif/'. $auth_user['cawangan'],['tarikh' => $stokaudit_date])->json();
// return view('print.laporan_stokauditbelumaktif', compact('stokaudit','cawangan_detail','tarikh_cetak','stokaudit_date','api_url'));
return view('print.laporan_stokauditcombine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','stokaudit_date','api_url'));
}
public function laporanGadaianUjrah (){
@@ -4601,9 +4635,4 @@ class KhazanahController extends Controller
return view('callcenter.khazanah.bycawdetailnotisperingatan',compact('cawangan_info','bycawnotisperingatan','kodcaw','notisid','api_url'));
}
}
@@ -108,8 +108,11 @@
<div class="row">
<a href="{{ route('laporan.ansuran') }}" class="btn btn-dark btn-lg btn-block mb-3">Ansuran</a>
</div>
<div class="row">
{{-- <div class="row">
<a href="{{ route('laporan.stokaudit') }}" class="btn btn-dark btn-lg btn-block mb-3">Stok Audit</a>
</div> --}}
<div class="row">
<a href="{{ route('laporan.stokauditcombine') }}" class="btn btn-dark btn-lg btn-block mb-3">Stok Audit</a>
</div>
<div class="row">
<a href="{{ route('laporan.ringkasanharian') }}" class="btn btn-dark btn-lg btn-block mb-3">Ringkasan Harian</a>
@@ -0,0 +1,120 @@
@extends('layouts.app')
<style>
.radiostyle .radio-green {
background-color: #27ae60;
color:white;
box-shadow: 5px 10px #888888;
width:200px;
margin-right:5px;
transition: 0.5s ease;
}
.radiostyle .radio-red {
background-color: #e74c3c;
color:white;
width:200px;
margin-right:5px;
box-shadow: 5px 10px #888888;
transition: 0.5s ease;
}
.radiostyle .radio-yellow {
background-color: #3498db;
color:white;
width:200px;
margin-right:5px;
box-shadow: 5px 10px #888888;
transition: 0.5s ease;
}
.radiostyle .radio-green:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-red:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-yellow:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-green input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
.radiostyle .radio-yellow input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
.radiostyle .radio-red input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
</style>
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="card">
<nav aria-label="breadcrumb">
<ol class="breadcrumb pb-3">
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
<li class="breadcrumb-item"><a href="{{ route('laporan') }}">Laporan</a></li>
<li class="breadcrumb-item active" aria-current="page">Stok Audit</li>
</ol>
</nav>
<div class="card-body text-center">
<div class="row form-group">
<div class="col-md-2">
</div>
<div class="col-md-10">
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-5 mx-auto">
<form action="{{ route('stokauditcombine.laporancetak') }}" target="_blank" method="get">
@csrf
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetimepicker1" name="datetimepicker1" aria-describedby="basic-addon1">
<input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak">
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var tablecustomers = $('#myTable').DataTable({
"ordering": false
});
$(document).ready( function () {
$('#datetimepicker1').datepicker({
format: 'dd-mm-yyyy'
});
});
</script>
@endsection
@@ -0,0 +1,377 @@
<style>
#header {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#header td,
#customers th {
padding: 4px;
font-size: 10px;
}
#header tr:nth-child(even) {
background-color: #ffffff;
}
#header tr:hover {
background-color: #ddd;
}
#header th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding: 4px;
color: black;
}
#scan {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#scan td,
#scan th {
padding: 8px;
font-size: 11px;
}
#scan tr:nth-child(even) {
background-color: #ffffff;
}
#scan tr:hover {
background-color: #ddd;
}
#scan th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding: 4px;
color: black;
}
</style>
<style>
#scan {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#scan td,
#scan th {
border-collapse: collapse;
padding: 8px;
font-size: 11px;
}
#scan tr:nth-child(even) {
background-color: #ffffff;
}
#scan tr:hover {
background-color: #ddd;
}
#scan th {
border-collapse: collapse;
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding: 4px;
color: black;
}
#details {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#details td,
#details th {
padding: 8px;
font-size: 11px;
}
#details tr:nth-child(even) {
background-color: #ffffff;
}
#details tr:hover {
background-color: #ddd;
}
#details th {
padding-top: 12px;
font-style: bold;
padding-bottom: 12px;
text-align: left;
padding: 4px;
color: black;
}
#sign {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#sign td,
#sign th {
padding: 8px;
font-size: 11px;
text-align: center;
}
#sign tr:nth-child(even) {
background-color: #ffffff;
}
#sign tr:hover {
background-color: #ddd;
}
#sign th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding: 4px;
color: black;
}
.page-break {
page-break-before: always;
}
</style>
<div>
<table id="header">
<tr>
<th rowspan="4" style="width:50px"><br><img src="{{ asset('img/ARRAHN1.png') }}" style="width:70px"></img>
</th>
<th colspan="1">KOPERASI PERMODALAN KELANTAN BERHAD</th>
</tr>
<tr>
<td>{{ $cawangan_detail['namacaw'] }}</td>
<td></td>
</tr>
<tr>
<td>{{ $cawangan_detail['alamat1'] }}</td>
<td></td>
</tr>
<tr>
<td>{{ $cawangan_detail['alamat2'].' No Tel : '. $cawangan_detail['notel'].' No Faks : '.
$cawangan_detail['nofaks'] }}</td>
<td></td>
</tr>
</table>
<br>
<table id="scan">
<tr>
<th colspan="5"><b>Laporan Stok Audit Aktif</b></th>
<th> </th>
<th> </th>
<th><b> Tarikh Cetak:</b>
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp
</th>
<th></th>
</tr>
<tr>
<td style="width:10px"> <b>TARIKH</b></td>
<td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $stokaudit_date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp</td>
<td style="width:50px">
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br>
<table id="details">
<thead>
<th>Bil</th>
<th>Norujukan</th>
<th>JBG</th>
<th>No. KP</th>
<th>Berat</th>
<th>Nilai Marhun (RM)</th>
<th>Pembiayaan Asal (RM)</th>
<th>Baki Pembiayaan (RM)</th>
<th>Kadar Upah</th>
<th>Tempoh Belum Bayar</th>
<th>Keuntungan Belum Bayar (RM)</th>
<th>Lanjutan</th>
</thead>
@php $counter = 1;$totalpinjaman = 0; @endphp
@foreach($stokaudit_aktif['rekod'] as $index=>$item)
@php if($item['hargajualan'] == null) $totalpinjaman += $item['pinjaman']; else $totalpinjaman +=
$item['bakipjm'];
@endphp
<tr>
<td>{{ $counter }}</td>
<td>{{$item['norujukan']}}</td>
<td>{{ $item['tempoh'] }}</td>
<td>{{$item['nokp']}}</td>
<td>{{ number_format($item['berat'],2) }}</td>
<td>{{ number_format($item['nilaimarhun'],2) }}</td>
<td>{{ number_format($item['pinjaman'],2) }}</td>
<td>{{ number_format($item['bakipjm'],2) }}</td>
<td>{{ number_format($item['kadarupah'],2) }}</td>
<td>{{ number_format($item['tempoh'] - $item['tempohbayar'],2) }}</td>
<td>{{ number_format($item['tunggakan'],2) }}</td>
{{-- <td>{{ number_format($item['pinjaman'],2) }}</td> --}}
<td>{{$item['lelong_tawarruq']}}</td>
</tr>
@php $counter++; @endphp
@endforeach
<tfoot>
<th colspan='4'>Jumlah</th>
<th>{{ number_format($stokaudit_aktif['totalberat'],2) }}</th>
<th>{{ number_format($stokaudit_aktif['totalnilaimarhun'],2) }}</th>
<th>{{ number_format($stokaudit_aktif['totalpinjaman'],2) }}</th>
<th>{{ number_format($stokaudit_aktif['totalbakipjm'],2) }}</th>
<th></th>
<th></th>
<th>{{ number_format($stokaudit_aktif['totaltunggakan'],2) }}</th>
<th></th>
</tfoot>
</table>
<br>
<br>
{{-- <table id="sign">
<tr>
<td></td>
<td colspan="2"> .................................................................. </td>
<td> </td>
<td colspan="2">.................................................................. </td>
<td> </td>
</tr>
<tr>
<td></td>
<td colspan="2"><B> DI SEMAK</B> </td>
<td> </td>
<td colspan="2"><B>DI SAHKAN </B></td>
<td> </td>
</tr>
</table> --}}
</div>
<div class="page-break"></div>
<div>
<table id="scan">
<tr>
<th colspan="5"><b>Laporan Stok Audit Tidak Aktif</b></th>
<th> </th>
<th> </th>
<th><b> Tarikh Cetak:</b>
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp
</th>
<th></th>
</tr>
<tr>
<td style="width:10px"> <b>TARIKH</b></td>
<td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $stokaudit_date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp</td>
<td style="width:50px">
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br>
<table id="details">
<thead>
<th>Bil</th>
<th>Norujukan</th>
<th>JBG</th>
<th>No. KP</th>
<th>Berat</th>
<th>Nilai Marhun (RM)</th>
<th>Pembiayaan</th>
<th>Lanjutan</th>
</thead>
@php $counter = 1;$totalpinjaman = 0; @endphp
@foreach($stokaudit_takaktif['rekod'] as $index=>$item)
@php if($item['hargajualan'] == null) $totalpinjaman += $item['pinjaman']; else $totalpinjaman +=
$item['bakipjm'];
@endphp
<tr>
<td>{{ $counter }}</td>
<td>{{$item['norujukan']}}</td>
<td>{{ $item['jbg'] }}</td>
<td>{{$item['nokp']}}</td>
<td>{{ number_format($item['berat'],2) }}</td>
<td>{{ number_format($item['nilaimarhun'],2) }}</td>
<td>@php if($item['hargajualan'] == null) echo number_format($item['pinjaman'],2); else echo
number_format($item['bakipjm'],2); @endphp</td>
<td>{{$item['lelong_tawarruq']}}</td>
</tr>
@php $counter++; @endphp
@endforeach
<tfoot>
<th colspan='4'>Jumlah</th>
<th>{{ number_format($stokaudit_takaktif['totalberat'],2) }}</th>
<th>{{ number_format($stokaudit_takaktif['totalnilaimarhun'],2) }}</th>
<th>{{ number_format($totalpinjaman,2) }}</th>
<th></th>
</tfoot>
</table>
<br>
<br>
<table id="sign">
<tr>
<td></td>
<td colspan="2"> .................................................................. </td>
<td> </td>
<td colspan="2">.................................................................. </td>
<td> </td>
</tr>
<tr>
<td></td>
<td colspan="2"><B> DI SEMAK</B> </td>
<td> </td>
<td colspan="2"><B>DI SAHKAN </B></td>
<td> </td>
</tr>
</table>
</div>
+3
View File
@@ -293,6 +293,9 @@ Route::post('laporan/rekodblastexport',['as'=>'stokaudit.rekodblastexport','uses
Route::get('laporan/rekodblastsms',['as'=>'stokaudit.rekodblastsms','uses'=>'KhazanahController@rekodblastsms'])->middleware('auth','khazanah');
Route::post('laporan/rekodblastsmsexport',['as'=>'stokaudit.rekodblastsmsexport','uses'=>'KhazanahController@rekodblastsmsexport'])->middleware('auth','khazanah');
Route::get('/laporan/stokauditcombine',['as'=>'laporan.stokauditcombine','uses'=>'KhazanahController@laporanStokAuditCombine'])->middleware('auth','khazanah');
Route::get('laporan/stokauditcombine/cetak',['as'=>'stokauditcombine.laporancetak','uses'=>'KhazanahController@cetakLaporanStokAuditCombine'])->middleware('auth','khazanah');
//Resit Ansurans
Route::get('/resit/{id}',['as'=>'resit.ansuran','uses'=>'GadaianController@resit'])->middleware('auth','teller');
Route::get('/resitansurans/{id}',['as'=>'resit.ansurans','uses'=>'GadaianController@resitansurans'])->middleware('auth','teller');