added laporan saghilang dalam admin

This commit is contained in:
Hafifie PKB
2025-01-14 11:56:24 +08:00
parent 49fa0a1d61
commit 6923efb66b
6 changed files with 452 additions and 1 deletions
+41
View File
@@ -1714,5 +1714,46 @@ class AkaunController extends Controller
} }
public function cetak_laporansaghilang(Request $request)
{
$api_url = $request->hostname;
$auth_user = Auth::user();
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
if($request->datemula == null){
$mula_date = '2017-01-01';
}else{
$mula_date = $request->datemula;
}
if($request->datehingga == null){
$hingga_date = $current->toDateString();
}else{
$hingga_date = $request->datehingga;
}
$polis = Http::get($request->hostname . '/api/polis/laporan/',['kodcaw' => $request->kodcaw, 'alasan' => $request->sltalasan, 'tarikh_mula' => $mula_date, 'tarikh_akhir' => $hingga_date])->json();
$cawangan_info = Http::get($request->hostname . '/api/cawangan/'. $request->kodcaw)->json();
$cawangan = Http::get($request->hostname . '/api/cawangan/detail/'. $request->kodcaw)->json();
$cawangan_detail=$cawangan[0];
if(isset($request->jenis))
{
if($request->jenis == 'pdf')
{
$pdf = PDF::loadView('akaun.laporan_saghilang', compact('polis','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'))->setPaper('a4', 'potrait');
return $pdf->download('laporan_saghilang_' . $request->kodcaw .'_'. $mula_date .'_'. $hingga_date . '.pdf');
}else{
return view('akaun.laporan_saghilang', compact('polis','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
}
}
return view('akaun.laporan_saghilang', compact('polis','cawangan_detail','mula_date','hingga_date','tarikh_cetak','api_url'));
}
} }
+6
View File
@@ -175,6 +175,12 @@
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Imbang Duga Backup</h2> <h2 class="mx-auto text-center font-bold text-2xl uppercase">Imbang Duga Backup</h2>
</router-link> </router-link>
</div> </div>
<div class="bg-white ml-2 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/saghilang">
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Sag Hilang</h2>
</router-link>
</div>
</div> </div>
</div> </div>
+125
View File
@@ -0,0 +1,125 @@
<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 Sag Hilang</span>
</div>
<form method="get" id="formringter" :action="Urlredirect()" target="_blank">
<div class="rounded bg-white shadow p-6">
<div class="pb-6">
<div class="flex justify-center mb-4">
<input :value="jenisgenerate" type="hidden" name="jenis" />
<input :value="$kodcaw" name="kodcaw" hidden/>
<input :value="$hostname" name="hostname" hidden/>
<span style="background-color: #F9FAFB" class="text-gray-600 border-2 rounded-l px-4 py-2 whitespace-no-wrap">Mula</span>
<input id="tarikhmula" name="datemula" class="border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2" type="date" min="2023-01-01" :max="maxDate"/>
<span style="background-color: #F9FAFB" class="text-gray-600 border-2 rounded-l px-4 py-2 whitespace-no-wrap">Hingga</span>
<input id="tarikhhingga" name="datehingga" class="border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2" type="date" min="2023-01-01" :max="maxDate"/>
</div>
<select name="sltalasan" v-model.trim="$v.selectedalasan.$model" class="w-full p-2 rounded-md border bg-white border-gray-400 focus:outline-none focus:ring-1 ring-cyan-500 uppercase">
<option value="" selected disabled hidden>Sila Pilih Alasan Anda Anda***</option>
<option v-for="(slt,i) in jenisalasan" :key="i" :value="slt.alasan">{{ slt.alasan }}</option>
<option value="all">Semua Alasan</option>
</select>
</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>
<script>
import {
required,
minLength,
between
} from 'vuelidate/lib/validators'
export default {
data(){
return{
jenisgenerate:'none',
kodcaw:'',
maxDate: null,
yesterday: null,
selectedalasan: '',
jenisalasan: {}
}
},
mounted() {
this.setMaxDate();
},
created() {
this.senaraiAlasan();
},
methods: {
setMaxDate() {
const today = new Date();
today.setDate(today.getDate() - 1);
this.yesterday = today.toISOString().split('T')[0];
this.maxDate = this.yesterday;
},
async generatepdf(){
await this.setJenis('pdf');
Vue.swal({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formringter").submit();
},
async generateview(){
await this.setJenis('view');
Vue.swal({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formringter").submit();
},
Urlredirect: function() {
return window.route('cetak.saghilang')
},
setJenis: function(value){
return this.jenisgenerate = value;
},
senaraiAlasan: function () {
this.axios.get(this.$hostname + '/api/lookupalasan').then(response => {
this.jenisalasan = response.data;
});
},
},
validations: {
selectedalasan: {
required
}
}
}
</script>
+2 -1
View File
@@ -33,7 +33,7 @@ import BilanganPengadai from './Akaun/BilanganPengadai'
import StokAuditCombine from './Akaun/StokAuditCombine' import StokAuditCombine from './Akaun/StokAuditCombine'
import AuditTrail from './Akaun/AuditTrail' import AuditTrail from './Akaun/AuditTrail'
import ImbangDugaBackup from './Akaun/ImbangDugaBackup.vue' import ImbangDugaBackup from './Akaun/ImbangDugaBackup.vue'
import SagHilang from './Akaun/SagHilang.vue'
@@ -102,6 +102,7 @@ export default new VueRouter({
{ path: '/akaunhome/StokAuditCombine', component: StokAuditCombine }, { path: '/akaunhome/StokAuditCombine', component: StokAuditCombine },
{ path: '/akaunhome/AuditTrail', component: AuditTrail }, { path: '/akaunhome/AuditTrail', component: AuditTrail },
{ path: '/akaunhome/imbangdugabackup', component: ImbangDugaBackup }, { path: '/akaunhome/imbangdugabackup', component: ImbangDugaBackup },
{ path: '/akaunhome/saghilang', component: SagHilang },
@@ -0,0 +1,277 @@
<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:8px;
}
#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;
}
@media print {
.new-page {
page-break-before: always;
}
}
</style>
<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 style="font-size:20px;font-weight:bold;">{{ $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 SAG HILANG</b></th>
<th> </th>
<th> </th>
<th></th>
</tr>
<tr>
<th colspan="5"><b> TARIKH CETAK:</b>
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate);
@endphp
</th>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
{{-- <th style="width:20px"> <b>TARIKH:</b></th>
<th>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $mula_date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate);
@endphp</th>
<th style="width:20px"> <b>HINGGA:</b></th>
<th>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $hingga_date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate);
@endphp</th> --}}
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br>
<table id="details">
<tr>
<th>Bil</th>
<th>Norujukan</th>
<th>Alasan</th>
<th>PC/PPC</th>
<th>Daerah</th>
<th>Negeri</th>
</tr>
@foreach($polis as $index=>$sh)
<tr>
<td>{{ $loop->iteration}}</td>
<td> {{ $sh['norujukan'] }}</td>
<td> {{ $sh['komen1'] }}</td>
<td> {{ $sh['teller'] }}</td>
@php
$koddaerah = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/daerah/' .$sh['koddaerah'] )->json();
$kodnegeri = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/negeri/' .$sh['kodnegeri'] )->json();
@endphp
<td> {{ $koddaerah['namadaerah'] }}</td>
<td> {{ $kodnegeri['negeri'] }}</td>
</tr>
@endforeach
</table>
<br><br>
{{-- <table id="details" style="border-top:1px solid black;border-bottom:1px solid black;text-align:center;">
<tr>
<td colspan="3" style="text-align: center;"><b>JUMLAH {{ $jenis }}</b></td>
<td style="text-align:center">{{ 'RM ' . number_format($totalamaun,2) }}</td>
</tr>
</table> --}}
<br>
<br><br><br>
<table id="sign">
<tr>
<td></td>
<td colspan="2"> .................................................................. </td>
<td> </td>
<td colspan="2"> .................................................................. </td>
<td> </td>
<td colspan="2">.................................................................. </td>
<td> </td>
</tr>
<tr>
<td></td>
<td colspan="2"><B> Disediakan </B> </td>
<td></td>
<td colspan="2"><B> Disemak </B> </td>
<td> </td>
<td colspan="2"><B> Disahkan </B></td>
<td> </td>
</tr>
</table>
+1
View File
@@ -128,6 +128,7 @@ Route::get('/akaunhome/cetakAuditTrail',['as'=>'cetak.cetakAuditTrail','uses'=>'
Route::get('/akaunhome/cetakAnsuranRangeDate',['as'=>'cetak.ansuranRangeDate','uses'=>'App\Http\Controllers\AkaunController@cetakLaporanAnsuranRangeDate'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); Route::get('/akaunhome/cetakAnsuranRangeDate',['as'=>'cetak.ansuranRangeDate','uses'=>'App\Http\Controllers\AkaunController@cetakLaporanAnsuranRangeDate'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);
Route::get('/akaunhome/cetakpenebusanRangeDate',['as'=>'cetak.penebusanRangeDate','uses'=>'App\Http\Controllers\AkaunController@cetakLaporanPenebusanRangeDate'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); Route::get('/akaunhome/cetakpenebusanRangeDate',['as'=>'cetak.penebusanRangeDate','uses'=>'App\Http\Controllers\AkaunController@cetakLaporanPenebusanRangeDate'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);
Route::get('/akaunhome/imbangdugabackup',['as'=>'cetak.imbangdugabackup','uses'=>'App\Http\Controllers\AkaunController@cetak_imbangdugaharian'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); Route::get('/akaunhome/imbangdugabackup',['as'=>'cetak.imbangdugabackup','uses'=>'App\Http\Controllers\AkaunController@cetak_imbangdugaharian'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);
Route::get('/akaunhome/cetak_saghilang',['as'=>'cetak.saghilang','uses'=>'App\Http\Controllers\AkaunController@cetak_laporansaghilang'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);