Merge branch 'Laporan#TuntutBaki' into 'main'
Add Laporan Tuntut Baki Lelongan Dalam Admin Page See merge request online-sistem1/admin-portal!38
This commit is contained in:
@@ -1341,4 +1341,34 @@ class AkaunController extends Controller
|
||||
|
||||
return view('akaun.laporan_imbangduga-akru',compact('tarikh_imbangan', 'tarikh_imbangan2','hartasemasa','tanggungansemasa','totalhartasemasa','totaltanggungansemasa','tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail'));
|
||||
}
|
||||
|
||||
public function cetak_tuntutrugilelong(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $request->kodcaw)->json();
|
||||
$cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'. $request->kodcaw)->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
if($request->datemula == null){
|
||||
$mula_date = '2017-01-01';
|
||||
}else{
|
||||
$split_date = explode('-', $request->datemula);
|
||||
$mula_date = $request->datemula;
|
||||
}
|
||||
|
||||
if($request->datehingga == null){
|
||||
$hingga_date = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-', $request->datehingga);
|
||||
$hingga_date = $request->datehingga;
|
||||
}
|
||||
|
||||
$tuntutbaki = Http::get($request->hostname. '/admin/laporan/tuntutbaki',['kodcaw' => $request->kodcaw,'mula' => $mula_date,'hingga' => $hingga_date,'sort' => $request->radjenis])->json();
|
||||
return view('akaun.laporan_lelongan',compact('tuntutbaki','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,6 +139,11 @@
|
||||
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Serah Marhun Tebus</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/tuntutrugi">
|
||||
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Tuntut Rugi Lelong</h2>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<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 Tuntut/Rugi Lelong</span>
|
||||
</div>
|
||||
<form method="get" id="formlelong" :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 border-2 rounded-l px-4 py-2 whitespace-no-wrap">Mula</span>
|
||||
<input id="tarikhmula" name="datemula" 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" 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-center mb-4">
|
||||
<div class="mx-2 radio">
|
||||
<input type="radio" id="tuntut" name="radjenis" value="tuntut" class="hidden focus:bg-gray-500" v-model="selected">
|
||||
<label for="tuntut" class="cursor-pointer text-gray-500 focus:bg-gray-500 hover:bg-gray-200 focus:bg-purple-500 focus:bg-purple-500 focus:outline-none border px-10 py-4 border-solid border-gray-500 rounded">Baki Lelong</label>
|
||||
</div>
|
||||
|
||||
<div class="mx-2 radio cursor-pointer">
|
||||
<input type="radio" id="rugi" name="radjenis" value="rugi" class="hidden focus:bg-gray-500" v-model="selected">
|
||||
<label for="rugi" 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">Rugi Lelong</label>
|
||||
</div>
|
||||
|
||||
<div class="mx-2 radio cursor-pointer">
|
||||
<input type="radio" id="semua" name="radjenis" value="semua" class="hidden focus:bg-gray-500" v-model="selected">
|
||||
<label for="semua" 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">Semua</label>
|
||||
</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>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
jenisgenerate:'none',
|
||||
kodcaw:'',
|
||||
selected:'',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async generatepdf(){
|
||||
await this.setJenis('pdf');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formlelong").submit();
|
||||
},
|
||||
async generateview(){
|
||||
await this.setJenis('view');
|
||||
|
||||
|
||||
Vue.swal({
|
||||
title: 'Memuatkan...',
|
||||
allowEscapeKey : false,
|
||||
allowOutsideClick: false,
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
timer: 8000,
|
||||
});
|
||||
|
||||
document.getElementById("formlelong").submit();
|
||||
},
|
||||
Urlredirect: function() {
|
||||
return window.route('cetak.tuntutrugilelong')
|
||||
},
|
||||
setJenis: function(value){
|
||||
return this.jenisgenerate = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -111,7 +111,7 @@
|
||||
case '011237':
|
||||
case '011233':{
|
||||
// this.$hostname = 'http://api3.arrahn'
|
||||
this.sethostname('http://api3.arrahn')
|
||||
this.sethostname('http://api2.arrahn')
|
||||
break;
|
||||
}
|
||||
default: this.sethostname('http://api.arrahn')
|
||||
|
||||
Vendored
+3
@@ -26,6 +26,7 @@ import Prestasi from './Akaun/Prestasi'
|
||||
import SerahGadai from './Akaun/SerahGadai'
|
||||
import SerahTebus from './Akaun/SerahTebus'
|
||||
import Online from './Akaun/Online'
|
||||
import TuntutLelong from './Akaun/TuntutLelong'
|
||||
import Dashboard from './Dashboard/index'
|
||||
|
||||
|
||||
@@ -87,6 +88,8 @@ export default new VueRouter({
|
||||
{ path: '/akaunhome/serahgadai', component: SerahGadai },
|
||||
{ path: '/akaunhome/serahtebus', component: SerahTebus },
|
||||
{ path: '/akaunhome/online', component: Online },
|
||||
{ path: '/akaunhome/tuntutrugi', component: TuntutLelong },
|
||||
|
||||
|
||||
|
||||
{ path: '/bajet/kemaskini', component: SenaraiBajet },
|
||||
|
||||
@@ -165,33 +165,29 @@
|
||||
|
||||
<table id="scan">
|
||||
<tr>
|
||||
<th colspan ="5"><b>LAPORAN LELONGAN</b></th>
|
||||
<th colspan ="5"><b>LAPORAN TUNTUT/RUGI LELONG</b></th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th><b> Tarikh Cetak:</b>
|
||||
<th><b>MULA:</b>
|
||||
@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $mula_date);
|
||||
$formattedweddingdate = $myDateTime->format('d-m-Y');
|
||||
echo($formattedweddingdate)
|
||||
@endphp
|
||||
<b style="margin-left:20px;">HINGGA:</b>
|
||||
@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $hingga_date);
|
||||
$formattedweddingdate = $myDateTime->format('d-m-Y');
|
||||
echo($formattedweddingdate)
|
||||
@endphp
|
||||
</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>@php
|
||||
$myDateTime = DateTime::createFromFormat('Y-m-d', $tebus_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>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -199,95 +195,40 @@
|
||||
<table id="details">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Penggadai</th>
|
||||
<th>N. Marhun Asal</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>U.Simpan</th>
|
||||
<th>C.Lel</th>
|
||||
<th>Harga Lel</th>
|
||||
<th>Baki</th>
|
||||
<th>Harga Asas</th>
|
||||
<th>Pembeli</th>
|
||||
<th>No. Rujukan</th>
|
||||
<th>T. Lelong</th>
|
||||
<th>Baki Lelong</th>
|
||||
<th>Rugi Lelong</th>
|
||||
</tr>
|
||||
@php $counter = 1;$totalnilaimarhun = 0; $totalpinjaman = 0; $totalupahsimpan = 0; $totalclel = 0; $totalhargalel = 0; $totalbaki = 0; $totalhargaasas = 0; $totalbakilelong = 0; $totalrugilelong = 0; @endphp
|
||||
@foreach($tebus as $index=>$item)
|
||||
@php $counter = 1; $totalbakilelong = 0; $totalrugilelong = 0; @endphp
|
||||
@foreach($tuntutbaki as $index=>$item)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{$item['norujukan']}}</td>
|
||||
<td>
|
||||
@php
|
||||
$gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json();
|
||||
$customer_detail = Http::get($api_url . '/api/customers/' . $gadai_detail[0][0]['nokp'])->json();
|
||||
|
||||
echo $customer_detail['nama'] . '<br>' . $gadai_detail[0][0]['nokp'] . '<br>' . $customer_detail['alamat1'] . '<br>' . $customer_detail['alamat2'];
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{$item['nilaimarhun']}}</td>
|
||||
<td>{{$item['pinjaman']}}</td>
|
||||
<td>{{$item['bakiupah']}}</td>
|
||||
<td>{{$item['cajlelong']}}</td>
|
||||
<td>{{$item['hargajual']}}</td>
|
||||
<td>{{ $item['baki'] }}</td>
|
||||
<td>{{$item['hargaasas']}}</td>
|
||||
<td>{!!$item['nama'] . '<br>' . $item['nokp'] . '<br>' . $item['alamat1']. '<br>' . $item['alamat2'] !!}</td>
|
||||
</tr>
|
||||
<td>{{ $item['tarikhlelong'] }}</td>
|
||||
@php $counter++;
|
||||
if ($item['baki'] > 0)
|
||||
if ($item['baki'] > 0){
|
||||
echo '<td>' . number_format($item['baki'],2) . '</td>';
|
||||
echo '<td>0.00</td>';
|
||||
$totalbakilelong += $item['baki'];
|
||||
else if($item['baki'] < 0)
|
||||
$totalrugilelong -= $item['baki'];
|
||||
|
||||
$totalpinjaman += $item['pinjaman'];
|
||||
$totalnilaimarhun += $item['nilaimarhun'];
|
||||
$totalupahsimpan += $item['baki'];
|
||||
$totalclel += $item['cajlelong'];
|
||||
$totalhargalel += $item['hargajual'];
|
||||
$totalbaki += $item['baki'];
|
||||
$totalhargaasas += $item['hargaasas'];
|
||||
}else if($item['baki'] < 0){
|
||||
echo '<td>0.00</td>';
|
||||
echo '<td>' . number_format($item['baki'],2) . '</td>';
|
||||
$totalrugilelong += $item['baki'];
|
||||
}
|
||||
@endphp
|
||||
@endforeach
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td colspan="2">Jumlah Bagi Teller</td>
|
||||
<td>{{ $totalnilaimarhun }}</td>
|
||||
<td>{{ $totalpinjaman }}</td>
|
||||
<td>{{ $totalupahsimpan }}</td>
|
||||
<td>{{ $totalclel }}</td>
|
||||
<td>{{ $totalhargalel }}</td>
|
||||
<td>{{ $totalbaki }}</td>
|
||||
<td>{{ $totalhargaasas }}</td>
|
||||
<tr style="border-bottom: 1pt solid black;border-top:1pt solid black;">
|
||||
<td></td>
|
||||
<td colspan="2" style="font-weight:bold;"><b>Jumlah Keseluruhan</td>
|
||||
<td style="font-weight:bold;">{!! number_format($totalbakilelong,2) !!}</td>
|
||||
<td style="font-weight:bold;">{!! number_format($totalrugilelong,2) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td colspan="2">Jumlah Keseluruhan</td>
|
||||
<td>{{ $totalnilaimarhun }}</td>
|
||||
<td>{{ $totalpinjaman }}</td>
|
||||
<td>{{ $totalupahsimpan }}</td>
|
||||
<td>{{ $totalclel }}</td>
|
||||
<td>{{ $totalhargalel }}</td>
|
||||
<td>{{ $totalbaki }}</td>
|
||||
<td>{{ $totalhargaasas }}</td>
|
||||
<tr style="border-bottom: 1pt solid black;border-top:1pt solid black;">
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2" style="font-weight:bold;"><b>Jumlah Baki Lelong (A)</td>
|
||||
<td colspan="5" style="font-weight:bold;"></td>
|
||||
<td style="font-weight:bold;">{!! $totalbakilelong !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2" style="font-weight:bold;">Jumlah Kerugian Lelong (B)</td>
|
||||
<td colspan="5" style="font-weight:bold;"></td>
|
||||
<td style="font-weight:bold;">{!! $totalrugilelong !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2" style="font-weight:bold;">A-B</td>
|
||||
<td colspan="5" style="font-weight:bold;"></td>
|
||||
<td style="font-weight:bold;">{!! $totalbakilelong + $totalrugilelong !!}</td>
|
||||
<td colspan="2" style="font-weight:bold;">Baki Lelong (A) - Rugi Lelong (B)</td>
|
||||
<td colspan="1" style="font-weight:bold;"></td>
|
||||
<td style="font-weight:bold;">{!! number_format($totalbakilelong + $totalrugilelong,2) !!}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ Route::get('/akaunhome/cetakakrubulan',['as'=>'cetak.akrubulan','uses'=>'App\Htt
|
||||
Route::get('/akaunhome/cetakserahgadai',['as'=>'cetak.serahgadai','uses'=>'App\Http\Controllers\AkaunController@cetak_serahgadai'])->middleware(['roleChecker:admin,akaun,operasi']);
|
||||
Route::get('/akaunhome/cetakserahtebus',['as'=>'cetak.serahtebus','uses'=>'App\Http\Controllers\AkaunController@cetak_serahtebus'])->middleware(['roleChecker:admin,akaun,operasi']);
|
||||
Route::get('/akaunhome/cetakonline',['as'=>'cetak.online','uses'=>'App\Http\Controllers\AkaunController@cetak_laporan_online'])->middleware(['roleChecker:admin,akaun,operasi']);
|
||||
Route::get('/akaunhome/cetaktuntutrugi',['as'=>'cetak.tuntutrugilelong','uses'=>'App\Http\Controllers\AkaunController@cetak_tuntutrugilelong'])->middleware(['roleChecker:admin,akaun,operasi']);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user