Merged in amirah-stokaudit (pull request #22)

combine laporan stokaudit (aktif dan tak aktif)
This commit is contained in:
nur amirah zulkipli
2024-01-18 06:44:26 +00:00
6 changed files with 539 additions and 0 deletions
+35
View File
@@ -1502,4 +1502,39 @@ class AkaunController extends Controller
// }
}
public function cetaklaporan_stokaudit_combine(Request $request){
$api_url = $request->hostname;
$auth_user = Auth::user();
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
if($request->datetimepicker1 == null){
$tebus_date = $current->toDateString();
}else{
$tebus_date = $request->datetimepicker1;
}
$cawangan=Http::get($api_url.'/api/cawangan/detail/'.$request->kodcaw)->json();
$cawangan_detail=$cawangan[0];
if(isset($request->jenis))
{
if($request->jenis == 'pdf')
{
$stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$pdf = PDF::loadView('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url'))->setPaper('a4', 'potrait');
return $pdf->download('laporan_stokaudit_' . $request->kodcaw .'_'. $tebus_date . '.pdf');
}
else{
$stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
$stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json();
return view('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
}
}
}
}
+7
View File
@@ -26,6 +26,13 @@
</router-link>
</div>
<div class="bg-white shadow border border-solid px-6 py-4 rounded-lg hover:bg-yellow-300 hover:transition-all mb-2 cursor-pointer">
<router-link to="/akaunhome/stokauditCombine">
<img src="/img/audit.png" class="h-20 w-20 mx-auto" alt="Windster Logo">
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Stok Audit Baru</h2>
</router-link>
</div>
<div class="bg-white shadow border border-solid px-6 py-4 rounded-lg hover:bg-yellow-300 hover:transition-all mb-2 cursor-pointer">
<router-link to="/akaunhome/kawalanstok">
<img src="/img/kawalanstok.png" class="h-20 w-30 mx-auto" alt="Windster Logo">
+123
View File
@@ -0,0 +1,123 @@
<template>
<div class="container">
<div class="flex w-full">
<div class="xl:w-2/3 2xl:w-1/2 p-8 mx-auto">
<div
class="bg-yellow-600 text-gray-200 text-lg px-6 py-4 rounded-t-lg"
>
<router-link to="/akaunhome">
<i class="fas fa-backspace text-white"></i>
</router-link>
<span class="text-center mx-auto text-white font-bold"
>Laporan Stok Audit</span
>
</div>
<form
method="get"
id="formstokaudit"
:action="Urlredirect()"
target="_blank"
>
<input :value="$kodcaw" name="kodcaw" hidden />
<div class="rounded bg-white shadow p-6">
<div class="pb-6">
<!-- <label for="username" class="font-semibold text-gray-700 block pb-1">Tarikh</label> -->
<div class="flex place-content-center mb-2">
<input
:value="jenisgenerate"
type="hidden"
name="jenis"
/>
<input
:value="$hostname"
name="hostname"
hidden
/>
<input :value="$kodcaw" name="kodcaw" hidden />
<span
style="background-color: #f9fafb"
class="text-gray-600 border border-2 rounded-l px-4 py-2 whitespace-no-wrap"
>Mula</span
>
<input
id="datetimepicker1"
name="datetimepicker1"
class="border border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2"
type="date"
/>
</div>
</div>
<div class="flex justify-end mt-10">
<button
@click.prevent="generatepdf"
class="mr-2 border border-yellow-600 text-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300"
>
<i class="fas fa-file-pdf mr-2"></i>PDF
</button>
<button
@click.prevent="generateview"
class="border border-yellow-600 text-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300"
>
<i class="fas fa-eye mr-2"></i>View
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</template>
<style>
.radio input:checked + label {
border-color: #f6d860;
background-color: #fff1bd;
outline: none;
}
</style>
<script>
export default {
data() {
return {
jenisgenerate: "none",
selected: "",
kodcaw: "",
};
},
methods: {
async generatepdf() {
await this.setJenis("pdf");
Vue.swal({
title: "Memuatkan...",
allowEscapeKey: false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formstokaudit").submit();
},
async generateview() {
await this.setJenis("view");
Vue.swal({
title: "Memuatkan...",
allowEscapeKey: false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formstokaudit").submit();
},
Urlredirect: function () {
return window.route("cetak.stokauditCombine");
},
setJenis: function (value) {
return (this.jenisgenerate = value);
},
},
};
</script>
+4
View File
@@ -29,6 +29,8 @@ import Online from './Akaun/Online'
import TuntutLelong from './Akaun/TuntutLelong'
import Dashboard from './Dashboard/index'
import BilanganPengadai from './Akaun/BilanganPengadai'
import StokAuditCombine from './Akaun/StokAuditCombine'
@@ -92,6 +94,8 @@ export default new VueRouter({
{ path: '/akaunhome/online', component: Online },
{ path: '/akaunhome/tuntutrugi', component: TuntutLelong },
{ path: '/akaunhome/BilanganPengadai', component: BilanganPengadai },
{ path: '/akaunhome/StokAuditCombine', component: StokAuditCombine },
@@ -0,0 +1,368 @@
<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;
}
</style>
<style>
#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;
}
</style>
<style>
#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;
}
</style>
<style>
#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</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', $tebus_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>
</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', $tebus_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>
+2
View File
@@ -116,6 +116,8 @@ Route::get('/akaunhome/cetakserahtebus',['as'=>'cetak.serahtebus','uses'=>'App\H
Route::get('/akaunhome/cetakonline',['as'=>'cetak.online','uses'=>'App\Http\Controllers\AkaunController@cetak_laporan_online'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);
Route::get('/akaunhome/cetaktuntutrugi',['as'=>'cetak.tuntutrugilelong','uses'=>'App\Http\Controllers\AkaunController@cetak_tuntutrugilelong'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);
Route::get('/akaunhome/cetakbilanganpengadai',['as'=>'cetak.bilpengadai','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_bilangan_pengadai'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);
Route::get('/akaunhome/cetakstokauditCombine',['as'=>'cetak.stokauditCombine','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_stokaudit_combine'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);