Add range date for laporan tuntut baki lelong

This commit is contained in:
Amirah
2024-09-02 13:41:02 +08:00
parent d0ffac20f4
commit 51387f3b7a
5 changed files with 292 additions and 200 deletions
+15 -10
View File
@@ -541,16 +541,21 @@ class AkaunController extends Controller
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
if($request->datetimepicker1 == null){
$gadai_date = $current->toDateString();
if($request->datetarikh == null){
$tarikh_mula = $current->toDateString();
}else{
$split_date = explode('-',$request->datetimepicker1);
// $gadai_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
$gadai_date = $request->datetimepicker1;
$split_date = explode('-',$request->datetarikh);
$tarikh_mula = $request->datetarikh;
}
$tuntutbaki = Http::get($request->hostname. '/api/TuntutBakiTarikh/'. $request->kodcaw ,['tarikh' => $gadai_date])->json();
if($request->datehingga == null){
$tarikh_akhir = $current->toDateString();
}else{
$split_date2 = explode('-',$request->datehingga);
$tarikh_akhir = $request->datehingga;
}
$tuntutbaki = Http::get($request->hostname. '/api/TuntutBakiRangeDate/'. $request->kodcaw,['mula' => $tarikh_mula,'akhir' => $tarikh_akhir])->json();
$cawangan=Http::get($request->hostname.'/api/cawangan/detail/'.$request->kodcaw)->json();
$cawangan_detail=$cawangan[0];
@@ -559,10 +564,10 @@ class AkaunController extends Controller
{
if($request->jenis == 'pdf')
{
$pdf = PDF::loadView('akaun.laporan_tuntutbaki', compact('tuntutbaki','cawangan_detail','tarikh_cetak','gadai_date','api_url'))->setPaper('a4', 'potrait');
return $pdf->download('laporan_tuntutbaki_' . $request->kodcaw .'_'. $gadai_date . '.pdf');
$pdf = PDF::loadView('akaun.laporan_tuntutbaki', compact('tuntutbaki','cawangan_detail','tarikh_cetak','tarikh_mula','tarikh_akhir','api_url'))->setPaper('a4', 'potrait');
return $pdf->download('laporan_tuntutbaki_' . $request->kodcaw .'_'. $tarikh_mula .'-'. $tarikh_akhir .'.pdf');
}else{
return view('akaun.laporan_tuntutbaki', compact('tuntutbaki','cawangan_detail','tarikh_cetak','gadai_date','api_url'));
return view('akaun.laporan_tuntutbaki', compact('tuntutbaki','cawangan_detail','tarikh_cetak','tarikh_cetak','tarikh_mula','tarikh_akhir','api_url'));
}
}
+1 -1
View File
@@ -162,7 +162,7 @@
</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/tuntutrugi">
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Tuntut Rugi Lelong</h2>
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Baki Rugi Lelong</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">
+1 -1
View File
@@ -8,7 +8,7 @@
<i class="fas fa-backspace text-white"></i>
</router-link>
<span class="text-center mx-auto text-white font-bold">Laporan Tuntut/Rugi Lelong</span>
<span class="text-center mx-auto text-white font-bold">Laporan Baki/Rugi Lelong</span>
</div>
<form method="get" id="formlelong" :action="Urlredirect()" target="_blank">
+107 -23
View File
@@ -16,12 +16,18 @@
<div class="pb-6">
<label for="username" class="font-semibold text-gray-700 block pb-1">Tarikh</label>
<div class="flex">
<input :value="jenisgenerate" type="hidden" name="jenis" />
<input :value="$hostname" name="hostname" hidden/>
<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="datetimepicker1" 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>
<input id="tarikhmula" name="datetarikh" @change="dateChecking()" class="border border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2" type="date" />
<span style="background-color: #F9FAFB" class="text-gray-600 border border-2 rounded-l px-4 py-2 whitespace-no-wrap">Hingga</span>
<input id="tarikhhingga" name="datehingga" @change="dateChecking()" class="border border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2" type="date"/>
</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>
@@ -34,48 +40,126 @@
<script>
export default {
data(){
return{
jenisgenerate:'none',
kodcaw:''
kodcaw: ''
}
},
methods: {
async generatepdf(){
await this.setJenis('pdf');
var tarikhMula = document.getElementById("tarikhmula");
var tarikhHingga = document.getElementById("tarikhhingga");
var tarikh1 = new Date(tarikhMula.value);
var tarikh2 = new Date(tarikhHingga.value);
var Difference_In_Time = tarikh2.getTime() - tarikh1.getTime();
var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24) + 1;
if(Difference_In_Days > 62){
Vue.swal({
text: 'Sila Pilih Tarikh Kurang Dari 2 Bulan',
icon: 'error',
allowEscapeKey : false,
showCancelButton: false,
showConfirmButton: true,
});
} else{
Vue.swal({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formtuntutbaki").submit();
}
Vue.swal({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formtuntutbaki").submit();
},
async generateview(){
await this.setJenis('view');
Vue.swal({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
var tarikhMula = document.getElementById("tarikhmula");
var tarikhHingga = document.getElementById("tarikhhingga");
var tarikh1 = new Date(tarikhMula.value);
var tarikh2 = new Date(tarikhHingga.value);
var Difference_In_Time = tarikh2.getTime() - tarikh1.getTime();
var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24) + 1;
if(Difference_In_Days > 62){
Vue.swal({
text: 'Sila Pilih Tarikh Kurang Dari 2 Bulan',
icon: 'error',
allowEscapeKey : false,
showCancelButton: false,
showConfirmButton: true,
});
} else{
Vue.swal({
title: 'Memuatkan...',
allowEscapeKey : false,
allowOutsideClick: false,
showCancelButton: false,
showConfirmButton: false,
timer: 8000,
});
document.getElementById("formtuntutbaki").submit();
}
document.getElementById("formtuntutbaki").submit();
},
Urlredirect: function() {
return window.route('cetak.tuntutbaki')
},
setJenis: function(value){
return this.jenisgenerate = value;
},
dateChecking(){
var tarikhMula = document.getElementById("tarikhmula");
var tarikhHingga = document.getElementById("tarikhhingga");
var tarikh1 = new Date(tarikhMula.value);
var tarikh2 = new Date(tarikhHingga.value);
var Difference_In_Time = tarikh2.getTime() - tarikh1.getTime();
var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24) + 1;
if(Difference_In_Days > 62){
Vue.swal({
text: 'Sila Pilih Tarikh Kurang Dari 2 Bulan',
icon: 'error',
allowEscapeKey : false,
showCancelButton: false,
showConfirmButton: true,
});
}
}
}
+129 -126
View File
@@ -1,145 +1,141 @@
<style>
#header {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#header {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#header td, #customers th {
#header td, #customers th {
padding:4px;
font-size:10px;
}
padding:4px;
font-size:10px;
}
#header tr:nth-child(even){background-color: #ffffff;}
#header tr:nth-child(even){background-color: #ffffff;}
#header tr:hover {background-color: #ddd;}
#header tr:hover {background-color: #ddd;}
#header th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding:4px;
color:black;
}
</style>
#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%;
}
<style>
#scan {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
/* #scan td, #scan th {
#scan td, #scan th {
padding: 15px;
font-size:11px;
} */
padding: 8px;
font-size:11px;
}
#scan tr:nth-child(even){background-color: #ffffff;}
#scan tr:nth-child(even){background-color: #ffffff;}
#scan tr:hover {background-color: #ddd;}
#scan tr:hover {background-color: #ddd;}
#scan th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding:4px;
color:black;
}
</style>
#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: 600%;
}
<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;
width: 100%; /*new added */
}
#scan td, #scan th {
border-collapse: collapse;
padding: 8px;
font-size:11px;
}
#scan tr:nth-child(even){background-color: #ffffff;}
#scan tr:nth-child(even){background-color: #ffffff;}
#scan tr:hover {background-color: #ddd;}
#scan tr:hover {background-color: #ddd;}
#scan th {
border-collapse: collapse;
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding:2px;
color:black;
}
</style>
#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%;
}
<style>
#details {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#details td, #details th {
#details td, #details th {
padding: 8px;
font-size:8px;
}
padding: 8px;
font-size:8px;
}
#details tr:nth-child(even){background-color: #ffffff;}
#details tr:nth-child(even){background-color: #ffffff;}
#details tr:hover {background-color: #ddd;}
#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>
#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%;
}
<style>
#sign {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#sign td, #sign th {
#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>
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>
@@ -167,34 +163,39 @@
<table id="scan">
<tr>
<th><b>LAPORAN TUNTUT BAKI</b></th>
<th colspan ="5"><b>LAPORAN TUNTUT BAKI</b></th>
<th> </th>
<th> </th>
<th></th>
<th>
</th>
<th></th>
</tr>
</table>
<table id="scan">
<tr>
<th colspan="6"> <b>Tarikh Cetak:</b>
@php
<td style="width:10px"><b> Tarikh Mula: </b></td>
<td style="text-align:left;"> @php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_mula);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp</td>
<td style="width:10px"><b> Tarikh Hingga: </b></td>
<td style="text-align:left;"> @php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_akhir);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp</td>
<td style="width:10px"> <b>Tarikh Cetak: </b></td>
<td style="text-align:left;">@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>
echo($formattedweddingdate)
@endphp</td>
</tr>
<tr>
<td style="width:20px"><b> Tarikh:</b></td>
<td>
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $gadai_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>
@@ -209,6 +210,7 @@
<th>Nama</th>
<th>No K/P</th>
<th>No Rujukan</th>
<th>Tarikh Tuntut</th>
<th>Caj Lelong (RM)</th>
<th>Jumlah Baki (RM)</th>
</tr>
@@ -241,6 +243,7 @@
</td>
<td style="width:100px">{{$gadaidetail[0][0]['nokp']}}</td>
<td style="width:100px">{{$item['norujukan']}}</td>
<td>{{ $item['tarikh'] }}</td>
<td>{{ $item['cajlelong'] }}</td>
<td>{{ $item['jumlah'] }}</td>
</tr>