Add statistics to the pembiayaan report in adminv3
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
use Barryvdh\DomPDF\Facade as PDF;
|
||||
@@ -314,7 +315,7 @@ class AkaunController extends Controller
|
||||
|
||||
// return view('akaun.laporan_imbanduga',compact('tarikh_imbangan', 'tarikh_imbangan2','hartasemasa','untungrugifield','tanggungansemasa','totalhartasemasa','totaluntungrugi','totaltanggungansemasa','tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail'));
|
||||
}
|
||||
|
||||
////ainizazi
|
||||
public function cetakLaporanGadai(Request $request){
|
||||
$api_url = $request->hostname;
|
||||
$auth_user = Auth::user();
|
||||
@@ -337,7 +338,17 @@ class AkaunController extends Controller
|
||||
}
|
||||
// $gadai = Http::get($request->hostname. '/api/gadai/laporan/'. $request->kodcaw .'/'. $gadai_date)->json();
|
||||
|
||||
$gadai = Http::get($request->hostname. '/api/gadailaporanRangeDate/'. $request->kodcaw,['mula' => $tarikh_mula,'akhir' => $tarikh_akhir])->json();
|
||||
$reportGadai = Http::get($request->hostname. '/api/gadailaporanRangeDate/'. $request->kodcaw,['mula' => $tarikh_mula,'akhir' => $tarikh_akhir])->json();
|
||||
$gadai = $reportGadai['gadai'];
|
||||
// dd($reportsGadai);
|
||||
$statistik =$reportGadai['statistik'];
|
||||
$reportPembiayaan= $statistik['reportPembiayaan'];
|
||||
$reportLoanAmount=$statistik['reportLoanAmount'];
|
||||
$reportMarhunValue=$statistik['reportMarhunValue'];
|
||||
$reportMarhunMargin=$statistik['reportMarhunMargin'];
|
||||
$reportCustomerJob=$statistik['reportCustomerJob'];
|
||||
$reportCustomerRace=$statistik['reportCustomerRace'];
|
||||
|
||||
|
||||
$cawangan=Http::get($request->hostname.'/api/cawangan/detail/'.$request->kodcaw)->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
@@ -349,10 +360,9 @@ class AkaunController extends Controller
|
||||
$pdf = PDF::loadView('akaun.laporan_gadaian', compact('gadai','cawangan_detail','tarikh_cetak','tarikh_mula','tarikh_akhir','api_url'))->setPaper('a4', 'landscape');
|
||||
return $pdf->download('laporan_gadaian_' . $request->kodcaw .'_'. $tarikh_mula .'-'. $tarikh_akhir .'.pdf');
|
||||
}else{
|
||||
return view('akaun.laporan_gadaian', compact('gadai','cawangan_detail','tarikh_cetak','tarikh_mula','tarikh_akhir','api_url'));
|
||||
return view('akaun.laporan_gadaian', compact('gadai','cawangan_detail','tarikh_cetak','tarikh_mula','tarikh_akhir','api_url','reportGadai','gadai','statistik','reportPembiayaan','reportLoanAmount','reportMarhunValue','reportMarhunMargin','reportCustomerJob','reportCustomerRace'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function cetakLaporanPenebusan(Request $request){
|
||||
@@ -417,8 +427,6 @@ class AkaunController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function cetaklaporan_Upah(Request $request)
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Exports\GadaianDetailExport;
|
||||
|
||||
class StatistikController extends Controller
|
||||
{
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$current = Carbon::now();
|
||||
|
||||
$getReportDate = function ($date_string) use ($current) {
|
||||
return $date_string ? $date_string : $current->toDateString();
|
||||
};
|
||||
|
||||
$request->hostname = config('api.url');
|
||||
|
||||
$startDate = $getReportDate($request->startDate);
|
||||
$endDate = $getReportDate($request->endDate);
|
||||
|
||||
|
||||
$gadaian = Http::get($request->hostname . '/api/statistik', [
|
||||
'startDate' => $startDate,
|
||||
'endDate' => $endDate,
|
||||
])->json();
|
||||
dd($gadaian);
|
||||
|
||||
return view('akaun.laporan_gadaian', compact('gadaian', 'startDate', 'endDate'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,316 +1,346 @@
|
||||
<style>
|
||||
#header {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html lang="ms">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Laporan Pembiayaan & Statistik</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
#header td, #customers th {
|
||||
/* Header Table Styles */
|
||||
#header {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
padding:4px;
|
||||
font-size:10px;
|
||||
}
|
||||
#header td, #header th {
|
||||
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;
|
||||
}
|
||||
|
||||
/* Scan Table Styles */
|
||||
#scan {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#scan td, #scan th {
|
||||
padding: 8px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#scan tr:nth-child(even) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
<style>
|
||||
#scan {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
#scan tr:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
#scan td, #scan th {
|
||||
#scan th {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding: 4px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
/* Details Table Styles */
|
||||
#details {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#scan tr:nth-child(even){background-color: #ffffff;}
|
||||
#details td, #details th {
|
||||
padding: 8px;
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
#scan tr:hover {background-color: #ddd;}
|
||||
#details tr:nth-child(even) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#scan th {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
#details tr:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
#details th {
|
||||
padding-top: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding: 4px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
<style>
|
||||
#scan {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
/* Sign Table Styles */
|
||||
#sign {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#scan td, #scan th {
|
||||
border-collapse: collapse;
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
#sign td, #sign th {
|
||||
padding: 8px;
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#scan tr:nth-child(even){background-color: #ffffff;}
|
||||
#sign tr:nth-child(even) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#scan tr:hover {background-color: #ddd;}
|
||||
#sign 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;
|
||||
}
|
||||
</style>
|
||||
#sign th {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding: 4px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/* Statistics Table Styles */
|
||||
#statistik {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
#statistik th, #statistik td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#statistik th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.header-row {
|
||||
background-color: #e0e0e0;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.bangsa { background-color: #fce4ec; }
|
||||
.pekerjaan { background-color: #e8f5e9; }
|
||||
.nilai { background-color: #e1f5fe; }
|
||||
.pembiayaan-col { background-color: #ffe4d9; }
|
||||
.jenis { background-color: #e8eaf6; }
|
||||
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin: 30px 0 20px 0;
|
||||
padding: 10px;
|
||||
background-color: #f0f0f0;
|
||||
border-left: 5px solid #333;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- SECTION 1: LAPORAN PEMBIAYAAN -->
|
||||
<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 style="font-size:20px;font-weight:bold;">{{ $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> --}}
|
||||
<tr>
|
||||
<td style="font-size:20px;font-weight:bold;">{{ $cawangan_detail['namacaw'] }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<table id="scan">
|
||||
<tr>
|
||||
<tr>
|
||||
@php
|
||||
$api_url = request()->hostname;
|
||||
@endphp
|
||||
@endphp
|
||||
|
||||
@if(Str::contains($api_url, 'apiv3.arrahn'))
|
||||
<th colspan="5"><b>LAPORAN PEMBIAYAAN (arOSv3)</b></th>
|
||||
@else
|
||||
<th colspan="5"><b>LAPORAN PEMBIAYAAN</b></th>
|
||||
@endif
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:100px"><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:100px"><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:100px"> <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</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width:50px">
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
@if(Str::contains($api_url, 'api_arrahnv3.test'))
|
||||
<th colspan="5"><b>LAPORAN PEMBIAYAAN (arOSv3)</b></th>
|
||||
@else
|
||||
<th colspan="5"><b>LAPORAN PEMBIAYAAN</b></th>
|
||||
@endif
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:100px"><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:100px"><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:100px"> <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
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:50px"></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<table id="details">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Norujukan</th>
|
||||
<th>Nama</th>
|
||||
<th>Alamat</th>
|
||||
<th>Tarikh Pembiayaan</th>
|
||||
<th>No K/P</th>
|
||||
<th>Masa</th>
|
||||
<th>Berat</th>
|
||||
<th>N Marhun</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Caj-caj Lain</th>
|
||||
<th>Keuntungan 1%</th>
|
||||
<th>Keuntungan</th>
|
||||
<th>Peratus (%)</th>
|
||||
</tr>
|
||||
@php
|
||||
$counter = 1;
|
||||
$totalpinjaman = 0;
|
||||
$totalberat = 0;
|
||||
$totalnm = 0;
|
||||
$totalupah = 0;
|
||||
$bil = 0;
|
||||
$full_total_ujrah = 0;
|
||||
$full_total_onepercent = 0;
|
||||
@endphp
|
||||
@foreach($gadai as $index=>$item)
|
||||
@php
|
||||
$ujrah = isset($item['ujrah']) ? $item['ujrah'] : 0;
|
||||
$onepercent = isset($item['onepercent']) ? $item['onepercent'] : 0;
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Norujukan</th>
|
||||
<th>Nama</th>
|
||||
<th>Alamat</th>
|
||||
<th>Tarikh Pembiayaan</th>
|
||||
<th>No K/P</th>
|
||||
<th>Masa</th>
|
||||
<th>Berat</th>
|
||||
<th>N Marhun</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Lain-Lain Caj</th>
|
||||
<th>Keuntungan 1%</th>
|
||||
<th>Keuntungan</th>
|
||||
<th>Peratus (%)</th>
|
||||
</tr>
|
||||
@php
|
||||
$counter = 1;
|
||||
$totalpinjaman = 0;
|
||||
$totalberat = 0;
|
||||
$totalnm = 0;
|
||||
$totalupah = 0;
|
||||
$bil = 0;
|
||||
$full_total_ujrah = 0;
|
||||
$full_total_onepercent = 0;
|
||||
@endphp
|
||||
@foreach($gadai as $index=>$item)
|
||||
@php
|
||||
$ujrah = isset($item['ujrah']) ? $item['ujrah'] : 0;
|
||||
$onepercent = isset($item['onepercent']) ? $item['onepercent'] : 0;
|
||||
|
||||
$totalpinjaman += $item['pinjaman'];
|
||||
$totalberat += $item['berat'];
|
||||
$totalnm += $item['nilaimarhun'];
|
||||
$totalupah += $item['upah12'];
|
||||
$full_total_ujrah += $ujrah * 12;
|
||||
$full_total_onepercent += $onepercent * 12;
|
||||
@endphp
|
||||
@if($index > 0)
|
||||
@if($item['teller'] != $gadai[$index - 1]['teller'])
|
||||
$totalpinjaman += $item['pinjaman'];
|
||||
$totalberat += $item['berat'];
|
||||
$totalnm += $item['nilaimarhun'];
|
||||
$totalupah += $item['upah12'];
|
||||
$full_total_ujrah += $ujrah * 12;
|
||||
$full_total_onepercent += $onepercent * 12;
|
||||
@endphp
|
||||
@if($index > 0)
|
||||
@if($item['teller'] != $gadai[$index - 1]['teller'])
|
||||
<tr>
|
||||
<td colspan=10>Teller : <b>{{ $item['teller'] }}</b></td>
|
||||
</tr>
|
||||
@php
|
||||
$totalpinjamanteller = 0;
|
||||
$totalnmteller = 0;
|
||||
$totalberatteller = 0;
|
||||
$totalujrah = 0;
|
||||
$totalonepercent = 0;
|
||||
@endphp
|
||||
@endif
|
||||
@else
|
||||
<tr>
|
||||
<td colspan=10>Teller : <b>{{ $item['teller'] }}</b></td>
|
||||
</tr>
|
||||
@php
|
||||
@php
|
||||
$totalpinjamanteller = 0;
|
||||
$totalnmteller = 0;
|
||||
$totalberatteller = 0;
|
||||
$totalupah12 = 0;
|
||||
$totalujrah = 0;
|
||||
$totalonepercent = 0;
|
||||
$totalonepercent= 0;
|
||||
@endphp
|
||||
@endif
|
||||
@else
|
||||
<tr>
|
||||
<td colspan=10>Teller : <b>{{ $item['teller'] }}</b></td>
|
||||
<td>{{ $counter }}</td>
|
||||
<td style="width:100px">{{$item['norujukan']}}</td>
|
||||
<td>{{ $item['nama'] }}</td>
|
||||
<td>{{ $item['alamat1'] }}</td>
|
||||
<td>{{ $item['t_gadai'] }}</td>
|
||||
<td>{{ $item['nokp'] }}</td>
|
||||
<td>{{ $item['masa'] }}</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($ujrah*12,2) }}</td>
|
||||
<td>{{ number_format($onepercent*12,2) }}</td>
|
||||
<td>{{ number_format($item['upah12'],2) }}</td>
|
||||
<td>{{ $item['percentpinj'] }}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@php
|
||||
$totalpinjamanteller = 0;
|
||||
$totalnmteller = 0;
|
||||
$totalberatteller = 0;
|
||||
$totalupah12 = 0;
|
||||
$totalujrah = 0;
|
||||
$totalonepercent= 0;
|
||||
$totalpinjamanteller += $item['pinjaman'];
|
||||
$totalnmteller += $item['nilaimarhun'];
|
||||
$totalberatteller += $item['berat'];
|
||||
$totalupah12 += $item['upah12'];
|
||||
$totalujrah += $ujrah*12;
|
||||
$totalonepercent += $onepercent*12;
|
||||
@endphp
|
||||
|
||||
@endif
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td style="width:100px">{{$item['norujukan']}}</td>
|
||||
<td>
|
||||
{{ $item['nama'] }}
|
||||
</td>
|
||||
<td>{{ $item['alamat1'] }}</td>
|
||||
<td>{{ $item['t_gadai'] }}</td>
|
||||
<td>{{ $item['nokp'] }}</td>
|
||||
<td>{{ $item['masa'] }}</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($ujrah*12,2) }}</td>
|
||||
<td>{{ number_format($onepercent*12,2) }}</td>
|
||||
<td>{{ number_format($item['upah12'],2) }}</td>
|
||||
<td>{{ $item['percentpinj'] }}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@php
|
||||
$totalpinjamanteller += $item['pinjaman'];
|
||||
$totalnmteller += $item['nilaimarhun'];
|
||||
$totalberatteller += $item['berat'];
|
||||
$totalupah12 += $item['upah12'];
|
||||
$totalujrah += $ujrah*12;
|
||||
$totalonepercent += $onepercent*12;
|
||||
@endphp
|
||||
@if($index+1 < sizeof($gadai))
|
||||
@if($item['teller'] != $gadai[$index + 1]['teller'])
|
||||
@php if($item['teller'] != '')$bil += ($counter-1); @endphp
|
||||
@if($index+1 < sizeof($gadai))
|
||||
@if($item['teller'] != $gadai[$index + 1]['teller'])
|
||||
@php if($item['teller'] != '')$bil += ($counter-1); @endphp
|
||||
<tr>
|
||||
<td colspan="7"><b>{{ $counter-1 }}</b> Jumlah surat bagi teller : <b>{{ $item['teller'] }}</b></td>
|
||||
<td><b>{{ number_format($totalberatteller,2) }} </b></td>
|
||||
<td><b>{{ number_format($totalnmteller,2) }} </b></td>
|
||||
<td><b>{{ number_format($totalpinjamanteller,2) }} </b></td>
|
||||
<td><b>{{ number_format($totalujrah,2) }}</b></td>
|
||||
<td><b>{{ number_format($totalonepercent,2) }}</b></td>
|
||||
<td><b>{{ number_format($totalupah12,2) }} </b></td>
|
||||
</tr>
|
||||
@php
|
||||
$counter = 1;
|
||||
$totalupah12 = 0;
|
||||
$totalpinjamanteller = 0;
|
||||
$totalnmteller = 0;
|
||||
$totalujrah = 0;
|
||||
$totalonepercent = 0;
|
||||
@endphp
|
||||
@endif
|
||||
@else
|
||||
@php $bil += ($counter-1); @endphp
|
||||
<tr>
|
||||
<td colspan="7"><b>{{ $counter-1 }}</b> Jumlah surat bagi teller : <b>{{ $item['teller'] }}</b></td>
|
||||
<td><b>{{ number_format($totalberatteller,2) }} </b></td>
|
||||
@@ -319,77 +349,180 @@
|
||||
<td><b>{{ number_format($totalujrah,2) }}</b></td>
|
||||
<td><b>{{ number_format($totalonepercent,2) }}</b></td>
|
||||
<td><b>{{ number_format($totalupah12,2) }} </b></td>
|
||||
|
||||
</tr>
|
||||
@php
|
||||
$counter = 1;
|
||||
$totalupah12 = 0;
|
||||
$totalpinjamanteller = 0;
|
||||
$totalnmteller = 0;
|
||||
$totalujrah = 0;
|
||||
$totalonepercent = 0;
|
||||
@endphp
|
||||
@endif
|
||||
@else
|
||||
@php $bil += ($counter-1); @endphp
|
||||
<tr>
|
||||
<td colspan="7"><b>{{ $counter-1 }}</b> Jumlah surat bagi teller : <b>{{ $item['teller'] }}</b></td>
|
||||
<td><b>{{ number_format($totalberatteller,2) }} </b></td>
|
||||
<td><b>{{ number_format($totalnmteller,2) }} </b></td>
|
||||
<td><b>{{ number_format($totalpinjamanteller,2) }} </b></td>
|
||||
<td><b>{{ number_format($totalujrah,2) }}</b></td>
|
||||
<td><b>{{ number_format($totalonepercent,2) }}</b></td>
|
||||
<td><b>{{ number_format($totalupah12,2) }} </b></td>
|
||||
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
<table id="details" style="border-top:1px solid black;border-bottom:1px solid black;text-align:center;">
|
||||
<tr>
|
||||
<th colspan="9" style="text-align: center;"><b>JUMLAH BILANGAN = {{ $bil }}</b></th>
|
||||
<th style="text-align:center;">Berat (g/m)</th>
|
||||
<th style="text-align:center;">Nilai Marhun (RM)</th>
|
||||
<th style="text-align:center;">Pembiayaan (RM)</th>
|
||||
<th style="text-align:center;">Caj-caj Lain (RM)</th>
|
||||
<th style="text-align:center;">Keuntungan 1% (RM)</th>
|
||||
<th style="text-align:center;">Keuntungan (RM)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="text-align: center;"><b>JUMLAH KESELURUHAN</b></td>
|
||||
<td>{{ number_format($totalberat,2) }}</td>
|
||||
<td>{{ number_format($totalnm,2) }}</td>
|
||||
<td>{{ number_format($totalpinjaman,2) }}</td>
|
||||
<td>{{ number_format($full_total_ujrah,2) }}</td>
|
||||
<td>{{ number_format($full_total_onepercent,2) }}</td>
|
||||
<td>{{ number_format($totalupah,2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="9" style="text-align: center;"><b>JUMLAH BILANGAN = {{ $bil }}</b></th>
|
||||
<th style="text-align:center;">Berat (g/m)</th>
|
||||
<th style="text-align:center;">Nilai Marhun (RM)</th>
|
||||
<th style="text-align:center;">Pembiayaan (RM)</th>
|
||||
<th style="text-align:center;">Caj-caj Lain (RM)</th>
|
||||
<th style="text-align:center;">Keuntungan 1% (RM)</th>
|
||||
<th style="text-align:center;">Keuntungan (RM)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="text-align: center;"><b>JUMLAH KESELURUHAN</b></td>
|
||||
<td>{{ number_format($totalberat,2) }}</td>
|
||||
<td>{{ number_format($totalnm,2) }}</td>
|
||||
<td>{{ number_format($totalpinjaman,2) }}</td>
|
||||
<td>{{ number_format($full_total_ujrah,2) }}</td>
|
||||
<td>{{ number_format($full_total_onepercent,2) }}</td>
|
||||
<td>{{ number_format($totalupah,2) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{{-- <h5 style="float:right;">JUMLAH KESELURUHAN GADAIAN : RM {{ number_format($totalpinjaman,2) }}</h5> --}}
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
|
||||
<!-- PAGE BREAK FOR PRINT -->
|
||||
<div class="page-break"></div>
|
||||
|
||||
<!-- SECTION 2: STATISTIK JENIS -->
|
||||
<div class="section-title">STATISTIK JENIS PEMBIAYAAN</div>
|
||||
|
||||
<table id="statistik" class="min-w-full border border-gray-300">
|
||||
<thead>
|
||||
<tr class="header-row bg-gray-100 text-center">
|
||||
<th colspan="2">Bangsa</th>
|
||||
<th colspan="2">Pekerjaan</th>
|
||||
<th colspan="2">Nilai Marhun</th>
|
||||
<th colspan="2">Pembiayaan</th>
|
||||
<th colspan="2">Pembiayaan Margin</th>
|
||||
<th colspan="2">Jenis Pembiayaan</th>
|
||||
</tr>
|
||||
<tr class="bg-gray-50 text-center text-sm">
|
||||
<th>Jenis</th>
|
||||
<th>Bil</th>
|
||||
<th>Jenis</th>
|
||||
<th>Bil</th>
|
||||
<th>RM</th>
|
||||
<th>Bil</th>
|
||||
<th>RM</th>
|
||||
<th>Bil</th>
|
||||
<th>%</th>
|
||||
<th>Bil</th>
|
||||
<th>Jenis</th>
|
||||
<th>Bil</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="text-sm text-center">
|
||||
@php
|
||||
// Get all arrays from statistik
|
||||
$bangsaData = $statistik['reportCustomerRace'];
|
||||
$pekerjaanData = $statistik['reportCustomerJob'];
|
||||
$marhunData = $statistik['reportMarhunValue'];
|
||||
$pembiayaanData = $statistik['reportLoanAmount'];
|
||||
$marginData = $statistik['reportMarhunMargin'];
|
||||
$jenisPembiayaanData = $statistik['reportPembiayaan'];
|
||||
|
||||
// Get maximum rows needed
|
||||
$maxRows = max(
|
||||
count($bangsaData),
|
||||
count($pekerjaanData),
|
||||
count($marhunData),
|
||||
count($pembiayaanData),
|
||||
count($marginData),
|
||||
count($jenisPembiayaanData)
|
||||
);
|
||||
|
||||
// Convert to indexed arrays (preserving order)
|
||||
$bangsaKeys = array_keys($bangsaData);
|
||||
$bangsa = array_values($bangsaData);
|
||||
|
||||
$pekerjaanKeys = array_keys($pekerjaanData);
|
||||
$pekerjaan = array_values($pekerjaanData);
|
||||
|
||||
$marhunKeys = array_keys($marhunData);
|
||||
$marhun = array_values($marhunData);
|
||||
|
||||
$pembiayaanKeys = array_keys($pembiayaanData);
|
||||
$pembiayaan = array_values($pembiayaanData);
|
||||
|
||||
$marginKeys = array_keys($marginData);
|
||||
$margin = array_values($marginData);
|
||||
|
||||
$jenisPembiayaanKeys = array_keys($jenisPembiayaanData);
|
||||
$jenisPembiayaan = array_values($jenisPembiayaanData);
|
||||
|
||||
// Labels for jenis pembiayaan
|
||||
$jenisLabels = [
|
||||
'pembiayaanbaru' => 'Pembiayaan Baru',
|
||||
'pembiayaansemula' => 'Pembiayaan Semula',
|
||||
'lelongan' => 'Lelongan'
|
||||
];
|
||||
|
||||
// Check if there's any data at all
|
||||
$hasAnyData = count($bangsaData) > 0 || count($pekerjaanData) > 0 ||
|
||||
count($marhunData) > 0 || count($pembiayaanData) > 0 ||
|
||||
count($marginData) > 0 || count($jenisPembiayaanData) > 0;
|
||||
@endphp
|
||||
|
||||
@if($hasAnyData)
|
||||
@for($i = 0; $i < $maxRows; $i++)
|
||||
<tr>
|
||||
{{-- Bangsa: Nama | Jumlah --}}
|
||||
<td>{{ $bangsaKeys[$i] ?? '-' }}</td>
|
||||
<td>{{ $bangsa[$i] ?? '-' }}</td>
|
||||
|
||||
{{-- Pekerjaan: Jenis | Jumlah --}}
|
||||
<td>{{ $pekerjaanKeys[$i] ?? '-' }}</td>
|
||||
<td>{{ $pekerjaan[$i] ?? '-' }}</td>
|
||||
|
||||
{{-- Nilai Marhun: RM | Berat (g) --}}
|
||||
<td>{{ $marhunKeys[$i] ?? '-' }}</td>
|
||||
<td>{{ isset($marhun[$i]) ? number_format($marhun[$i]) : '-' }}</td>
|
||||
|
||||
{{-- Pembiayaan: RM | Bil --}}
|
||||
<td>{{ $pembiayaanKeys[$i] ?? '-' }}</td>
|
||||
<td>{{ isset($pembiayaan[$i]) ? number_format($pembiayaan[$i]) : '-' }}</td>
|
||||
|
||||
{{-- Pembiayaan Margin: RM | % --}}
|
||||
<td>{{ $marginKeys[$i] ?? '-' }}</td>
|
||||
<td>{{ isset($margin[$i]) ? number_format($margin[$i]) : '-' }}</td>
|
||||
|
||||
{{-- Jenis Pembiayaan: Jenis | Bil --}}
|
||||
<td>
|
||||
@if(isset($jenisPembiayaanKeys[$i]))
|
||||
{{ $jenisLabels[$jenisPembiayaanKeys[$i]] ?? ucfirst($jenisPembiayaanKeys[$i]) }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $jenisPembiayaan[$i] ?? '-' }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
@else
|
||||
{{-- Show "Not Available" if no data at all --}}
|
||||
<tr>
|
||||
<td colspan="12" style="text-align: center; color: #999; font-style: italic;">
|
||||
Not Available
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user