add report audit trail

This commit is contained in:
Amirah
2024-03-05 13:46:18 +08:00
parent 90bc9084cf
commit f56a061d2a
7 changed files with 453 additions and 0 deletions
+40
View File
@@ -1537,4 +1537,44 @@ class AkaunController extends Controller
} }
} }
} }
public function cetaklaporan_auditTrail(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){
$date = $current->toDateString();
}else{
$date = $request->datetimepicker1;
}
$cawangan=Http::get($api_url.'/api/cawangan/detail/'.$request->kodcaw)->json();
$cawangan_detail=$cawangan[0];
$audittrail = Http::get($api_url. '/api/laporanAuditTrail/',['tarikh' => $date,'kodcaw' => $cawangan_detail['kodcaw']])->json();
if(isset($request->jenis))
{
if($request->jenis == 'pdf')
{
$pdf = PDF::loadView('akaun.laporan_auditTrail', compact('audittrail','cawangan_detail','tarikh_cetak','date','api_url'))->setPaper('a4', 'potrait');
return $pdf->download('laporan_auditTrail_' . $cawangan_detail['kodcaw'] .'_'. $date . '.pdf');
}
else{
return view('akaun.laporan_auditTrail', compact('audittrail','cawangan_detail','tarikh_cetak','date','api_url'));
}
}
}
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

+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 Audit Trail</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.cetakAuditTrail");
},
setJenis: function (value) {
return (this.jenisgenerate = value);
},
},
};
</script>
+6
View File
@@ -39,6 +39,12 @@
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Stok Audit Combine</h2> <h2 class="mx-auto text-center font-bold text-2xl uppercase">Stok Audit Combine</h2>
</router-link> </router-link>
</div> </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/auditTrail">
<img src="/img/audittrail.png" class="h-20 w-20 mx-auto" alt="Windster Logo">
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Audit Trail</h2>
</router-link>
</div>
</div> </div>
+4
View File
@@ -30,6 +30,8 @@ import TuntutLelong from './Akaun/TuntutLelong'
import Dashboard from './Dashboard/index' import Dashboard from './Dashboard/index'
import BilanganPengadai from './Akaun/BilanganPengadai' import BilanganPengadai from './Akaun/BilanganPengadai'
import StokAuditCombine from './Akaun/StokAuditCombine' import StokAuditCombine from './Akaun/StokAuditCombine'
import AuditTrail from './Akaun/AuditTrail'
@@ -95,6 +97,8 @@ export default new VueRouter({
{ path: '/akaunhome/tuntutrugi', component: TuntutLelong }, { path: '/akaunhome/tuntutrugi', component: TuntutLelong },
{ path: '/akaunhome/BilanganPengadai', component: BilanganPengadai }, { path: '/akaunhome/BilanganPengadai', component: BilanganPengadai },
{ path: '/akaunhome/StokAuditCombine', component: StokAuditCombine }, { path: '/akaunhome/StokAuditCombine', component: StokAuditCombine },
{ path: '/akaunhome/AuditTrail', component: AuditTrail },
@@ -0,0 +1,279 @@
<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>
</tr>
<tr>
<td style="font-size:20px;font-weight:bold;">{{ $cawangan_detail['namacaw'] }}</td>
<td></td>
</tr>
</table>
<br>
<table id="scan">
<tr>
<th colspan="5"><b>LAPORAN AUDIT TRAIL</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>
<td style="width:20px"> <b>TARIKH:</b></td>
<td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate);
@endphp</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br>
<table id="details">
<tr>
<th>Bil</th>
<th>Tarikh</th>
<th>Masa</th>
<th>Teller</th>
<th>Pelulus</th>
<th>Act</th>
<th>Norujukan</th>
<th>Pinj. Lama</th>
<th>Pinjaman</th>
<th>Upah</th>
<th>Nota</th>
<th>Nokp</th>
<th>Norujukan Asal</th>
</tr>
@php $counter = 1; $totalamaun = 0; $jenis = ''; @endphp
@foreach($audittrail as $index=>$item)
<tr>
<td>{{ $counter }}</td>
<td>{{ $item['tarikh'] }}</td>
<td>{{ $item['masa'] }}</td>
<td>{{ $item['users'] }}</td>
<td>{{ $item['pelulus'] }}</td>
<td>{{ $item['actions'] }}</td>
<td>{{ $item['norujukan'] }}</td>
<td>{{ number_format($item['oldpinjaman'],2) }}</td>
<td>{{ number_format($item['newpinjaman'],2) }}</td>
<td>{{ number_format($item['newupah'],2) }}</td>
<td>{{ $item['nota'] }}</td>
<td>{{ $item['nokp'] }}</td>
<td>{{ $item['norujukanasal'] }}</td>
</tr>
@php $counter++;@endphp
@endforeach
</table>
<br><br>
<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
@@ -117,6 +117,7 @@ Route::get('/akaunhome/cetakonline',['as'=>'cetak.online','uses'=>'App\Http\Cont
Route::get('/akaunhome/cetaktuntutrugi',['as'=>'cetak.tuntutrugilelong','uses'=>'App\Http\Controllers\AkaunController@cetak_tuntutrugilelong'])->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/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']); Route::get('/akaunhome/cetakstokauditCombine',['as'=>'cetak.stokauditCombine','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_stokaudit_combine'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);
Route::get('/akaunhome/cetakAuditTrail',['as'=>'cetak.cetakAuditTrail','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_auditTrail'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']);