Merge branch 'main' of https://bitbucket.org/arrahn-pkb/admin-portal into feature/nisha/wtd-new
This commit is contained in:
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromView;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
|
class GadaianDetailExport implements FromView
|
||||||
|
{
|
||||||
|
protected $kodcaw;
|
||||||
|
protected $startDate;
|
||||||
|
protected $endDate;
|
||||||
|
|
||||||
|
public function __construct($kodcaw, $startDate, $endDate)
|
||||||
|
{
|
||||||
|
$this->kodcaw = $kodcaw;
|
||||||
|
$this->startDate = $startDate;
|
||||||
|
$this->endDate = $endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$generatedAt = now()->format('d-m-Y');
|
||||||
|
|
||||||
|
$data = Http::get(config('api.url') . '/api/reports/saringan/gadaian', [
|
||||||
|
'startDate' => $this->startDate,
|
||||||
|
'endDate' => $this->endDate,
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
$branch = collect($data)->firstWhere('kodcaw', $this->kodcaw);
|
||||||
|
$details = collect($branch['details'] ?? []);
|
||||||
|
|
||||||
|
$tgb_lelong = $details->where('jenis', 'TGB_LELONG')->values();
|
||||||
|
$tgb_biasa = $details->where('jenis', 'TGB_BIASA')->values();
|
||||||
|
$gadai_biasa = $details->where('jenis', 'GADAI_BIASA')->values();
|
||||||
|
|
||||||
|
$subtotal = [
|
||||||
|
'tgb_lelong' => [
|
||||||
|
'berat' => $tgb_lelong->sum('berat'),
|
||||||
|
'nilai' => $tgb_lelong->sum('nilaimarhun'),
|
||||||
|
'pinjaman' => $tgb_lelong->sum('pinjaman'),
|
||||||
|
],
|
||||||
|
'tgb_biasa' => [
|
||||||
|
'berat' => $tgb_biasa->sum('berat'),
|
||||||
|
'nilai' => $tgb_biasa->sum('nilaimarhun'),
|
||||||
|
'pinjaman' => $tgb_biasa->sum('pinjaman'),
|
||||||
|
],
|
||||||
|
'gadai_biasa' => [
|
||||||
|
'berat' => $gadai_biasa->sum('berat'),
|
||||||
|
'nilai' => $gadai_biasa->sum('nilaimarhun'),
|
||||||
|
'pinjaman' => $gadai_biasa->sum('pinjaman'),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$grandTotal = [
|
||||||
|
'berat' => $subtotal['tgb_lelong']['berat']
|
||||||
|
+ $subtotal['tgb_biasa']['berat']
|
||||||
|
+ $subtotal['gadai_biasa']['berat'],
|
||||||
|
|
||||||
|
'nilai' => $subtotal['tgb_lelong']['nilai']
|
||||||
|
+ $subtotal['tgb_biasa']['nilai']
|
||||||
|
+ $subtotal['gadai_biasa']['nilai'],
|
||||||
|
|
||||||
|
'pinjaman' => $subtotal['tgb_lelong']['pinjaman']
|
||||||
|
+ $subtotal['tgb_biasa']['pinjaman']
|
||||||
|
+ $subtotal['gadai_biasa']['pinjaman'],
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('reports.saringan-gadaian.excel', compact(
|
||||||
|
'branch',
|
||||||
|
'generatedAt',
|
||||||
|
'tgb_lelong',
|
||||||
|
'tgb_biasa',
|
||||||
|
'gadai_biasa',
|
||||||
|
'subtotal',
|
||||||
|
'grandTotal'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
<?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 SaringanGadaianController 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/reports/saringan/gadaian', [
|
||||||
|
'startDate' => $startDate,
|
||||||
|
'endDate' => $endDate,
|
||||||
|
])->json();
|
||||||
|
|
||||||
|
return view('reports.saringan-gadaian.index', compact('gadaian', 'startDate', 'endDate'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exportExcel(Request $request, $kodcaw)
|
||||||
|
{
|
||||||
|
return Excel::download(
|
||||||
|
new GadaianDetailExport(
|
||||||
|
$kodcaw,
|
||||||
|
$request->startDate,
|
||||||
|
$request->endDate
|
||||||
|
),
|
||||||
|
"Saringan_Gadaian_{$kodcaw}.xlsx"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,14 +14,35 @@
|
|||||||
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
||||||
<div class="w-1/3">Jumlah WTD</div>
|
<div class="w-1/3">Jumlah WTD</div>
|
||||||
<div>:</div>
|
<div>:</div>
|
||||||
<div class="ml-2 w-1/3"><b>RM {{ formattext(sb.baki) }} </b></div>
|
<!-- <div class="flex items-center ml-2 w-1/3"><b>RM {{ formattext(sb.baki) }} </b></div> -->
|
||||||
|
<div class="flex items-baseline ml-2 w-1/3">
|
||||||
|
<span class="text-sm mr-1">RM</span><span class="text-lg font-bold">{{ formattext(sb.baki) }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
||||||
<div class="w-1/3">Tarikh Proses WTD
|
<div class="w-1/3">Tahun Lelong
|
||||||
|
</div>
|
||||||
|
<div>:</div>
|
||||||
|
<div class="ml-2 w-1/3"><b> {{ (sb.tahun) ? sb.tahun : 'Tiada' }} </b></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
||||||
|
<div class="w-1/3">Bulan Lelong
|
||||||
|
</div>
|
||||||
|
<div>:</div>
|
||||||
|
<div class="ml-2 w-1/3"><b> {{ (sb.bulan) ? sb.bulan : 'Tiada' }} </b></div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
||||||
|
<div class="w-1/3">Tarikh Proses
|
||||||
</div>
|
</div>
|
||||||
<div>:</div>
|
<div>:</div>
|
||||||
<div class="ml-2 w-1/3"><b> {{ (sb.t_jual) ? sb.t_jual : 'Tiada' }} </b></div>
|
<div class="ml-2 w-1/3"><b> {{ (sb.t_jual) ? sb.t_jual : 'Tiada' }} </b></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
||||||
|
<div class="w-1/3">Tarikh Hantar
|
||||||
|
</div>
|
||||||
|
<div>:</div>
|
||||||
|
<div class="ml-2 w-1/3"><b> {{ (sb.t_htr_ag) ? sb.t_htr_ag : 'Tiada' }} </b></div>
|
||||||
|
</div>
|
||||||
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
<div class="flex flex-row font-normal text-gray-700 dark:text-gray-400">
|
||||||
<div class="w-1/3">Status
|
<div class="w-1/3">Status
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<button @click.prevent="promptdeletewtd" :disabled="aktif == 1" :class="{'hover:bg-red-600 bg-red-600 border-red-600': aktif == 0}" class="border border-red-300 text-white bg-red-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300"><i class="fas fa-trash-alt"></i></button>
|
<button @click.prevent="promptdeletewtd" :disabled="aktif == 1" :class="{'hover:bg-red-600 bg-red-600 border-red-600': aktif == 0}" class="border border-red-300 text-white bg-red-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300"><i class="fas fa-trash-alt"></i></button>
|
||||||
<button @click.prevent="promptwtd" :disabled="aktif == 1" :class="{'hover:bg-yellow-600 bg-yellow-600 border-yellow-600': aktif == 0}" class="border border-yellow-300 text-white bg-yellow-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300">Proses WTD</button>
|
<button @click.prevent="promptwtd" :disabled="aktif == 1" :class="{'hover:bg-yellow-600 bg-yellow-600 border-yellow-600': aktif == 0}" class="border border-yellow-300 text-white bg-yellow-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300">Serahan WTD</button>
|
||||||
<span v-if="batchno != 0" class="text-lg font-bold ml-3">Batchno: {{ this.batchno }}</span>
|
<span v-if="batchno != 0" class="text-lg font-bold ml-3">Batchno: {{ this.batchno }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,9 +38,9 @@
|
|||||||
<th scope="col" class="px-6 py-3">
|
<th scope="col" class="px-6 py-3">
|
||||||
Tarikh Lelong
|
Tarikh Lelong
|
||||||
</th>
|
</th>
|
||||||
<th scope="col" class="px-6 py-3">
|
<!-- <th scope="col" class="px-6 py-3">
|
||||||
Pembiayaan
|
Pembiayaan
|
||||||
</th>
|
</th> -->
|
||||||
<th scope="col" class="px-6 py-3">
|
<th scope="col" class="px-6 py-3">
|
||||||
Baki
|
Baki
|
||||||
</th>
|
</th>
|
||||||
@@ -60,9 +60,9 @@
|
|||||||
<td class="px-6 py-4">
|
<td class="px-6 py-4">
|
||||||
{{ bl.t_jual }}
|
{{ bl.t_jual }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4">
|
<!-- <td class="px-6 py-4">
|
||||||
{{ formattext(bl.pinjaman) }}
|
{{ formattext(bl.pinjaman) }}
|
||||||
</td>
|
</td> -->
|
||||||
<td class="px-6 py-4">
|
<td class="px-6 py-4">
|
||||||
{{ formattext(bl.baki) }}
|
{{ formattext(bl.baki) }}
|
||||||
</td>
|
</td>
|
||||||
@@ -103,7 +103,7 @@ export default {
|
|||||||
kodcaw: this.$kodcaw,
|
kodcaw: this.$kodcaw,
|
||||||
}
|
}
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
console.log(response);
|
//console.log(response);
|
||||||
this.arraybakilelong = response.data;
|
this.arraybakilelong = response.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -153,7 +153,7 @@ export default {
|
|||||||
|
|
||||||
if (boolkatalaluan == 1) {
|
if (boolkatalaluan == 1) {
|
||||||
await this.$swal({
|
await this.$swal({
|
||||||
title: 'Proses WTD?',
|
title: 'Serahan WTD?',
|
||||||
text: "anda tidak boleh ulang kembali setelah di proses!",
|
text: "anda tidak boleh ulang kembali setelah di proses!",
|
||||||
icon: 'warning',
|
icon: 'warning',
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
@@ -165,16 +165,59 @@ export default {
|
|||||||
|
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
|
|
||||||
|
//new added
|
||||||
this.$swal({
|
this.$swal({
|
||||||
title: "Masukkan No Cek:",
|
title: 'Sila Isi Butiran Berikut',
|
||||||
// text: "Write something interesting:",
|
html: `
|
||||||
input: 'text',
|
<div class="swal-form">
|
||||||
showCancelButton: true
|
<div class="swal-row">
|
||||||
}).then((result) => {
|
<label>No Cek</label>
|
||||||
if (result.value) {
|
<input id="noCek" class="swal2-input" placeholder="Masukkan No Cek">
|
||||||
this.proseswtd(result.value);
|
</div>
|
||||||
}
|
|
||||||
});
|
<div class="swal-row">
|
||||||
|
<label>Tarikh Hantar ke AG</label>
|
||||||
|
<input
|
||||||
|
id="tarikhAG"
|
||||||
|
type="date"
|
||||||
|
class="swal2-input"
|
||||||
|
max="${new Date().toISOString().split('T')[0]}"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
focusConfirm: false,
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: 'Simpan',
|
||||||
|
cancelButtonText: 'Batal',
|
||||||
|
|
||||||
|
customClass: {
|
||||||
|
popup: 'swal-popup',
|
||||||
|
confirmButton: 'swal-confirm',
|
||||||
|
cancelButton: 'swal-cancel'
|
||||||
|
},
|
||||||
|
|
||||||
|
preConfirm: () => {
|
||||||
|
const noCek = document.getElementById('noCek').value.trim();
|
||||||
|
const tarikhAG = document.getElementById('tarikhAG').value;
|
||||||
|
|
||||||
|
if (!noCek || !tarikhAG) {
|
||||||
|
this.$swal.showValidationMessage(
|
||||||
|
'Sila masukkan No Cek dan Tarikh Hantar ke AG'
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return { noCek, tarikhAG };
|
||||||
|
}
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
this.proseswtd(result.value.noCek, result.value.tarikhAG);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//end new added
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -197,11 +240,12 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
proseswtd: function (nocek) {
|
proseswtd: function (nocek,tarikhAG) {
|
||||||
this.axios.post(this.$hostname + '/admin/wtd/process', {
|
this.axios.post(this.$hostname + '/admin/wtd/process', {
|
||||||
kodcaw: this.$kodcaw,
|
kodcaw: this.$kodcaw,
|
||||||
batch: this.batchno,
|
batch: this.batchno,
|
||||||
nocek: nocek
|
nocek: nocek,
|
||||||
|
tarikhAG: tarikhAG
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
|
|
||||||
if (response.data == 'success') {
|
if (response.data == 'success') {
|
||||||
|
|||||||
@@ -104,6 +104,12 @@
|
|||||||
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Transaksi Segera(By Masa)</h2>
|
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Transaksi Segera(By Masa)</h2>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</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">
|
||||||
|
<a href="{{ route('reports.saringan-gadaian.index', ['startDate' => now()->toDateString(), 'endDate' => now()->toDateString()]) }}" class="">
|
||||||
|
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Saringan Gadaian</h2>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,176 @@
|
|||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" style="font-weight:bold; font-size:16px; text-align:center;">
|
||||||
|
LAPORAN SARINGAN PEMBIAYAAN
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" style="text-align:center;">
|
||||||
|
Cawangan : {{ $branch['details_caw'] ?? '-' }} ({{ $branch['kodcaw'] ?? '-' }})
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" style="text-align:center;">
|
||||||
|
Tempoh : {{ request()->startDate }} hingga {{ request()->endDate }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" style="text-align:center;">
|
||||||
|
Tarikh Dijana : {{ $generatedAt }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
<table border="1">
|
||||||
|
<thead>
|
||||||
|
<tr style="font-weight:bold; background:#f3f3f3;">
|
||||||
|
<th>Bil</th>
|
||||||
|
<th>No Rujukan Tebus</th>
|
||||||
|
<th>No Rujukan Gadai Balik</th>
|
||||||
|
<th>No KP</th>
|
||||||
|
<th>Berat (g)</th>
|
||||||
|
<th>Nilai Marhun (RM)</th>
|
||||||
|
<th>Pinjaman (RM)</th>
|
||||||
|
<th>Tag Lelong</th>
|
||||||
|
<th>Tarikh Gadai</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
{{-- ================= TGB LELONG ================= --}}
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" style="font-weight:bold;">TGB LELONG</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$bil = 1;
|
||||||
|
$subBerat = $subNM = $subPinjam = 0;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@foreach ($tgb_lelong as $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $bil++ }}</td>
|
||||||
|
<td>{{ $item['norujukan_tebus'] ?? null }}</td>
|
||||||
|
<td>{{ $item['norujukan_gadai_balik'] ?? null }}</td>
|
||||||
|
<td>{{ $item['nokp'] ?? null }}</td>
|
||||||
|
<td>{{ $item['berat'] ?? 0 }}</td>
|
||||||
|
<td>{{ $item['nilaimarhun'] ?? 0 }}</td>
|
||||||
|
<td>{{ $item['pinjaman'] ?? 0 }}</td>
|
||||||
|
<td>Ya</td>
|
||||||
|
<td>{{ $item['t_gadai'] ?? null }}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$subBerat += $item['berat'] ?? 0;
|
||||||
|
$subNM += $item['nilaimarhun'] ?? 0;
|
||||||
|
$subPinjam += $item['pinjaman'] ?? 0;
|
||||||
|
@endphp
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<tr style="font-weight:bold;">
|
||||||
|
<td colspan="4">Subtotal</td>
|
||||||
|
<td>{{ number_format($subBerat, 2) }}</td>
|
||||||
|
<td>{{ number_format($subNM, 2) }}</td>
|
||||||
|
<td>{{ number_format($subPinjam, 2) }}</td>
|
||||||
|
<td colspan="2"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{{-- ================= TGB BIASA ================= --}}
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" style="font-weight:bold;">TGB BIASA</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$bil = 1;
|
||||||
|
$subBerat = $subNM = $subPinjam = 0;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@foreach ($tgb_biasa as $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $bil++ }}</td>
|
||||||
|
<td>{{ $item['norujukan_tebus'] ?? null }}</td>
|
||||||
|
<td>{{ $item['norujukan_gadai_balik'] ?? null }}</td>
|
||||||
|
<td>{{ $item['nokp'] ?? null }}</td>
|
||||||
|
<td>{{ $item['berat'] ?? 0 }}</td>
|
||||||
|
<td>{{ $item['nilaimarhun'] ?? 0 }}</td>
|
||||||
|
<td>{{ $item['pinjaman'] ?? 0 }}</td>
|
||||||
|
<td>Tidak</td>
|
||||||
|
<td>{{ $item['t_gadai'] ?? null }}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$subBerat += $item['berat'] ?? 0;
|
||||||
|
$subNM += $item['nilaimarhun'] ?? 0;
|
||||||
|
$subPinjam += $item['pinjaman'] ?? 0;
|
||||||
|
@endphp
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<tr style="font-weight:bold;">
|
||||||
|
<td colspan="4">Subtotal</td>
|
||||||
|
<td>{{ number_format($subBerat, 2) }}</td>
|
||||||
|
<td>{{ number_format($subNM, 2) }}</td>
|
||||||
|
<td>{{ number_format($subPinjam, 2) }}</td>
|
||||||
|
<td colspan="2"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{{-- ================= GADAI BIASA ================= --}}
|
||||||
|
<tr>
|
||||||
|
<td colspan="9" style="font-weight:bold;">GADAI BIASA</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$bil = 1;
|
||||||
|
$subBerat = $subNM = $subPinjam = 0;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@foreach ($gadai_biasa as $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $bil++ }}</td>
|
||||||
|
<td></td>
|
||||||
|
<td>{{ $item['norujukan_gadai_balik'] ?? null }}</td>
|
||||||
|
<td>{{ $item['nokp'] ?? null }}</td>
|
||||||
|
<td>{{ $item['berat'] ?? 0 }}</td>
|
||||||
|
<td>{{ $item['nilaimarhun'] ?? 0 }}</td>
|
||||||
|
<td>{{ $item['pinjaman'] ?? 0 }}</td>
|
||||||
|
<td></td>
|
||||||
|
<td>{{ $item['t_gadai'] ?? null }}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$subBerat += $item['berat'] ?? 0;
|
||||||
|
$subNM += $item['nilaimarhun'] ?? 0;
|
||||||
|
$subPinjam += $item['pinjaman'] ?? 0;
|
||||||
|
@endphp
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
<tr style="font-weight:bold;">
|
||||||
|
<td colspan="4">Subtotal</td>
|
||||||
|
<td>{{ number_format($subBerat, 2) }}</td>
|
||||||
|
<td>{{ number_format($subNM, 2) }}</td>
|
||||||
|
<td>{{ number_format($subPinjam, 2) }}</td>
|
||||||
|
<td colspan="2"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" style="font-weight:bold; background:#eee;">
|
||||||
|
JUMLAH KESELURUHAN
|
||||||
|
</td>
|
||||||
|
<td style="font-weight:bold;">
|
||||||
|
{{ number_format($grandTotal['berat'], 2) }}
|
||||||
|
</td>
|
||||||
|
<td style="font-weight:bold;">
|
||||||
|
{{ number_format($grandTotal['nilai'], 2) }}
|
||||||
|
</td>
|
||||||
|
<td style="font-weight:bold;">
|
||||||
|
{{ number_format($grandTotal['pinjaman'], 2) }}
|
||||||
|
</td>
|
||||||
|
<td colspan="2"></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
@@ -0,0 +1,234 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="bg-gray-900 opacity-50 hidden fixed inset-0 z-10" id="sidebarBackdrop"></div>
|
||||||
|
<div id="main-content" class="h-full w-full bg-gray-50 relative overflow-y-auto">
|
||||||
|
<main>
|
||||||
|
|
||||||
|
<div class="pt-6 px-4">
|
||||||
|
|
||||||
|
<breadcrumb
|
||||||
|
:items="[{ 'title': 'Laporan Keseluruhan', 'icon': 'fas fa-users', 'url': '{{ route('reports') }}' },
|
||||||
|
{ 'title': 'Gadaian', 'icon': 'fas fa-users' }
|
||||||
|
]">
|
||||||
|
</breadcrumb>
|
||||||
|
|
||||||
|
<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"><a href="/reports"
|
||||||
|
class="router-link-active"><i class="fas fa-backspace text-white"></i></a> <span
|
||||||
|
class="text-center mx-auto text-white font-bold">Laporan Saringan Pembiayaan</span>
|
||||||
|
</div>
|
||||||
|
<form method="get" id="formgadaian" action="{{ route('reports.saringan-gadaian.index') }}">
|
||||||
|
<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">
|
||||||
|
<span
|
||||||
|
class="text-gray-600 border border-2 rounded-l px-4 py-2 whitespace-no-wrap"
|
||||||
|
style="background-color: rgb(249, 250, 251);">Mula</span>
|
||||||
|
<input id="tarikhmula" name="startDate" type="date"
|
||||||
|
value="{{ request()->startDate ?? $startDate }}"
|
||||||
|
class="border border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2">
|
||||||
|
<span
|
||||||
|
class="text-gray-600 border border-2 rounded-l px-4 py-2 whitespace-no-wrap"
|
||||||
|
style="background-color: rgb(249, 250, 251);">Hingga</span>
|
||||||
|
<input id="tarikhhingga" name="endDate" type="date"
|
||||||
|
value="{{ request()->endDate ?? $endDate }}"
|
||||||
|
class="border border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2">
|
||||||
|
<button
|
||||||
|
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 ml-5">
|
||||||
|
<i class="fas fa-magnifying-glass mr-2"></i>Search
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div kodcaw="operasi">
|
||||||
|
<div>
|
||||||
|
<!---->
|
||||||
|
<!---->
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<!---->
|
||||||
|
<!---->
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-between mb-2">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="min-w-full leading-normal">
|
||||||
|
<thead class="text-center">
|
||||||
|
<tr>
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
No
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Kod Cawangan
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Cawangan
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Jumlah Surat
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
TGB Lelong
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
TGB Biasa
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Gadai Biasa
|
||||||
|
</th>
|
||||||
|
|
||||||
|
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Berat (g)
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Nilai Marhun(RM)
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Pinjaman(RM)
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
|
||||||
|
Action
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$totalbilgadai = 0; // jumlah semua surat
|
||||||
|
$total_tgb_lelong = 0;
|
||||||
|
$total_tgb_biasa = 0;
|
||||||
|
$total_gadai_biasa = 0;
|
||||||
|
$totalberat = 0;
|
||||||
|
$totalnm = 0;
|
||||||
|
$totalpinjaman = 0;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@forelse ($gadaian as $gadai)
|
||||||
|
@php
|
||||||
|
// Jumlah semua surat
|
||||||
|
$totalbilgadai += $gadai['jumlah_surat'] ?? 0;
|
||||||
|
|
||||||
|
// Jumlah per kategori
|
||||||
|
$total_tgb_lelong += $gadai['total_tgb_lelong'] ?? 0;
|
||||||
|
$total_tgb_biasa += $gadai['total_tgb_biasa'] ?? 0;
|
||||||
|
$total_gadai_biasa += $gadai['total_gadai_biasa'] ?? 0;
|
||||||
|
|
||||||
|
// Jumlah nilai
|
||||||
|
$totalberat += $gadai['sum_berat'] ?? 0;
|
||||||
|
$totalnm += $gadai['sum_nilai_marhun'] ?? 0;
|
||||||
|
$totalpinjaman += $gadai['sum_pinjaman'] ?? 0;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ $loop->iteration }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ $gadai['kodcaw'] }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ $gadai['details_caw'] }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ $gadai['jumlah_surat'] }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ $gadai['total_tgb_lelong'] }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ $gadai['total_tgb_biasa'] }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ $gadai['total_gadai_biasa'] }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ number_format($gadai['sum_berat'], 2) }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ number_format($gadai['sum_nilai_marhun'], 2) }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">{{ number_format($gadai['sum_pinjaman'], 2) }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
<div class="ml-3">
|
||||||
|
<a href="{{ route('reports.gadaian.cawangan.excel', [$gadai['kodcaw'], 'startDate' => request()->startDate, 'endDate' => request()->endDate]) }}"
|
||||||
|
target="_blank" rel="noopener noreferrer"
|
||||||
|
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">
|
||||||
|
<i class="fas fa-download mr-2"></i>Download
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td colspan="11"
|
||||||
|
class="px-5 py-5 border-b border-gray-200 bg-white text-sm text-center">
|
||||||
|
Data not available
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
Jumlah Keseluruhan
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
{{ $totalbilgadai }}
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
{{ $total_tgb_lelong }}
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
{{ $total_tgb_biasa }}
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
{{ $total_gadai_biasa }}
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
{{ number_format($totalberat, 2) }}
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
{{ number_format($totalnm, 2) }}
|
||||||
|
</td>
|
||||||
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
|
||||||
|
{{ number_format($totalpinjaman, 2) }}
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
@include('layouts.footer')
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="pt-6 px-4">
|
<div class="pt-6 px-4">
|
||||||
<breadcrumb :items="[{ 'title' : 'Wang Tak Dituntut', 'icon' : 'fas fa-gavel' }]"></breadcrumb>
|
<breadcrumb :items="[{ 'title' : 'Wang Tak Dituntut', 'icon' : 'fas fa-gavel' }]"></breadcrumb>
|
||||||
|
|
||||||
<wtdindex-component></wtd-component>
|
<wtdindex-component></wtdindex-component>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@dd($senaraiSimulasi);
|
{{-- @dd($senaraiSimulasi); --}}
|
||||||
@foreach ($senaraiSimulasi as $index => $item)
|
@foreach ($senaraiSimulasi as $index => $item)
|
||||||
<input type="hidden" name="tahun" value="{{ $year }}"/>
|
<input type="hidden" name="tahun" value="{{ $year }}"/>
|
||||||
<tr class="{{ $index % 2 == 0 ? 'bg-gray-100' : 'bg-white' }}">
|
<tr class="{{ $index % 2 == 0 ? 'bg-gray-100' : 'bg-white' }}">
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use App\Http\Controllers\Reports\OutstandingController;
|
|||||||
use App\Http\Controllers\Reports\PetibesiController;
|
use App\Http\Controllers\Reports\PetibesiController;
|
||||||
use App\Http\Controllers\Reports\AnalisaController;
|
use App\Http\Controllers\Reports\AnalisaController;
|
||||||
use App\Http\Controllers\Reports\BakiLelongController;
|
use App\Http\Controllers\Reports\BakiLelongController;
|
||||||
|
use App\Http\Controllers\SaringanGadaianController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->group(function () {
|
Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->group(function () {
|
||||||
@@ -45,4 +46,7 @@ Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->gro
|
|||||||
Route::get('gadaitebus', [GadaianController::class, 'gadaitebus'])->name('reports.gadaitebus.index');
|
Route::get('gadaitebus', [GadaianController::class, 'gadaitebus'])->name('reports.gadaitebus.index');
|
||||||
Route::get('gadaitebusmasa', [GadaianController::class, 'gadaitebusmasa'])->name('reports.gadaitebusmasa.index');
|
Route::get('gadaitebusmasa', [GadaianController::class, 'gadaitebusmasa'])->name('reports.gadaitebusmasa.index');
|
||||||
Route::get('gadaitebusmasa/{kod_cawangan}', [GadaianController::class, 'downloadGadaiTebusMasaCawanganExcel'])->name('reports.gadaitebusmasa.cawangan.excel');
|
Route::get('gadaitebusmasa/{kod_cawangan}', [GadaianController::class, 'downloadGadaiTebusMasaCawanganExcel'])->name('reports.gadaitebusmasa.cawangan.excel');
|
||||||
|
|
||||||
|
Route::get('saringan-gadaian-index', [SaringanGadaianController::class, 'index'])->name('reports.saringan-gadaian.index');
|
||||||
|
Route::get('saringan-gadaian-excel/{kodcaw}', [SaringanGadaianController::class, 'exportExcel'])->name('reports.gadaian.cawangan.excel');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user