kemaskini laporan pendahuluan dan serahan
This commit is contained in:
@@ -522,16 +522,37 @@ class AkaunController extends Controller
|
||||
|
||||
if(isset($request->jenis))
|
||||
{
|
||||
$jenisLaporan = $request->radpendser; // Get report type
|
||||
|
||||
if($request->jenis == 'pdf')
|
||||
{
|
||||
$pdf = PDF::loadView('akaun.laporan_pendahuluanserahan', compact('pendser','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'))->setPaper('a4', 'potrait');
|
||||
return $pdf->download('laporan_HQ_' . $request->kodcaw .'_'. $mula_date . '_' . $request->radpendser . '.pdf');
|
||||
}else{
|
||||
return view('akaun.laporan_pendahuluanserahan', compact('pendser','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
|
||||
$pdf = PDF::loadView('akaun.laporan_pendahuluanserahan', compact(
|
||||
'pendser',
|
||||
'cawangan_detail',
|
||||
'tarikh_cetak',
|
||||
'mula_date',
|
||||
'hingga_date',
|
||||
'api_url',
|
||||
'jenisLaporan' // Pass the report type
|
||||
))->setPaper('a4', 'portrait');
|
||||
|
||||
return $pdf->download('laporan_HQ_' . $request->kodcaw . '_' . $mula_date . '_' . $jenisLaporan . '.pdf');
|
||||
}
|
||||
else
|
||||
{
|
||||
return view('akaun.laporan_pendahuluanserahan', compact(
|
||||
'pendser',
|
||||
'cawangan_detail',
|
||||
'tarikh_cetak',
|
||||
'mula_date',
|
||||
'hingga_date',
|
||||
'api_url',
|
||||
'jenisLaporan' // Pass the report type to the view
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function cetaklaporan_tuntutbaki(Request $request){
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<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="flex w-100%">
|
||||
<div class="xl:w-7/8 2xl:w-5/6 p-12 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>
|
||||
@@ -40,6 +40,16 @@
|
||||
<input type="radio" id="online" name="radpendser" value="online" class="hidden focus:bg-gray-500" v-model="selected">
|
||||
<label for="online" 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">Serahan Online</label>
|
||||
</div>
|
||||
|
||||
<div class="mx-2 radio cursor-pointer">
|
||||
<input type="radio" id="serahanonline" name="radpendser" value="serahanonline" class="hidden focus:bg-gray-500" v-model="selected">
|
||||
<label for="serahanonline" 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">Serahan & Serahan Online</label>
|
||||
</div>
|
||||
|
||||
<div class="mx-2 radio cursor-pointer">
|
||||
<input type="radio" id="all" name="radpendser" value="all" class="hidden focus:bg-gray-500" v-model="selected">
|
||||
<label for="all" 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">All</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end mt-10">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<style>
|
||||
#header {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
@@ -71,7 +73,7 @@
|
||||
#scan tr:hover {background-color: #ddd;}
|
||||
|
||||
#scan th {
|
||||
border-collapse: collapse;
|
||||
/* border-collapse: collapse; */
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
@@ -85,7 +87,7 @@
|
||||
<style>
|
||||
#details {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
/* border-collapse: collapse; */
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -169,6 +171,17 @@
|
||||
</tr> --}}
|
||||
</table>
|
||||
<br>
|
||||
@php
|
||||
$reportNames = [
|
||||
'serahan' => 'LAPORAN SERAHAN HQ',
|
||||
'pendahuluan' => 'LAPORAN PENDAHULUAN HQ',
|
||||
'online' => 'LAPORAN SERAHAN ONLINE HQ',
|
||||
'serahanonline' => 'LAPORAN SERAHAN DAN SERAHAN ONLINE HQ',
|
||||
'all' => 'LAPORAN KESELURUHAN HQ'
|
||||
];
|
||||
|
||||
$displayJenisLaporan = $reportNames[$jenisLaporan] ?? 'Laporan Tidak Diketahui';
|
||||
@endphp
|
||||
|
||||
<table id="scan">
|
||||
<tr>
|
||||
@@ -177,9 +190,9 @@
|
||||
@endphp
|
||||
|
||||
@if(Str::contains($api_url, 'apiv3.arrahn'))
|
||||
<th colspan ="5"><b>LAPORAN PENDAHULUAN/SERAHAN HQ (arOSv3)</b></th>
|
||||
<th colspan ="5"><b>{{ $displayJenisLaporan }} (arOSv3)</b></th>
|
||||
@else
|
||||
<th colspan ="5"><b>LAPORAN PENDAHULUAN/SERAHAN HQ</b></th>
|
||||
<th colspan ="5"><b>{{ $displayJenisLaporan }} (arOSv2)</b></th>
|
||||
@endif
|
||||
|
||||
<th> </th>
|
||||
@@ -232,20 +245,25 @@
|
||||
<th>Nama</th>
|
||||
<th>Amaun (RM)</th>
|
||||
</tr>
|
||||
@php $counter = 1; $totalamaun = 0; $jenis = ''; @endphp
|
||||
@php
|
||||
$counter = 1;
|
||||
$totalamaun = 0;
|
||||
$jenis = '';
|
||||
@endphp
|
||||
@foreach($pendser as $index=>$item)
|
||||
<tr> <!-- Ensure this <tr> wraps around all <td> elements -->
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $item['tarikh'] }}</td>
|
||||
<td><b>{{ $item['descpt'] }}</b></td>
|
||||
<td>{{ $item['teller'] }}</td>
|
||||
<td>{{ ($item['pendahuluan'] > 0) ? number_format($item['pendahuluan'],2) : number_format($item['serahan'],2) }}</td>
|
||||
</tr>
|
||||
@php $counter++;$totalamaun += ($item['pendahuluan'] > 0) ? $item['pendahuluan'] : $item['serahan'];
|
||||
if($index == 0)
|
||||
if($item['pendahuluan'] > 0)
|
||||
$jenis = 'PENDAHULUAN';
|
||||
else
|
||||
$jenis = 'SERAHAN';
|
||||
<td>{{ number_format($item['pendahuluan'] > 0 ? $item['pendahuluan'] : $item['serahan'], 2) }}</td>
|
||||
</tr>
|
||||
@php
|
||||
$counter++;
|
||||
$totalamaun += ($item['pendahuluan'] > 0) ? $item['pendahuluan'] : $item['serahan'];
|
||||
if ($index == 0) {
|
||||
$jenis = ($item['pendahuluan'] > 0) ? 'PENDAHULUAN' : 'SERAHAN';
|
||||
}
|
||||
@endphp
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user