fix senarai backdate stokaudit

This commit is contained in:
hafifierahman
2022-05-31 00:29:22 +08:00
parent d0ba448b37
commit 877d3e5aec
8 changed files with 423 additions and 12 deletions
+49
View File
@@ -747,4 +747,53 @@ class AkaunController extends Controller
return view('akaun.laporan_ringkasanterkumpul', compact('laporan_ringkasan','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
}
public function cetakLaporanStokAuditBackdate(Request $request){
$api_url = $request->hostname;
$auth_user = Auth::user();
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
$split_date = explode('-',$request->datestokauditbackdate);
$bulan = $split_date[1];
$tahun = $split_date[0];
if($bulan == 1){
$namabulan = 'Januari';
}elseif($bulan == 2){
$namabulan = 'Februari';
}elseif($bulan == 3){
$namabulan = 'Mac';
}elseif($bulan == 4){
$namabulan = 'April';
}elseif($bulan == 5){
$namabulan = 'Mei';
}elseif($bulan == 6){
$namabulan = 'Jun';
}elseif($bulan == 7){
$namabulan = 'Julai';
}elseif($bulan == 8){
$namabulan = 'Ogos';
}elseif($bulan == 9){
$namabulan = 'September';
}elseif($bulan == 10){
$namabulan = 'Oktober';
}elseif($bulan == 11){
$namabulan = 'November';
}elseif($bulan == 12){
$namabulan = 'Disember';
}
$tebus_date = $namabulan . ' ' . $tahun;
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0];
$stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokaudit/backdate',['kodcaw' => $auth_user['cawangan'],'tahun'=>$tahun,'bulan'=>$bulan])->json();
return view('akaun.laporan_stokauditbackdate', compact('stokaudit','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
}
}
+13 -4
View File
@@ -84,12 +84,21 @@
</div>
</div>
<div class="w-2/3 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/RingkasanTerkumpul">
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Ringkasan Terkumpul</h2>
</router-link>
<div class="ml-3 grid grid-cols-3">
<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/RingkasanTerkumpul">
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Ringkasan Terkumpul</h2>
</router-link>
</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/StokAuditBackdate">
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Stok Audit Back-date</h2>
</router-link>
</div>
</div>
</div>
+83
View File
@@ -0,0 +1,83 @@
<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 Backdate</span>
</div>
<form method="get" id="formstokauditbackdate" :action="Urlredirect()" target="_blank">
<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">
<input :value="$kodcaw" name="kodcaw" hidden/>
<input :value="$hostname" name="hostname" hidden/>
<input :value="jenisgenerate" type="hidden" name="jenis" />
<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="tarikhmula" name="datestokauditbackdate" class="border border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2" type="date" />
<!-- <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>
</div>
</form>
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return{
jenisgenerate:'none',
kodcaw: ''
}
},
methods: {
// async generatepdf(){
// await this.setJenis('pdf');
// Vue.swal({
// title: 'Memuatkan...',
// allowEscapeKey : false,
// allowOutsideClick: false,
// showCancelButton: false,
// showConfirmButton: false,
// timer: 8000,
// });
// document.getElementById("formringkasanharian").submit();
// },
async generateview(){
await this.setJenis('view');
Vue.swal({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formstokauditbackdate").submit();
},
Urlredirect: function() {
return window.route('cetak.stokauditbackdate')
},
setJenis: function(value){
return this.jenisgenerate = value;
}
}
}
</script>
+2 -2
View File
@@ -346,7 +346,7 @@
<div v-else-if="(mohon.tagoperasi === 1 && mohon.tagakaun === 0)" class="ml-3">
<button @click="funcsetuju(mohon.mohonid)" class="border border-blue-600 text-blue-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-blue-600 hover:text-white transition-all duration-300">
<button @click="funcsetuju(mohon.nopermohonan)" class="border border-blue-600 text-blue-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-blue-600 hover:text-white transition-all duration-300">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
@@ -356,7 +356,7 @@
</button>
<button @click="funcbatal(mohon.mohonid)" class="border border-red-600 text-red-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-red-600 hover:text-white transition-all duration-300">
<button @click="funcbatal(mohon.nopermohonan)" class="border border-red-600 text-red-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-red-600 hover:text-white transition-all duration-300">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5" />
</svg>
+14 -6
View File
@@ -34,6 +34,7 @@
<label for="Batal" class="cursor-pointer text-gray-500 focus:bg-gray-500 hover:bg-gray-200 focus:bg-purple-500 focus:outline-none border px-10 py-4 border-solid border-gray-500 rounded">Tak Lulus</label>
</div>
</div>
<div class="text-red-500 text-xs italic flex justify-center" v-if="!$v.selected.required">Pilih keputusan!</div>
</div>
<div class="w-full flex">
@@ -49,8 +50,8 @@
Amaun Lulus
</label>
<input v-model.trim="$v.amaunlulus.$model" type="text" class="mr-2 bg-white appearance-none border-2 border-gray-400 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-blue-500 border-black" />
<div class="text-red-500 text-xs italic" v-if="!$v.amaunlulus.required">Field is required</div>
<div class="text-red-500 text-xs italic" v-if="!$v.amaunlulus.between">Must be between {{$v.amaunlulus.$params.between.min}} and {{$v.amaunlulus.$params.between.max}}</div>
<div class="text-red-500 text-xs italic" v-if="!$v.amaunlulus.required">Perlu ada dalam kotak</div>
<div class="text-red-500 text-xs italic" v-if="!$v.amaunlulus.between">Mestilah dalam lingkungan {{$v.amaunlulus.$params.between.min}} dan {{$v.amaunlulus.$params.between.max}}</div>
</div>
</div>
@@ -58,12 +59,12 @@
<div class="mb-3 w-96">
<!-- <label for="formFileLg" class="form-label inline-block mb-2 text-gray-700">Large file input example</label> -->
<input name="image" accept="image/*" @change="onUpload" class="form-control block w-full px-2 py-1.5 text-xl font-normal text-gray-700 bg-white bg-clip-padding border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none" type="file">
<div class="mx-auto flex justif">
<!-- <div class="mx-auto flex justif">
<img v-if="item.imageUrl" class="h-24 w-24 mx-auto justify-center" :src="item.imageUrl" />
</div>
</div> -->
<div class="text-red-500 text-xs italic" v-if="!$v.imageFile.required">File perlu ada!</div>
</div>
</div>
<div class="text-red-500 text-xs italic" v-if="!$v.imageFile.file_size_validation">File melebihi had!</div>
</div>
<!--footer-->
@@ -131,6 +132,9 @@ export default {
}
},
methods: {
testfunc: function (){
return 10000;
},
onUpload: function (e) {
const file = e.target.files[0]
this.item.image = file
@@ -190,7 +194,11 @@ export default {
validations: {
amaunlulus: {
required,
between: between(20, 30)
// between: between(30, 30000)
between (value) {
let amaun = parseInt(this.amaun_dimohon.replace(/,/g, ''), 10)
return between(0, amaun)(value)
}
},
imageFile: {
required,
+2
View File
@@ -16,6 +16,7 @@ import StokAudit from './Akaun/StokAudit'
import Perbelanjaan from './Akaun/Perbelanjaan'
import RingkasanHarian from './Akaun/RingkasanHarian'
import RingkasanTerkumpul from './Akaun/RingkasanTerkumpul'
import StokAuditBackdate from './Akaun/StokAuditBackdate'
@@ -53,6 +54,7 @@ export default new VueRouter({
{ path: '/akaunhome/Perbelanjaan', component: Perbelanjaan },
{ path: '/akaunhome/RingkasanHarian', component: RingkasanHarian },
{ path: '/akaunhome/RingkasanTerkumpul', component: RingkasanTerkumpul },
{ path: '/akaunhome/StokAuditBackdate', component: StokAuditBackdate },
{ path: '/bajet/kemaskini', component: SenaraiBajet },
@@ -0,0 +1,259 @@
<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;
}
</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>{{ $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>{{ $tebus_date }}</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['rekod'] as $index=>$item)
<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['tempohblmbyar'],2) }}</td>
<td>{{ number_format($item['upahblmbyar'],2) }}</td>
<td>{{$item['lanjutan']}}</td>
</tr>
@php $counter++; @endphp
@endforeach
<tfoot>
<th colspan='4'>Jumlah</th>
<th>{{ number_format($stokaudit['totalberat'],2) }}</th>
<th>{{ number_format($stokaudit['totalnilaimarhun'],2) }}</th>
<th>{{ number_format($stokaudit['totalpinjaman'],2) }}</th>
<th>{{ number_format($stokaudit['totalbakipjm'],2) }}</th>
<th></th>
<th></th>
<th>{{ number_format($stokaudit['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>
+1
View File
@@ -88,6 +88,7 @@ Route::get('/akaunhome/cetakkawalanstok',['as'=>'cetak.kawalanstok','uses'=>'App
Route::get('/akaunhome/cetaklelong',['as'=>'cetak.lelong','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_lelong'])->middleware(['roleChecker:admin,akaun,operasi']);
Route::get('/akaunhome/cetakperbelanjaan',['as'=>'cetak.perbelanjaan','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_perbelanjaan'])->middleware(['roleChecker:admin,akaun,operasi']);
Route::get('/akaunhome/cetakringkasanterkumpul',['as'=>'cetak.ringkasanterkumpul','uses'=>'App\Http\Controllers\AkaunController@cetakLaporanRingkasanTerkumpul'])->middleware(['roleChecker:admin,akaun,operasi']);
Route::get('/akaunhome/cetakstokauditbackdate',['as'=>'cetak.stokauditbackdate','uses'=>'App\Http\Controllers\AkaunController@cetakLaporanStokAuditBackdate'])->middleware(['roleChecker:admin,akaun,operasi']);
//Resit