Compare commits
197 Commits
5a6cf46f9e
...
5f9ebc3b13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f9ebc3b13 | ||
|
|
9210cae2db | ||
|
|
950c547045 | ||
|
|
ed8a60aa53 | ||
|
|
68f8059745 | ||
|
|
f14a0c6343 | ||
|
|
c00b21cfda | ||
|
|
a3b3793fcd | ||
|
|
a5bd5417b7 | ||
|
|
addbfde055 | ||
|
|
ff928b6257 | ||
|
|
eb8b67a11f | ||
|
|
fde792e56c | ||
|
|
67cffeb4af | ||
|
|
417f451ec9 | ||
|
|
1e485014f6 | ||
|
|
e0691aa1b3 | ||
|
|
c863a96214 | ||
|
|
01de1b5b5e | ||
|
|
72f7a13897 | ||
|
|
e2465c98fa | ||
|
|
ad5181f22e | ||
|
|
a12c566fbd | ||
|
|
b692ba87f8 | ||
|
|
bea0c2cf78 | ||
|
|
df3e59e5c6 | ||
|
|
6e9006838d | ||
|
|
ef7a47ebb9 | ||
|
|
727c7a0dca | ||
|
|
5a8b93b5f7 | ||
|
|
06e12225b2 | ||
|
|
059f58842e | ||
|
|
ce792474c6 | ||
|
|
ea4d784182 | ||
|
|
446703e9f3 | ||
|
|
28f3b83695 | ||
|
|
73f0dd4dd6 | ||
|
|
900de88ddd | ||
|
|
25e7016486 | ||
|
|
b79b65ea6c | ||
|
|
f864c227de | ||
|
|
559c02afb1 | ||
|
|
ac667c2862 | ||
|
|
02d5e88a4e | ||
|
|
16a321c27b | ||
|
|
bd801d3235 | ||
|
|
3dcf833035 | ||
|
|
de6e7ad732 | ||
|
|
18b1e37cee | ||
|
|
e8e86186e7 | ||
|
|
2573616612 | ||
|
|
8d1dacb334 | ||
|
|
06ea38fa5f | ||
|
|
ee0419578e | ||
|
|
2210f41337 | ||
|
|
106fd2514b | ||
|
|
1ac775c224 | ||
|
|
4464943dd0 | ||
|
|
c572f061e3 | ||
|
|
c8a1e401c8 | ||
|
|
117e82765c | ||
|
|
c37ac7e120 | ||
|
|
2043335042 | ||
|
|
ac9c5f8666 | ||
|
|
ca11e59ae1 | ||
|
|
83203bf43a | ||
|
|
b2a4aca049 | ||
|
|
73bbd87bfb | ||
|
|
08cc816fb6 | ||
|
|
a2cd9a4e55 | ||
|
|
4b8a080ed5 | ||
|
|
9d0e2225a3 | ||
|
|
39dabbaeb5 | ||
|
|
33667ede21 | ||
|
|
f068c6b2d1 | ||
|
|
b29998bcbc | ||
|
|
9619b74695 | ||
|
|
7d7e19cdce | ||
|
|
c77a95addf | ||
|
|
a87bec22d0 | ||
|
|
340dce7ed7 | ||
|
|
d52edb9481 | ||
|
|
5932192d92 | ||
|
|
211e44f804 | ||
|
|
bc281e3512 | ||
|
|
3101cca619 | ||
|
|
a9edbe6838 | ||
|
|
a227b8ec29 | ||
|
|
0976794aa2 | ||
|
|
b24f55e4b4 | ||
|
|
ef5ae2e161 | ||
|
|
e546c5241d | ||
|
|
e3f668fdc8 | ||
|
|
0956f5a4a9 | ||
|
|
935529562a | ||
|
|
ad3dce4922 | ||
|
|
a29e72f5cc | ||
|
|
0c33c1e070 | ||
|
|
5300254a6d | ||
|
|
d16c625991 | ||
|
|
dd46a02626 | ||
|
|
03d28479c4 | ||
|
|
7398753351 | ||
|
|
16a805e853 | ||
|
|
e1bb30c768 | ||
|
|
32c4c7e57b | ||
|
|
ae59500b1e | ||
|
|
69de63648f | ||
|
|
50ce815ac1 | ||
|
|
3c7302c857 | ||
|
|
3e9d9e3769 | ||
|
|
3f8ea222e1 | ||
|
|
1376a92020 | ||
|
|
f12432dfc5 | ||
|
|
796b6fab92 | ||
|
|
cf6e008502 | ||
|
|
426ca5ebb2 | ||
|
|
345cbbe22c | ||
|
|
b319abbabb | ||
|
|
85711db4d5 | ||
|
|
3e6613f955 | ||
|
|
69e888c6d4 | ||
|
|
e830ededf2 | ||
|
|
d089419cfb | ||
|
|
f7c85fc24e | ||
|
|
5d380f1a68 | ||
|
|
a048bea26e | ||
|
|
dc98c7dd63 | ||
|
|
6a188e1983 | ||
|
|
704f52392f | ||
|
|
5fa6f2c9ef | ||
|
|
2cba48afa9 | ||
|
|
ec457b24b7 | ||
|
|
50babb212f | ||
|
|
a1e98090a8 | ||
|
|
f9764b6819 | ||
|
|
99343fee34 | ||
|
|
1474f6af74 | ||
|
|
d37ebeff3c | ||
|
|
2c3f507c03 | ||
|
|
d9c8e380f2 | ||
|
|
876dd3fbe8 | ||
|
|
e56ed2f0aa | ||
|
|
7cc75c56ae | ||
|
|
bf71037516 | ||
|
|
0289eb35a2 | ||
|
|
d4e46594c4 | ||
|
|
5c6b22c122 | ||
|
|
cf278e0fd6 | ||
|
|
d4ce908394 | ||
|
|
bd391bacec | ||
|
|
adbe57e709 | ||
|
|
dd5271a40b | ||
|
|
38b22bce38 | ||
|
|
ff4d48704f | ||
|
|
0933a874dc | ||
|
|
14ac13551b | ||
|
|
90be8d5730 | ||
|
|
6814113cbf | ||
|
|
65bfa9eeec | ||
|
|
3f3c384f9a | ||
|
|
73d76a000d | ||
|
|
e9ec75219a | ||
|
|
50029c6b07 | ||
|
|
40fc1166ba | ||
|
|
dd5f0f94b5 | ||
|
|
1a770820cf | ||
|
|
93c5058afa | ||
|
|
3ac83aa7fe | ||
|
|
16aabd5da0 | ||
|
|
6d925bb15b | ||
|
|
23afbc7ece | ||
|
|
81727e0f52 | ||
|
|
976dab7566 | ||
|
|
05bf9e2af0 | ||
|
|
d813fb10e1 | ||
|
|
4a05b9e903 | ||
|
|
42ed13e0ef | ||
|
|
74872076e4 | ||
|
|
cc28ace415 | ||
|
|
e52fd8243f | ||
|
|
1aeb96f8b5 | ||
|
|
14d6052c4e | ||
|
|
f1f345707a | ||
|
|
0bca2e2bf2 | ||
|
|
dd7df6f898 | ||
|
|
5c7c4ce739 | ||
|
|
cf45ac7cbe | ||
|
|
107726efe7 | ||
|
|
3ba43b8579 | ||
|
|
fe3b1bebce | ||
|
|
ad3ef0883b | ||
|
|
8d696cd51a | ||
|
|
e12114c3e4 | ||
|
|
16c799e512 | ||
|
|
ef035b76c0 | ||
|
|
4cec4f2e42 |
46
app/Exports/JenisLampiranExport.php
Normal file
46
app/Exports/JenisLampiranExport.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\app\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use Modules\Lpj\app\Models\JenisLampiran;
|
||||
|
||||
class JenisLampiranExport implements WithColumnFormatting, WithHeadings, FromCollection, WithMapping
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
return JenisLampiran::all();
|
||||
}
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
return [
|
||||
$row->id,
|
||||
$row->nama,
|
||||
$row->deskripsi,
|
||||
$row->created_at
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Nama',
|
||||
'Deskripsi',
|
||||
'Created At'
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_NUMBER,
|
||||
'D' => NumberFormat::FORMAT_DATE_DATETIME
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,8 @@ function checkActiveDateRangePenawaran($id)
|
||||
|
||||
$start_date = strtotime($penawaran->start_date);
|
||||
$end_date = strtotime($penawaran->end_date);
|
||||
// $todays_date = strtotime(now());
|
||||
$todays_date = strtotime("+1 day", strtotime(now()));
|
||||
$todays_date = strtotime(now());
|
||||
//$todays_date = strtotime("+1 day", strtotime(now()));
|
||||
|
||||
$allow = true;
|
||||
if ($todays_date >= $start_date && $todays_date <= $end_date) {
|
||||
@@ -293,7 +293,23 @@ function holidays()
|
||||
|
||||
function countPermohonanForUser($userId)
|
||||
{
|
||||
$validStatuses = ['assign', 'proses-laporan', 'done'];
|
||||
$validStatuses = [
|
||||
'assign',
|
||||
'survey-completed',
|
||||
'proses-laporan',
|
||||
'paparan',
|
||||
'proses-paparan',
|
||||
'revisi-laporan',
|
||||
'revisi-paparan',
|
||||
'survey',
|
||||
'proses-survey',
|
||||
'request-reschedule',
|
||||
'reschedule',
|
||||
'rejected-reschedule',
|
||||
'approved-reschedule',
|
||||
'revisi-survey',
|
||||
'revisi-pembayaran'
|
||||
];
|
||||
|
||||
$result = Penilaian::whereHas('userPenilai', function ($query) use ($userId) {
|
||||
$query->where('user_id', $userId);
|
||||
@@ -357,13 +373,19 @@ function checkRegionUserName($userId)
|
||||
}
|
||||
}
|
||||
|
||||
function getNomorLaporan($permohonanId, $documentId)
|
||||
function getNomorLaporan($permohonanId, $documentId, $type = 'nomor_laporan')
|
||||
{
|
||||
|
||||
$laporan = Laporan::where([
|
||||
'permohonan_id' => $permohonanId,
|
||||
'dokumen_jaminan_id' => $documentId,
|
||||
])->first();
|
||||
return $laporan->nomor_laporan ?? null;
|
||||
|
||||
if (!$laporan) {
|
||||
return $type == 'nomor_laporan' ? '-' : null;
|
||||
}
|
||||
|
||||
return $type == 'nomor_laporan' ? $laporan->nomor_laporan : $laporan->created_at;
|
||||
}
|
||||
|
||||
function getCustomField($param)
|
||||
@@ -412,3 +434,126 @@ function getWilayahName($code, $type)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function formatLabel($key)
|
||||
{
|
||||
|
||||
static $labelCache = [];
|
||||
if (isset($labelCache[$key])) {
|
||||
return $labelCache[$key];
|
||||
}
|
||||
|
||||
$customLabel = CustomField::where('name', $key)->first();
|
||||
$labelCache[$key] = $customLabel->label ?? ucwords(str_replace('_', ' ', $key));
|
||||
|
||||
return $labelCache[$key];
|
||||
}
|
||||
|
||||
function calculateSLA($permohonan, $type)
|
||||
{
|
||||
if (!$type) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$nilai_plafond = in_array($permohonan->nilai_plafond_id, [2, 3]);
|
||||
$nilai_plafond_2 = in_array($permohonan->nilai_plafond_id, [1]);
|
||||
|
||||
$slaMap = [
|
||||
'resume' => $nilai_plafond ? 2 : null,
|
||||
'paparan' => $nilai_plafond ? 2 : null,
|
||||
'standard' => $nilai_plafond ? 3 : null,
|
||||
'sederhana' => $nilai_plafond ? 2 : null,
|
||||
'paparan' => $nilai_plafond_2 ? 3 : null,
|
||||
'rap' => 3,
|
||||
'memo' => $nilai_plafond ? 1 : null
|
||||
];
|
||||
|
||||
if ($type === 'paparan' && isset($permohonan->tujuanPenilaian->name) && $permohonan->tujuanPenilaian->name === 'rap') {
|
||||
return 2;
|
||||
}
|
||||
|
||||
return $slaMap[$type] ?? null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Menghitung total nilai berdasarkan key dan jenis legalitas.
|
||||
*
|
||||
* @param array $detailsArray
|
||||
* @param string $key
|
||||
* @param int $jenisLegalitas
|
||||
* @return int
|
||||
*/
|
||||
function calculateTotalLuas($detailsArray, $key, $jenisLegalitas, $defaultJenisLegalitas)
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
if ($detailsArray) {
|
||||
foreach ($detailsArray as $item) {
|
||||
if (isset($item->jenis_legalitas_jaminan_id) && $item->jenis_legalitas_jaminan_id === $jenisLegalitas) {
|
||||
$details = json_decode($item->details, true);
|
||||
|
||||
if (is_array($details)) {
|
||||
foreach ($details as $detail) {
|
||||
if (isset($detail[$key])) {
|
||||
$total += (int) $detail[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Jika total masih 0, gunakan jenis jaminan ppjb
|
||||
if ($total === 0) {
|
||||
foreach ($detailsArray as $item) {
|
||||
if (isset($item->jenis_legalitas_jaminan_id) && $item->jenis_legalitas_jaminan_id === $defaultJenisLegalitas) {
|
||||
$details = json_decode($item->details, true);
|
||||
|
||||
if (is_array($details)) {
|
||||
foreach ($details as $detail) {
|
||||
if (isset($detail[$key]) && $detail[$key] !== null) {
|
||||
$total += (int) $detail[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// jika total masih kosong juga maka gunakan ppb
|
||||
if ($total === 0 && $fallbackJenisLegalitas !== null) {
|
||||
foreach ($detailsArray as $item) {
|
||||
if (isset($item->jenis_legalitas_jaminan_id) && $item->jenis_legalitas_jaminan_id === $fallbackJenisLegalitas) {
|
||||
$details = json_decode($item->details, true);
|
||||
|
||||
if (is_array($details)) {
|
||||
foreach ($details as $detail) {
|
||||
if (isset($detail[$key]) && $detail[$key] !== null) {
|
||||
$total += (int) $detail[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $total > 0 ? $total : 0;
|
||||
}
|
||||
|
||||
|
||||
function ubahNomorHp($nomorHp) {
|
||||
|
||||
$nomorHp = preg_replace('/\D/', '', $nomorHp);
|
||||
if (strpos($nomorHp, '62') === 0) {
|
||||
$nomorBaru = substr($nomorHp, 0, 5) . "xxxxx";
|
||||
return '+' . $nomorBaru;
|
||||
} elseif (strpos($nomorHp, '0') === 0) {
|
||||
|
||||
$nomorBaru = substr($nomorHp, 0, 5) . "xxxxxx";
|
||||
return $nomorBaru;
|
||||
} else {
|
||||
return "Nomor HP tidak valid";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,8 @@ class ActivityController extends Controller
|
||||
public function updateTeamAssingment(Request $request)
|
||||
{
|
||||
try {
|
||||
// Validasi input
|
||||
|
||||
// dd($request->all());
|
||||
$validatedData = $request->validate([
|
||||
'id' => 'required|integer', // penilaian_id
|
||||
'team_member_id' => 'nullable|integer',
|
||||
@@ -81,6 +82,7 @@ class ActivityController extends Controller
|
||||
'permohonan_id' => 'required|integer',
|
||||
'user_id' => 'required|integer',
|
||||
'team_id' => 'required|integer',
|
||||
'penugasan' => 'required|string',
|
||||
], [
|
||||
'team_member_id.required_without' => 'Field team harus diisi.',
|
||||
'.required_without' => 'Field harus diisi.',
|
||||
@@ -93,68 +95,115 @@ class ActivityController extends Controller
|
||||
$permohonanId = $validatedData['permohonan_id'];
|
||||
$userId = $validatedData['user_id'];
|
||||
$teamId = $validatedData['team_id'];
|
||||
$penugasan = $validatedData['penugasan'];
|
||||
|
||||
// Cek apakah permohonan ada
|
||||
$permohonan = Permohonan::findOrFail($permohonanId);
|
||||
|
||||
// Validasi status permohonan
|
||||
if ($permohonan->status !== 'assign' && $permohonan->status !== 'proses-survey') {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Tidak dapat mengganti tim, status permohonan tidak memungkinkan.',
|
||||
]);
|
||||
}
|
||||
// if ($permohonan->status !== 'assign' && $permohonan->status !== 'proses-survey' && $permohonan->status !== 'survey' && $permohonan->status !== 'proses-laporan') {
|
||||
// return response()->json([
|
||||
// 'status' => 'error',
|
||||
// 'message' => 'Tidak dapat mengganti tim, status permohonan tidak memungkinkan.',
|
||||
// ]);
|
||||
// }
|
||||
|
||||
// Ambil tim berdasarkan penilaian_id dan user_id
|
||||
$teams = PenilaianTeam::where('penilaian_id', $penilaianId)
|
||||
|
||||
if ($penugasan === 'sama') {
|
||||
$teams = PenilaianTeam::where('penilaian_id', $penilaianId)
|
||||
->where('user_id', $userId)
|
||||
->get();
|
||||
// Cek apakah tim ditemukan
|
||||
if ($teams->isEmpty()) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Data tim tidak ditemukan.',
|
||||
]);
|
||||
}
|
||||
|
||||
// Cek apakah tim ditemukan
|
||||
if ($teams->isEmpty()) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Data tim tidak ditemukan.',
|
||||
]);
|
||||
}
|
||||
// Mulai transaksi
|
||||
DB::beginTransaction();
|
||||
$updated = false;
|
||||
|
||||
// Mulai transaksi
|
||||
DB::beginTransaction();
|
||||
$updated = false;
|
||||
$status_permohonan = $permohonan->status;
|
||||
|
||||
// Proses update berdasarkan region_id
|
||||
if ($regionId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null]);
|
||||
$permohonan->update([
|
||||
'status' => 'registered']);
|
||||
$updated = true;
|
||||
// Proses update berdasarkan region_id
|
||||
if ($regionId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null,
|
||||
'status' => $status_permohonan,
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => 'reassign'
|
||||
]);
|
||||
$updated = true;
|
||||
}
|
||||
|
||||
if ($team->role === 'penilai') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null,
|
||||
'status' => $status_permohonan
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => 'reassign',
|
||||
'region_id' => $regionId,
|
||||
]);
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($team->role === 'penilai') {
|
||||
$team->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null,
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => 'registered',
|
||||
'region_id' => $regionId,
|
||||
]);
|
||||
$updated = true;
|
||||
// Proses update berdasarkan team_member_id
|
||||
if ($teamMemberId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor' || $team->role === 'penilai') {
|
||||
$team->update(['user_id' => $teamMemberId]);
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Proses update berdasarkan team_member_id
|
||||
if ($teamMemberId) {
|
||||
foreach ($teams as $team) {
|
||||
if ($team->role === 'surveyor' || $team->role === 'penilai') {
|
||||
$team->update(['user_id' => $teamMemberId]);
|
||||
$updated = true;
|
||||
}
|
||||
if ($penugasan === 'surveyor' || $penugasan === 'penilai') {
|
||||
$teams = PenilaianTeam::where('penilaian_id', $penilaianId)
|
||||
->where('user_id', $userId)
|
||||
->where('role', $penugasan)
|
||||
->first();
|
||||
|
||||
// Cek apakah tim ditemukan
|
||||
if (!$teams) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Data tim tidak ditemukan.',
|
||||
]);
|
||||
}
|
||||
|
||||
// Mulai transaksi
|
||||
DB::beginTransaction();
|
||||
$updated = false;
|
||||
|
||||
// Proses update berdasarkan region_id
|
||||
if ($regionId) {
|
||||
$teams->update([
|
||||
'team_id' => $regionId,
|
||||
'user_id' => null
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => $status_permohonan,
|
||||
'region_id' => $regionId,
|
||||
]);
|
||||
$updated = true;
|
||||
}
|
||||
|
||||
// Proses update berdasarkan team_member_id
|
||||
if ($teamMemberId) {
|
||||
$teams->update(['user_id' => $teamMemberId]);
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +355,7 @@ class ActivityController extends Controller
|
||||
}
|
||||
|
||||
// Filter for specific roles
|
||||
if (in_array($userRole, ['surveyor', 'surveyor-penilai'])) {
|
||||
if (in_array($userRole, ['surveyor', 'penilai'])) {
|
||||
$query->whereHas('penilaian.userPenilai', function ($q) use ($user) {
|
||||
$q->where('user_id', $user->id);
|
||||
});
|
||||
@@ -326,7 +375,7 @@ class ActivityController extends Controller
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get data with necessary relationships
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian', 'dokumenjaminan'])->get();
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian', 'dokumenjaminan','nilaiPlafond'])->get();
|
||||
|
||||
// Calculate total pages
|
||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
||||
@@ -392,7 +441,23 @@ class ActivityController extends Controller
|
||||
$q->where('user_id', $id);
|
||||
})
|
||||
->whereHas('permohonan', function ($q) {
|
||||
$q->whereNotIn('status', ['done']);
|
||||
$q->whereIn('status', [
|
||||
'assign',
|
||||
'survey-completed',
|
||||
'proses-laporan',
|
||||
'paparan',
|
||||
'proses-paparan',
|
||||
'revisi-laporan',
|
||||
'revisi-paparan',
|
||||
'survey',
|
||||
'proses-survey',
|
||||
'request-reschedule',
|
||||
'reschedule',
|
||||
'rejected-reschedule',
|
||||
'approved-reschedule',
|
||||
'revisi-survey',
|
||||
'revisi-pembayaran'
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -428,26 +493,40 @@ class ActivityController extends Controller
|
||||
$jeniAsset = null;
|
||||
$statusPembayaran = trim(strtolower($item->permohonan->status_bayar ?? ''));
|
||||
$tujuanPenilaian = $item->permohonan->tujuanPenilaian->name ?? null;
|
||||
$plafond = $item->permohonan->nilaiPlafond->name ?? null;
|
||||
|
||||
$now = Carbon::now();
|
||||
$type_report = $item->permohonan->penilai->type ?? "";
|
||||
|
||||
// $plafond = $item->permohonan->nilaiPlafond->name ?? null;
|
||||
// $type_report = $item->permohonan->penilai->type_penilai;
|
||||
$hari = $hariPaparan = 0;
|
||||
|
||||
// $hari = 0;
|
||||
// if ($plafond == '< 1M') {
|
||||
// $item->paparan = 'Tidak Ada';
|
||||
// }else if($plafond == '2 M - 5 M'){
|
||||
// $hari = 2;
|
||||
// }else if($plafond == '5 M - 10 M'){
|
||||
// $hari = 3;
|
||||
// }
|
||||
if ($type_report == "sederhana") {
|
||||
$hari = 2;
|
||||
$item->paparan = 'Tidak Ada';
|
||||
} else {
|
||||
if ($plafond == '< 2M') {
|
||||
$item->paparan = 'Tidak Ada';
|
||||
$hari = 3;
|
||||
} elseif ($plafond == '2 M - 5 M') {
|
||||
$hari = 3;
|
||||
$hariPaparan = 2;
|
||||
} else {
|
||||
$hari = 5;
|
||||
$hariPaparan = 3;
|
||||
}
|
||||
}
|
||||
|
||||
if ($tujuanPenilaian == 'RAP') {
|
||||
$hari = 2;
|
||||
$hariPaparan = 2;
|
||||
}
|
||||
|
||||
|
||||
if ($item->permohonan && $item->permohonan->debiture) {
|
||||
$jeniAsset = $item->permohonan->debiture->documents->first() ?? null;
|
||||
}
|
||||
|
||||
$hariTambahan = 0;
|
||||
/*$hariTambahan = 0;
|
||||
|
||||
if ($tujuanPenilaian == 'RAP') {
|
||||
$hariTambahan = 2;
|
||||
@@ -457,33 +536,50 @@ class ActivityController extends Controller
|
||||
} else {
|
||||
$hariTambahan = 2; // H+2 untuk yang belum bayar
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
$tanggalMulai = $item->waktu_penilaian;
|
||||
|
||||
if ($tanggalMulai) {
|
||||
if (!$tanggalMulai instanceof Carbon) {
|
||||
$tanggalMulai = Carbon::parse($tanggalMulai);
|
||||
}
|
||||
$hariKerjaBerikutnya = hitungHariKerja($tanggalMulai->toDateString(), $tanggalMulai->copy()->addDays(1));
|
||||
$hariKerjaBerikutnya = max($hariKerjaBerikutnya, 1);
|
||||
$tanggalMulai = $tanggalMulai->copy()->addDays($hariKerjaBerikutnya);
|
||||
|
||||
// Konversi string tanggal ke objek Carbon jika belum
|
||||
if (!$tanggalMulai instanceof Carbon) {
|
||||
$tanggalMulai = Carbon::parse($tanggalMulai);
|
||||
}
|
||||
|
||||
// Hitung tanggal selesai berdasarkan hari tambahan
|
||||
$tanggalSelesai = $tanggalMulai->copy()->addDays($hariTambahan);
|
||||
$tanggalSelesai = $tanggalMulai->copy()->addDays($hari);
|
||||
$tanggalPaparan = $tanggalMulai->copy()->addDays($hariPaparan);
|
||||
|
||||
// Hitung hari kerja
|
||||
$hariKerja = hitungHariKerja($tanggalMulai->toDateString(), $tanggalSelesai->toDateString());
|
||||
$hariKerja = max($hariKerja, $hari);
|
||||
|
||||
$hariKerjaPaparan = hitungHariKerja($tanggalMulai->toDateString(), $tanggalPaparan->toDateString());
|
||||
$hariKerjaPaparan = max($hariKerjaPaparan, $hariPaparan);
|
||||
|
||||
// Set due date SLA
|
||||
$dueDateSla = $tanggalMulai->copy()->addDays($hariKerja);
|
||||
$dueDateSlaPaparan = $tanggalMulai->copy()->addDays($hariKerjaPaparan);
|
||||
|
||||
// Cek apakah sudah melewati due date
|
||||
if ($now->greaterThan($dueDateSla)) {
|
||||
/*if ($now->greaterThan($dueDateSla)) {
|
||||
$item->due_date_sla = null;
|
||||
} else {
|
||||
$item->due_date_sla = $dueDateSla->toDateString();
|
||||
}
|
||||
}*/
|
||||
|
||||
$item->due_date_sla = $dueDateSla->toDateString();
|
||||
$item->paparan = $dueDateSlaPaparan->toDateString();
|
||||
} else {
|
||||
$item->due_date_sla = null;
|
||||
$item->paparan = null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Log;
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
@@ -89,7 +91,7 @@
|
||||
'jenis_legalitas_jaminan_id' => $value,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
'details' => isset($request->custom_field[$value]) ? json_encode($request->custom_field[$value]) : ''
|
||||
'details' => isset($request->custom_field[$key]) ? json_encode($request->custom_field[$key]) : ''
|
||||
];
|
||||
|
||||
$dokumenJaminan = [];
|
||||
@@ -103,7 +105,7 @@
|
||||
$file_name,
|
||||
);
|
||||
$dokumenJaminan[] = 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name;
|
||||
$dokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? '';
|
||||
$dokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? '-';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,7 +250,7 @@
|
||||
'jenis_legalitas_jaminan_id' => $value,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
'details' => isset($request->custom_field[$value]) ? json_encode($request->custom_field[$value]) : ''
|
||||
'details' => isset($request->custom_field[$key]) ? json_encode(array_values($request->custom_field[$key])) : ''
|
||||
];
|
||||
|
||||
$dokumenJaminan = [];
|
||||
@@ -256,60 +258,111 @@
|
||||
|
||||
if (isset($request->dokumen_jaminan[$key]) && is_array($request->dokumen_jaminan[$key])) {
|
||||
foreach ($request->dokumen_jaminan[$key] as $index => $file) {
|
||||
if ($file) {
|
||||
if ($file instanceof \Illuminate\Http\UploadedFile) {
|
||||
// Jika file baru diupload
|
||||
$file_name = $file->getClientOriginalName();
|
||||
$file->storeAs(
|
||||
'public/jaminan/' . $debitur->id . '/' . $document->id . '/',
|
||||
$file_name,
|
||||
);
|
||||
$dokumenJaminan[] = 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name;
|
||||
$dokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? '';
|
||||
} elseif (is_string($file) && !empty($file)) {
|
||||
// Jika file tidak diubah, gunakan path yang sudah ada
|
||||
$dokumenJaminan[] = $file;
|
||||
} else {
|
||||
// Jika file kosong atau null, tambahkan placeholder atau skip
|
||||
$dokumenJaminan[] = null; // atau skip dengan continue;
|
||||
}
|
||||
|
||||
// Selalu update dokumen_nomor, baik file diubah atau tidak
|
||||
$dokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? '-';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Setelah loop, periksa apakah ada dokumen yang dihapus
|
||||
$existingDetail = $existingDetails->get($request->detail_dokumen_jaminan_id[$key] ?? null);
|
||||
|
||||
if ($existingDetail) {
|
||||
$existingDokumen = json_decode($existingDetail->dokumen_jaminan, true) ?? [];
|
||||
$existingNomor = json_decode($existingDetail->dokumen_nomor, true) ?? [];
|
||||
|
||||
$newDokumenJaminan = [];
|
||||
$newDokumenNomor = [];
|
||||
|
||||
$allFilesDeleted = true;
|
||||
|
||||
foreach ($existingDokumen as $index => $existingFile) {
|
||||
if (isset($request->dokumen_jaminan[$key][$index])) {
|
||||
$allFilesDeleted = false;
|
||||
$file = $request->dokumen_jaminan[$key][$index];
|
||||
if ($file instanceof \Illuminate\Http\UploadedFile) {
|
||||
// File baru diupload
|
||||
$file_name = $file->getClientOriginalName();
|
||||
$file->storeAs('public/jaminan/' . $debitur->id . '/' . $document->id . '/', $file_name);
|
||||
$newDokumenJaminan[] = 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name;
|
||||
$newDokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? '-';
|
||||
} elseif (is_string($file) && !empty($file)) {
|
||||
// File tidak diubah
|
||||
$newDokumenJaminan[] = $existingFile;
|
||||
$newDokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? $existingNomor[$index];
|
||||
}
|
||||
} else {
|
||||
// File dihapus, hapus dari storage jika ada
|
||||
if (Storage::exists('public/' . $existingFile)) {
|
||||
Storage::delete('public/' . $existingFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tambahkan file baru yang mungkin ditambahkan
|
||||
foreach ($request->dokumen_jaminan[$key] ?? [] as $index => $file) {
|
||||
if ($file instanceof UploadedFile) {
|
||||
$allFilesDeleted = false;
|
||||
$file_name = $file->getClientOriginalName();
|
||||
$path = 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name;
|
||||
if (!in_array($path, $newDokumenJaminan)) {
|
||||
$file->storeAs('public/' . dirname($path), $file_name);
|
||||
$newDokumenJaminan[] = $path;
|
||||
$newDokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? '-';
|
||||
}
|
||||
} elseif (is_string($file) && !empty($file) && !in_array($file, $newDokumenJaminan)) {
|
||||
$allFilesDeleted = false;
|
||||
$newDokumenJaminan[] = $file;
|
||||
$newDokumenNomor[] = $request->dokumen_nomor[$key][$index] ?? '-';
|
||||
}
|
||||
}
|
||||
|
||||
if ($allFilesDeleted) {
|
||||
$dokumenJaminan = [];
|
||||
$dokumenNomor = [];
|
||||
} else {
|
||||
$dokumenJaminan = $newDokumenJaminan;
|
||||
$dokumenNomor = $newDokumenNomor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!empty($dokumenJaminan)) {
|
||||
$detailData['dokumen_jaminan'] = json_encode($dokumenJaminan);
|
||||
$detailData['dokumen_nomor'] = json_encode($dokumenNomor);
|
||||
$detailData['dokumen_nomor'] = json_encode($dokumenNomor);
|
||||
} else if(empty($dokumenJaminan)){
|
||||
$detailData['dokumen_jaminan'] = null;
|
||||
$detailData['dokumen_nomor'] = null;
|
||||
}
|
||||
|
||||
if (isset($request->detail_dokumen_jaminan_id[$key])) {
|
||||
$detailId = $request->detail_dokumen_jaminan_id[$key];
|
||||
$detailDocument = $existingDetails->get($detailId);
|
||||
if ($detailDocument) {
|
||||
// Merge new files with existing ones
|
||||
if (!empty($dokumenJaminan)) {
|
||||
$existingFiles = json_decode(
|
||||
$detailDocument->dokumen_jaminan,
|
||||
true,
|
||||
) ?: [];
|
||||
$existingNomor = json_decode(
|
||||
$detailDocument->dokumen_nomor,
|
||||
true,
|
||||
) ?: [];
|
||||
$mergedFiles = array_merge($existingFiles, $dokumenJaminan);
|
||||
$mergedNomor = array_merge($existingNomor, $dokumenNomor);
|
||||
$detailData['dokumen_jaminan'] = json_encode($mergedFiles);
|
||||
$detailData['dokumen_nomor'] = json_encode($mergedNomor);
|
||||
}
|
||||
$detailDocument->update($detailData);
|
||||
$existingDetails->forget($detailId);
|
||||
}
|
||||
$detailDocument->update($detailData);
|
||||
|
||||
} else {
|
||||
DetailDokumenJaminan::create($detailData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete any remaining existing details that weren't updated
|
||||
foreach ($existingDetails as $detail) {
|
||||
$files = json_decode($detail->dokumen_jaminan, true) ?: [];
|
||||
foreach ($files as $file) {
|
||||
Storage::delete('public/' . $file);
|
||||
}
|
||||
$detail->delete();
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
return redirect()->route('debitur.jaminan.index', $id)->with(
|
||||
'success',
|
||||
@@ -341,6 +394,7 @@
|
||||
$jenisLegalitasJaminan = JenisLegalitasJaminan::all();
|
||||
|
||||
$_jenisJaminan = JenisJaminan::find($document->jenis_jaminan_id);
|
||||
|
||||
$legalitas = '';
|
||||
if ($_jenisJaminan) {
|
||||
$legalitasJaminan = json_decode($_jenisJaminan->jenis_legalitas_jaminan_id, true);
|
||||
@@ -572,4 +626,40 @@
|
||||
$combinedLegalitas = array_merge($existingLegalitas, $newLegalitas);
|
||||
return response()->json($combinedLegalitas);
|
||||
}
|
||||
|
||||
public function clearDetail(Request $request)
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
$detailId = $request->input('detail_id');
|
||||
$detail = DetailDokumenJaminan::findOrFail($detailId);
|
||||
|
||||
// Delete associated files
|
||||
if ($detail->dokumen_jaminan) {
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
|
||||
foreach ($dokumen_jaminan as $dokumen) {
|
||||
if (Storage::exists($dokumen)) {
|
||||
Storage::delete($dokumen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete the detail record
|
||||
$detail->delete();
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Detail berhasil dihapus']);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Gagal menghapus detail: ' . $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
172
app/Http/Controllers/JenisLampiranController.php
Normal file
172
app/Http/Controllers/JenisLampiranController.php
Normal file
@@ -0,0 +1,172 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\JenisLampiranExport;
|
||||
use Modules\Lpj\Http\Requests\JenisLampiranRequest;
|
||||
use Modules\Lpj\Models\JenisLampiran;
|
||||
|
||||
class JenisLampiranController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$jenisLampirans = JenisLampiran::all();
|
||||
return view('lpj::jenis_lampiran.index', compact('jenisLampirans'));
|
||||
}
|
||||
|
||||
public function store(JenisLampiranRequest $request)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$validated = $request->validated();
|
||||
$validated['created_by'] = Auth::id();
|
||||
|
||||
$jenisLampiran = JenisLampiran::create($validated);
|
||||
|
||||
DB::commit();
|
||||
return redirect()
|
||||
->route('basicdata.jenis-lampiran.index')
|
||||
->with('success', 'Jenis Lampiran berhasil ditambahkan.');
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', 'Gagal menambahkan Jenis Lampiran: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::jenis_lampiran.create');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$jenisLampiran = JenisLampiran::findOrFail($id);
|
||||
return view('lpj::jenis_lampiran.show', compact('jenisLampiran'));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$jenisLampiran = JenisLampiran::findOrFail($id);
|
||||
return view('lpj::jenis_lampiran.create', compact('jenisLampiran'));
|
||||
}
|
||||
|
||||
public function update(JenisLampiranRequest $request, $id)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$jenisLampiran = JenisLampiran::findOrFail($id);
|
||||
$validated = $request->validated();
|
||||
$validated['updated_by'] = Auth::id();
|
||||
|
||||
$jenisLampiran->update($validated);
|
||||
|
||||
DB::commit();
|
||||
return redirect()
|
||||
->route('basicdata.jenis-lampiran.index')
|
||||
->with('success', 'Jenis Lampiran berhasil diperbarui.');
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', 'Gagal memperbarui Jenis Lampiran: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$jenisLampiran = JenisLampiran::findOrFail($id);
|
||||
$jenisLampiran->deleted_by = Auth::id();
|
||||
$jenisLampiran->save();
|
||||
|
||||
$jenisLampiran->delete();
|
||||
|
||||
DB::commit();
|
||||
echo json_encode(['success' => true, 'message' => 'Jenis Lampiran berhasil dihapus.']);
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'Gagal menghapus Jenis Lampiran: ' . $e->getMessage()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
// Retrieve data from the database
|
||||
$query = JenisLampiran::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nama', 'LIKE', "%$search%")
|
||||
->orWhere('deskripsi', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 1);
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function export()
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('jenis_lampiran.export')) {
|
||||
abort(403, 'Sorry! You are not allowed to export jenis lampiran.');
|
||||
}
|
||||
|
||||
return Excel::download(new JenisLampiranExport, 'jenis_lampiran.xlsx');
|
||||
}
|
||||
}
|
||||
@@ -150,4 +150,16 @@
|
||||
{
|
||||
return Excel::download(new JenisLegalitasJaminanExport, 'jenis_legalitas_jaminan.xlsx');
|
||||
}
|
||||
|
||||
public function getCustomFields($id)
|
||||
{
|
||||
$jenisLegalitasJaminan = JenisLegalitasJaminan::findOrFail($id);
|
||||
if(!$jenisLegalitasJaminan->custom_fields) {
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$customFields = CustomField::whereIn('id', $jenisLegalitasJaminan->custom_fields)->get();
|
||||
|
||||
return response()->json($customFields);
|
||||
}
|
||||
}
|
||||
|
||||
45
app/Http/Controllers/LampiranDokumenController.php
Normal file
45
app/Http/Controllers/LampiranDokumenController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Modules\Lpj\Models\LampiranDokumen;
|
||||
|
||||
class LampiranDokumenController extends Controller
|
||||
{
|
||||
public function download($id)
|
||||
{
|
||||
$lampiran = LampiranDokumen::findOrFail($id);
|
||||
return Storage::download($lampiran->path_file, $lampiran->nama_file);
|
||||
}
|
||||
|
||||
public function upload(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'jenis_lampiran_id' => 'required|exists:jenis_lampiran,id',
|
||||
'nama_file' => 'nullable|string|max:255',
|
||||
'file' => 'required|file|max:10240',
|
||||
'keterangan' => 'nullable|string|max:255',
|
||||
]);
|
||||
|
||||
$lampiran = LampiranDokumen::uploadLampiran($request->all());
|
||||
|
||||
if ($lampiran) {
|
||||
return redirect()->back()->with('success', 'Lampiran uploaded successfully');
|
||||
} else {
|
||||
return redirect()->back()->with('error', 'Unauthorized or upload failed');
|
||||
}
|
||||
}
|
||||
|
||||
public function delete(LampiranDokumen $lampiran)
|
||||
{
|
||||
if ($lampiran->deleteLampiran()) {
|
||||
return redirect()->back()->with('success', 'Lampiran deleted successfully');
|
||||
} else {
|
||||
return redirect()->back()->with('error', 'Unauthorized or delete failed');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ class LaporanController extends Controller
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian','jenisFasilitasKredit', 'documents.inspeksi','penilai'])->get();
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian','jenisFasilitasKredit', 'documents.inspeksi','penilai','documents.detail'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
173
app/Http/Controllers/LaporanExternalController.php
Normal file
173
app/Http/Controllers/LaporanExternalController.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\LaporanExternal;
|
||||
use Modules\Lpj\Http\Requests\LaporanExternalRequest;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
|
||||
class LaporanExternalController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$laporanExternals = LaporanExternal::with('permohonan')->paginate(10);
|
||||
return view('lpj::laporan_external.index', compact('laporanExternals'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::laporan_external.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(LaporanExternalRequest $request)
|
||||
{
|
||||
$validatedData = $request->validated();
|
||||
|
||||
if ($request->hasFile('file_resume')) {
|
||||
$validatedData['file_resume'] = $request->file('file_resume')->store('laporan_external/resume', 'public');
|
||||
}
|
||||
|
||||
if ($request->hasFile('file_laporan')) {
|
||||
$validatedData['file_laporan'] = $request->file('file_laporan')->store('laporan_external/laporan', 'public');
|
||||
}
|
||||
|
||||
LaporanExternal::create($validatedData);
|
||||
|
||||
return redirect()->route('laporan-external.index')->with('success', 'Laporan External berhasil ditambahkan.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show(LaporanExternal $laporanExternal)
|
||||
{
|
||||
return view('lpj::laporan_external.show', compact('laporanExternal'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(LaporanExternal $laporanExternal)
|
||||
{
|
||||
$permohonan = Permohonan::find($laporanExternal->permohonan_id);
|
||||
return view('lpj::laporan_external.create', compact('laporanExternal','permohonan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(LaporanExternalRequest $request, LaporanExternal $laporanExternal)
|
||||
{
|
||||
$validatedData = $request->validated();
|
||||
|
||||
if ($request->hasFile('file_resume')) {
|
||||
$validatedData['file_resume'] = $request->file('file_resume')->store('laporan_external/resume', 'public');
|
||||
}
|
||||
|
||||
if ($request->hasFile('file_laporan')) {
|
||||
$validatedData['file_laporan'] = $request->file('file_laporan')->store('laporan_external/laporan', 'public');
|
||||
}
|
||||
|
||||
$laporanExternal->update($validatedData);
|
||||
|
||||
return redirect()->route('laporan-external.index')->with('success', 'Laporan External berhasil diperbarui.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(LaporanExternal $laporanExternal)
|
||||
{
|
||||
$laporanExternal->delete();
|
||||
|
||||
return redirect()->route('laporan-external.index')->with('success', 'Laporan External berhasil dihapus.');
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('jenis_aset.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = LaporanExternal::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_laporan', 'LIKE', "%$search%")
|
||||
->orWhere('tanggal_laporan', 'LIKE', "%$search%")
|
||||
->orWhereHas('permohonan', function($q) use ($search) {
|
||||
$q->where('nomor_permohonan', 'LIKE', "%$search%");
|
||||
})
|
||||
->orWhere('tgl_final_laporan', 'LIKE', "%$search%")
|
||||
->orWhere('nilai_pasar', 'LIKE', "%$search%")
|
||||
->orWhere('indikasi_nilai_likuidasi', 'LIKE', "%$search%")
|
||||
->orWhere('indikasi_nilai_pasar_tanah', 'LIKE', "%$search%")
|
||||
->orWhere('estimasi_harga_tanah', 'LIKE', "%$search%")
|
||||
->orWhere('estimasi_harga_bangunan', 'LIKE', "%$search%")
|
||||
->orWhere('indikasi_nilai_pasar_bangunan', 'LIKE', "%$search%")
|
||||
->orWhere('indikasi_nilai_pasar_sarana_pelengkap', 'LIKE', "%$search%")
|
||||
->orWhere('indikasi_nilai_pasar_mesin', 'LIKE', "%$search%")
|
||||
->orWhere('indikasi_nilai_pasar_kendaraan_alat_berat', 'LIKE', "%$search%")
|
||||
->orWhere('file_resume', 'LIKE', "%$search%")
|
||||
->orWhere('file_laporan', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->with(['permohonan.debiture','permohonan.penawaran.tujuanPenilaianKjpp','permohonan.dokumenjaminan.jenisjaminan'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -336,8 +336,9 @@
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$prosespenawaran = PenawaranTender::find($id);
|
||||
return view('lpj::otorisasipenawaran.show', compact('id','prosespenawaran'));
|
||||
$prosespenawaran = PenawaranTender::with(['permohonan','tujuanPenilaianKjpp'])->find($id);
|
||||
$permohonan = $prosespenawaran->permohonan;
|
||||
return view('lpj::otorisasipenawaran.show', compact('id','prosespenawaran','permohonan'));
|
||||
}
|
||||
|
||||
public function penawaranulang(Request $request, $id): JsonResponse
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Barryvdh\DomPDF\Facade\Pdf; // https://github.com/barryvdh/laravel-dompdf
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Inspeksi;
|
||||
use Modules\Lpj\Models\Penilai;
|
||||
@@ -24,15 +25,19 @@ use App\Helpers\Lpj;
|
||||
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
||||
use Modules\Lpj\Models\Authorization;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use Modules\Lpj\Services\SaveFormInspesksiService;
|
||||
|
||||
class PenilaiController extends Controller
|
||||
{
|
||||
public $user;
|
||||
protected $surveyorController;
|
||||
protected $inspeksiService;
|
||||
|
||||
public function __construct(SurveyorController $surveyorController)
|
||||
|
||||
public function __construct(SurveyorController $surveyorController, SaveFormInspesksiService $inspeksiService)
|
||||
{
|
||||
$this->surveyorController = $surveyorController;
|
||||
$this->inspeksiService = $inspeksiService;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,11 +112,42 @@ class PenilaiController extends Controller
|
||||
if ($lpj) {
|
||||
$lpjData = json_decode($lpj->lpj, true);
|
||||
}
|
||||
$debitur = Debiture::find($permohonan->debiture_id);
|
||||
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces'));
|
||||
$provinceCode = $debitur->province_code;
|
||||
$cityCode = $debitur->city_code;
|
||||
$districtCode = $debitur->district_code;
|
||||
$cekAlamat = $forminspeksi['asset']['alamat']['tidak sesuai'] ?? null;
|
||||
|
||||
if ($cekAlamat) {
|
||||
$provinceCode = $cekAlamat['province_code'] ?? $provinceCode;
|
||||
$cityCode = $cekAlamat['city_code'] ?? $cityCode;
|
||||
$districtCode = $cekAlamat['district_code'] ?? $districtCode;
|
||||
// Ambil data menggunakan kode yang telah ditentukan
|
||||
|
||||
}
|
||||
$cities = City::where('province_code', $provinceCode)->get();
|
||||
$districts = District::where('city_code', $cityCode)->get();
|
||||
$villages = Village::where('district_code', $districtCode)->get();
|
||||
|
||||
if ($forminspeksi) {
|
||||
if (isset($forminspeksi['alamat']['sesuai']['province_code'])) {
|
||||
$cities = City::where('province_code', $forminspeksi['alamat']['sesuai']['province_code'])->get();
|
||||
}
|
||||
|
||||
if (isset($forminspeksi['alamat']['sesuai']['city_code'])) {
|
||||
$districts = District::where('city_code', $forminspeksi['alamat']['sesuai']['city_code'])->get();
|
||||
}
|
||||
|
||||
if (isset($forminspeksi['alamat']['sesuai']['district_code'])) {
|
||||
$villages = Village::where('district_code', $forminspeksi['alamat']['sesuai']['district_code'])->get();
|
||||
}
|
||||
}
|
||||
|
||||
return view('lpj::penilai.components.lpj-sederhana-standar', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces', 'cekAlamat', 'cities', 'districts', 'villages'));
|
||||
}
|
||||
|
||||
public function standard(Request $request, $id)
|
||||
public function standar(Request $request, $id)
|
||||
{
|
||||
|
||||
$documentId = $request->query('documentId');
|
||||
@@ -131,7 +167,7 @@ class PenilaiController extends Controller
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'standard',
|
||||
'type_penilai' => 'standar',
|
||||
]
|
||||
);
|
||||
|
||||
@@ -144,8 +180,39 @@ class PenilaiController extends Controller
|
||||
if ($lpj) {
|
||||
$lpjData = json_decode($lpj->lpj, true);
|
||||
}
|
||||
$debitur = Debiture::find($permohonan->debiture_id);
|
||||
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces'));
|
||||
$provinceCode = $debitur->province_code;
|
||||
$cityCode = $debitur->city_code;
|
||||
$districtCode = $debitur->district_code;
|
||||
$cekAlamat = $forminspeksi['asset']['alamat']['tidak sesuai'] ?? null;
|
||||
|
||||
if ($cekAlamat) {
|
||||
$provinceCode = $cekAlamat['province_code'] ?? $provinceCode;
|
||||
$cityCode = $cekAlamat['city_code'] ?? $cityCode;
|
||||
$districtCode = $cekAlamat['district_code'] ?? $districtCode;
|
||||
// Ambil data menggunakan kode yang telah ditentukan
|
||||
|
||||
}
|
||||
$cities = City::where('province_code', $provinceCode)->get();
|
||||
$districts = District::where('city_code', $cityCode)->get();
|
||||
$villages = Village::where('district_code', $districtCode)->get();
|
||||
|
||||
if ($forminspeksi) {
|
||||
if (isset($forminspeksi['alamat']['sesuai']['province_code'])) {
|
||||
$cities = City::where('province_code', $forminspeksi['alamat']['sesuai']['province_code'])->get();
|
||||
}
|
||||
|
||||
if (isset($forminspeksi['alamat']['sesuai']['city_code'])) {
|
||||
$districts = District::where('city_code', $forminspeksi['alamat']['sesuai']['city_code'])->get();
|
||||
}
|
||||
|
||||
if (isset($forminspeksi['alamat']['sesuai']['district_code'])) {
|
||||
$villages = Village::where('district_code', $forminspeksi['alamat']['sesuai']['district_code'])->get();
|
||||
}
|
||||
}
|
||||
|
||||
return view('lpj::penilai.components.lpj-sederhana-standar', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces', 'cekAlamat', 'cities', 'districts', 'villages'));
|
||||
}
|
||||
|
||||
public function resume(Request $request)
|
||||
@@ -238,7 +305,7 @@ class PenilaiController extends Controller
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::with(['debiture.documents.jenisjaminan', 'region.teams.teamsUsers.user', 'penilaian', 'documents.inspeksi'])->find($id);
|
||||
$permohonan = Permohonan::with(['debiture.documents.jenisjaminan', 'region.teams.teamsUsers.user', 'penilaian', 'documents.inspeksi','jenisPenilaian','laporanExternal'])->find($id);
|
||||
|
||||
|
||||
// return response()->json(['permohonan' => $permohonan]);
|
||||
@@ -255,7 +322,6 @@ class PenilaiController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function storePaparan(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
@@ -281,8 +347,8 @@ class PenilaiController extends Controller
|
||||
$penilai = Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $request->permohonan_id,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
'dokument_id' => $request->dokument_id,
|
||||
'inspeksi_id' => $request->inspeksi_id,
|
||||
]
|
||||
);
|
||||
|
||||
@@ -492,6 +558,7 @@ class PenilaiController extends Controller
|
||||
$query = Permohonan::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
$query = $query->orderBy('nomor_registrasi', 'desc');
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$columns = ['debiture.name', 'branch.name', 'user.name', 'tujuanPenilaian.name', 'jenisfasilitasKredit.name'];
|
||||
@@ -504,12 +571,12 @@ class PenilaiController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
$query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ?,?, ?)', ['assign', 'survey-completed', 'proses-laporan', 'paparan', 'proses-paparan', 'paparan', 'revisi-laporan', 'revisi-paparan']);
|
||||
$query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?)', ['assign', 'survey-completed', 'proses-laporan', 'paparan', 'proses-paparan', 'paparan', 'revisi-laporan', 'revisi-paparan', 'request-freeze', 'freeze', 'reject-freeze','unfreeze-sla']);
|
||||
|
||||
if (!Auth::user()->hasRole('administrator')) {
|
||||
$query->whereHas('penilaian.userPenilai', function ($q) {
|
||||
$q
|
||||
->where('role', 'penilai')
|
||||
->where('role', ['surveyor','penilai'])
|
||||
->where('user_id', Auth::user()->id);
|
||||
});
|
||||
}
|
||||
@@ -545,7 +612,9 @@ class PenilaiController extends Controller
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'jenisfasilitasKredit',
|
||||
'penilaian.userPenilai' // Ensure this relation is included
|
||||
'penilaian.userPenilai',
|
||||
'penilai',
|
||||
'nilaiPlafond'
|
||||
])->get();
|
||||
|
||||
// Calculate the page count
|
||||
@@ -653,7 +722,7 @@ class PenilaiController extends Controller
|
||||
'permohonan_id' => 'required|integer',
|
||||
'document_id' => 'required|integer',
|
||||
'inspeksi_id' => 'required|integer',
|
||||
'kertas_kerja' => 'required|file|mimes:pdf,doc,docx,xls,xlsx,xlsx',
|
||||
'kertas_kerja' => 'required|file|mimes:pdf',
|
||||
]);
|
||||
|
||||
try {
|
||||
@@ -755,14 +824,34 @@ class PenilaiController extends Controller
|
||||
|
||||
|
||||
if (!$allComplete) {
|
||||
$message = $rap
|
||||
? 'Harap Mengisi laporan terlebih dahulu'
|
||||
: 'Harap Mengisi laporan terlebih dahulu atau kertas kerja';
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Harap Mengisi laporan terlebih dahulu atau kertas kerja',
|
||||
'message' => $message,
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
|
||||
if ($permohonan->status === 'proses-laporan') {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Masih proses laporan',
|
||||
], 400);
|
||||
}
|
||||
|
||||
if ($permohonan->status === 'proses-paparan') {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Masih proses paparan',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$permohonan->update([
|
||||
'status' => 'proses-laporan',
|
||||
]);
|
||||
@@ -780,6 +869,18 @@ class PenilaiController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function uploadTempPhoto(Request $request)
|
||||
{
|
||||
if ($request->hasFile('file')) {
|
||||
$file = $request->file('file');
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
$path = $file->storeAs('temp_photos', $filename, 'public');
|
||||
return response()->json(['success' => true, 'id' => $path]);
|
||||
}
|
||||
|
||||
return response()->json(['success' => false], 400);
|
||||
}
|
||||
|
||||
public function storeResume(Request $request)
|
||||
{
|
||||
try {
|
||||
@@ -863,37 +964,61 @@ class PenilaiController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function storeMemo(Request $request)
|
||||
public function storeMemoWithPhotos(Request $request)
|
||||
{
|
||||
try {
|
||||
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required|integer',
|
||||
'document_id' => 'required|integer',
|
||||
'inspeksi_id' => 'required|integer',
|
||||
'memo' => 'required',
|
||||
'document_id' => 'required|integer',
|
||||
'inspeksi_id' => 'required|integer',
|
||||
'memo' => 'required',
|
||||
]);
|
||||
Penilai::updateOrCreate(
|
||||
|
||||
$memoData = json_decode($validatedData['memo'], true);
|
||||
|
||||
$memo = Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['document_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
'dokument_id' => $validatedData['document_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
],
|
||||
[
|
||||
'memo' => json_encode($validatedData['memo']),
|
||||
'memo' => json_encode($memoData),
|
||||
]
|
||||
);
|
||||
|
||||
$existingPhotos = isset($memo->memo) ? json_decode($memo->memo)->foto : [];
|
||||
dd($existingPhotos);
|
||||
// Simpan foto-foto
|
||||
if ($request->hasFile('foto_0')) {
|
||||
$photoUrls = [];
|
||||
$index = 0;
|
||||
while ($request->hasFile("foto_$index")) {
|
||||
$file = $request->file("foto_$index");
|
||||
$fileName = time() . '_' . $file->getClientOriginalName();
|
||||
$filePath = $file->storeAs('public/memo_photos', $fileName);
|
||||
$photoUrls[] = Storage::url($filePath);
|
||||
$index++;
|
||||
}
|
||||
|
||||
$memoData['foto'] = array_merge($existingPhotos, $photoUrls);
|
||||
|
||||
}else{
|
||||
$memoData['foto'] = $existingPhotos;
|
||||
}
|
||||
// Tambahkan URL foto ke data memo
|
||||
$memoData['foto'] = $photoUrls;
|
||||
$memo->memo = json_encode($memoData);
|
||||
$memo->save();
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil saved memo'
|
||||
], 200);
|
||||
} catch (\Exception $e) {
|
||||
'message' => 'Memo dan foto berhasil disimpan',
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Terjadi kesalahan',
|
||||
'error' => $e->getMessage()
|
||||
'message' => 'Terjadi kesalahan: ' . $e->getMessage(),
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
@@ -902,21 +1027,9 @@ class PenilaiController extends Controller
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$formRequest = new FormSurveyorRequest();
|
||||
$formRequest->setContainer(app());
|
||||
$formRequest->initialize(
|
||||
$request->all(),
|
||||
$request->query->all(),
|
||||
$request->attributes->all(),
|
||||
$request->cookies->all(),
|
||||
$request->files->all(),
|
||||
$request->server->all(),
|
||||
$request->getContent()
|
||||
);
|
||||
|
||||
$validated = $formRequest->validateResolved();
|
||||
|
||||
$result = $this->surveyorController->store($formRequest);
|
||||
$validatedData = $request->all();
|
||||
$result = $this->inspeksiService->storeInspeksi($validatedData, $request->input('type'), $request);
|
||||
|
||||
|
||||
$data = [
|
||||
@@ -974,7 +1087,7 @@ class PenilaiController extends Controller
|
||||
'message' => 'Berhasil menyimpan LPJ',
|
||||
'data' => $result
|
||||
], 200);
|
||||
} catch (\Throwable $e) {
|
||||
}catch (\Throwable $e) {
|
||||
DB::rollBack();
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
@@ -1203,6 +1316,8 @@ class PenilaiController extends Controller
|
||||
// return $pdf;
|
||||
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
$pdf->set_option('isHtml5ParserEnabled', true);
|
||||
$pdf->set_option('isPhpEnabled', true);
|
||||
return response($pdf->output(), 200)
|
||||
->header('Content-Type', 'application/pdf')
|
||||
->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '.pdf"');
|
||||
@@ -1230,6 +1345,8 @@ class PenilaiController extends Controller
|
||||
// return $pdf;
|
||||
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
$pdf->set_option('isHtml5ParserEnabled', true);
|
||||
$pdf->set_option('isPhpEnabled', true);
|
||||
return $pdf->download('Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '_data.pdf');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
@@ -1242,7 +1359,7 @@ class PenilaiController extends Controller
|
||||
{
|
||||
$viewMap = [
|
||||
'sederhana' => 'penilai.components.print-out-sederhana',
|
||||
'standard' => 'penilai.components.print-out-standard',
|
||||
'standar' => 'penilai.components.print-out-standar',
|
||||
'resume' => 'penilai.components.print-resume',
|
||||
'memo' => 'penilai.components.print-memo',
|
||||
'rap' => 'penilai.components.print-out-rap',
|
||||
@@ -1305,7 +1422,7 @@ class PenilaiController extends Controller
|
||||
}
|
||||
|
||||
|
||||
if ($type === 'standard' || $type === 'sederhana') {
|
||||
if ($type === 'standar' || $type === 'sederhana') {
|
||||
return $this->checkDataLpj($type, $statusLpj);
|
||||
}
|
||||
|
||||
@@ -1593,6 +1710,22 @@ class PenilaiController extends Controller
|
||||
public function revisiSurveyor(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
|
||||
if ($permohonan->status === 'proses-laporan') {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Masih proses laporan',
|
||||
], 400);
|
||||
}
|
||||
|
||||
if ($permohonan->status === 'proses-paparan') {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Masih proses paparan',
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
||||
$permohonan->update([
|
||||
'status' => 'revisi-survey',
|
||||
'keterangan' => $request->message,
|
||||
|
||||
@@ -253,7 +253,7 @@ class PenilaianController extends Controller
|
||||
$teamPenilai = $userTeam->flatMap(function ($team) {
|
||||
return $team->teamsUsers->filter(function ($teamUser) {
|
||||
return $teamUser->user->roles->contains(function ($role) {
|
||||
return $role->name === 'surveyor' || $role->name === 'surveyor-penilai' || $role->name === 'administrator';
|
||||
return $role->name === 'surveyor' || $role->name === 'penilai' || $role->name === 'administrator';
|
||||
});
|
||||
})->map(function ($teamUser) {
|
||||
return $teamUser->user;
|
||||
@@ -279,6 +279,8 @@ class PenilaianController extends Controller
|
||||
$penilaianTeam = PenilaianTeam::where('penilaian_id', $penilaian->id)->get();
|
||||
}
|
||||
|
||||
// dd($penilaianTeam);
|
||||
|
||||
return view(
|
||||
'lpj::penilaian.form',
|
||||
compact(
|
||||
@@ -347,8 +349,9 @@ class PenilaianController extends Controller
|
||||
|
||||
$query->whereIn('status', ['registered', 'registrasi-final', 'reassign']);
|
||||
|
||||
// Filter berdasarkan role
|
||||
|
||||
if (Auth::user()->roles[0]->name !== 'administrator') {
|
||||
|
||||
$query->whereHas('region.teams.teamsUsers.user', function ($q) {
|
||||
$q->where('id', Auth::user()->id);
|
||||
});
|
||||
@@ -376,7 +379,8 @@ class PenilaianController extends Controller
|
||||
|
||||
$filteredRecords = $query->count();
|
||||
$data = $query->with(
|
||||
['user', 'debiture', 'branch', 'tujuanPenilaian', 'jenisPenilaian', 'region.teams.teamsUsers.user'],
|
||||
['user', 'debiture', 'branch', 'tujuanPenilaian', 'jenisPenilaian', 'region.teams.teamsUsers.user',
|
||||
]
|
||||
)->get();
|
||||
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
@@ -433,10 +437,10 @@ class PenilaianController extends Controller
|
||||
$header = $headers[$type] ?? 'Pelaporan';
|
||||
$authorization = null;
|
||||
if ($header === 'SLA') {
|
||||
$authorization = Authorization::with(['user'])->find($id);
|
||||
$permohonan = Permohonan::find($authorization->permohonan_id);
|
||||
$authorization = Authorization::with(['user','permohonan.lampiranDokumen.jenisLampiran'])->find($id);
|
||||
$permohonan = Permohonan::with(['lampiranDokumen.jenisLampiran'])->find($authorization->permohonan_id);
|
||||
} else {
|
||||
$permohonan = Permohonan::find($id);
|
||||
$permohonan = Permohonan::with(['lampiranDokumen.jenisLampiran'])->find($id);
|
||||
}
|
||||
if ($header === 'SLA') {
|
||||
return view('lpj::penilaian.otorisator.sla', compact('permohonan', 'header', 'authorization'));
|
||||
@@ -450,7 +454,7 @@ class PenilaianController extends Controller
|
||||
|
||||
public function otorisatorUpdate(Request $request, $id, $context)
|
||||
{
|
||||
if ($context === 'SLA') {
|
||||
if ($context === 'Freze SLA' || $context === 'Unfreeze SLA') {
|
||||
$authorization = Authorization::with(['user'])->find($id);
|
||||
if (!$authorization) {
|
||||
return response()->json([
|
||||
@@ -482,14 +486,14 @@ class PenilaianController extends Controller
|
||||
|
||||
$permohonan->update([
|
||||
'status_bayar' => $newStatus,
|
||||
'keterangan' => $request->message,
|
||||
'keterangan' => $request->keterangan,
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'pembatalan':
|
||||
$permohonan->update([
|
||||
'status' => 'batal',
|
||||
'keterangan' => $request->message,
|
||||
'keterangan' => $request->keterangan,
|
||||
]);
|
||||
break;
|
||||
|
||||
@@ -509,11 +513,11 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
if ($approvalField) {
|
||||
$this->updatePermohonan($permohonan, $status, $approvalField, $request->message);
|
||||
$this->updatePermohonan($permohonan, $status, $approvalField, $request->keterangan);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'sla':
|
||||
case 'freze sla':
|
||||
if (Auth::user()->roles[0]->name === 'senior-officer' || Auth::user()->roles[0]->name === 'administrator' && $authorization->approve_so === null) {
|
||||
$authorization->update([
|
||||
'status' => '3',
|
||||
@@ -559,11 +563,12 @@ class PenilaianController extends Controller
|
||||
'status_so' => '1',
|
||||
'approve_so' => Auth::user()->id,
|
||||
'approve_so_at' => now(),
|
||||
'keterangan_so' => $request->message,
|
||||
'keterangan_so' => $request->keterangan,
|
||||
]);
|
||||
|
||||
$permohonan->update([
|
||||
'tanggal_paparan' => $request->tanggalPaparan
|
||||
'tanggal_paparan' => $request->tanggalPaparan,
|
||||
'keterangan' => $request->keterangan
|
||||
]);
|
||||
} elseif (Auth::user()->roles[0]->name === 'EO Appraisal') {
|
||||
$status = '2';
|
||||
@@ -578,7 +583,7 @@ class PenilaianController extends Controller
|
||||
'status_eo' => '1',
|
||||
'approve_eo' => Auth::user()->id,
|
||||
'approve_eo_at' => now(),
|
||||
'keterangan_eo' => $request->message,
|
||||
'keterangan_eo' => $request->keterangan,
|
||||
]);
|
||||
} elseif (Auth::user()->roles[0]->name === 'DD Appraisal' || Auth::user()->roles[0]->name === 'administrator' && $authorization->approve_so && $authorization->approve_dd === null) {
|
||||
$authorization->update([
|
||||
@@ -586,7 +591,7 @@ class PenilaianController extends Controller
|
||||
'status_dd' => '1',
|
||||
'approve_dd' => Auth::user()->id,
|
||||
'approve_dd_at' => now(),
|
||||
'keterangan_dd' => $request->message,
|
||||
'keterangan_dd' => $request->keterangan,
|
||||
]);
|
||||
|
||||
$permohonan->update([
|
||||
@@ -594,6 +599,14 @@ class PenilaianController extends Controller
|
||||
]);
|
||||
}
|
||||
break;
|
||||
case 'unfreeze sla':
|
||||
$authorization->update([
|
||||
'request' => 'unfreeze-sla',
|
||||
]);
|
||||
$permohonan->update([
|
||||
'status' => 'unfreeze-sla',
|
||||
]);
|
||||
break;
|
||||
|
||||
default:
|
||||
return response()->json([
|
||||
@@ -632,7 +645,7 @@ class PenilaianController extends Controller
|
||||
'Pelaporan' => 'proses-laporan',
|
||||
'Pembayaran' => 'proses',
|
||||
'Pembatalan' => 'batal',
|
||||
'SLA' => 'freeze',
|
||||
'SLA' => 'request-freeze',
|
||||
'Paparan' => 'proses-paparan',
|
||||
default => '',
|
||||
};
|
||||
@@ -664,7 +677,7 @@ class PenilaianController extends Controller
|
||||
$query->whereRaw('LOWER(status) = ?', [strtolower($status)]);
|
||||
} elseif ($status == 'batal') {
|
||||
$query->whereRaw('LOWER(status) = ?', [strtolower($status)]);
|
||||
} elseif ($status == 'freeze') {
|
||||
} elseif ($status == 'request-freeze') {
|
||||
$query->whereRaw('LOWER(status) = ?', [strtolower($status)]);
|
||||
} elseif ($status == 'proses-paparan') {
|
||||
$query->whereRaw('LOWER(status) IN (?, ?)', ['proses-paparan', 'paparan']);
|
||||
@@ -729,8 +742,8 @@ class PenilaianController extends Controller
|
||||
'tujuanPenilaian',
|
||||
'nilaiPlafond',
|
||||
'penilaian.userPenilai' => function ($q) {
|
||||
$q->where('role', 'penilai')->with(['user', 'team.regions']);
|
||||
},
|
||||
$q->where('role', 'penilai')->with(['user', 'team.regions']);
|
||||
},
|
||||
'penilai',
|
||||
'approveSo',
|
||||
'approveEo',
|
||||
@@ -824,8 +837,8 @@ class PenilaianController extends Controller
|
||||
private function getViewLaporan($tipe)
|
||||
{
|
||||
$viewMap = [
|
||||
'sederhana' => 'penilai.components.lpj-sederhana-standard',
|
||||
'standard' => 'penilai.components.lpj-sederhana-standard',
|
||||
'sederhana' => 'penilai.components.lpj-sederhana-standar',
|
||||
'standar' => 'penilai.components.lpj-sederhana-standar',
|
||||
'resume' => 'penilai.components.resume',
|
||||
'memo' => 'penilai.components.memo',
|
||||
'rap' => 'penilai.components.rap-penilai',
|
||||
@@ -890,28 +903,39 @@ class PenilaianController extends Controller
|
||||
|
||||
public function revisiLaporan(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
$userRole = Auth::user()->roles[0]->name;
|
||||
// dd($id);
|
||||
if ($request->dataHeader == 'Paparan' || $request->dataHeader == 'Freze SLA') {
|
||||
$authorization = Authorization::find($id);
|
||||
$permohonan = Permohonan::find($authorization->permohonan_id);
|
||||
} else {
|
||||
$permohonan = Permohonan::find($id);
|
||||
$userRole = Auth::user()->roles[0]->name;
|
||||
}
|
||||
|
||||
if ($permohonan->status === 'proses-paparan') {
|
||||
if ($authorization) {
|
||||
$authorization->delete();
|
||||
}
|
||||
|
||||
if ($permohonan->status === 'proses-paparan' && in_array($userRole, ['EO Appraisal', 'DD Appraisal'])) {
|
||||
Authorization::delete([
|
||||
'permohonan_id' => $permohonan->id,
|
||||
'jenis' => 'paparan',
|
||||
'request' => 'paparan',
|
||||
]);
|
||||
$status = 'revisi-paparan';
|
||||
} elseif ($permohonan->status === 'request-freeze') {
|
||||
if ($authorization) {
|
||||
$authorization->delete();
|
||||
}
|
||||
|
||||
$status = 'reject-freeze';
|
||||
} elseif ($permohonan->status === 'proses-laporan' && $userRole === 'EO Appraisal') {
|
||||
$permohonan->update([
|
||||
'approve_so' => null,
|
||||
'approve_so_at' => null,
|
||||
'approval_so' => 0,
|
||||
'approval_so_at' => null,
|
||||
]);
|
||||
$status = 'revisi-laporan';
|
||||
} elseif ($permohonan->status === 'proses-laporan' && $userRole === 'DD Appraisal') {
|
||||
$permohonan->update([
|
||||
'approve_so' => null,
|
||||
'approve_so_at' => null,
|
||||
'approve_eo' => null,
|
||||
'approve_eo_at' => null,
|
||||
'approval_so' => 0,
|
||||
'approval_so_at' => null,
|
||||
'approval_eo' => 0,
|
||||
'approval_eo_at' => null,
|
||||
|
||||
]);
|
||||
$status = 'revisi-laporan';
|
||||
@@ -925,7 +949,7 @@ class PenilaianController extends Controller
|
||||
// Perbarui status dan informasi lainnya
|
||||
$permohonan->update([
|
||||
'status' => $status,
|
||||
'keterangan' => $request->message,
|
||||
'keterangan' => $request->keterangan,
|
||||
'submitted_at' => now(),
|
||||
]);
|
||||
|
||||
|
||||
@@ -448,6 +448,7 @@ class PermohonanController extends Controller
|
||||
'nomor_registrasi' => 'required',
|
||||
'reschedule_note' => 'required',
|
||||
'reschedule_date' => 'required',
|
||||
'keterangan' => 'required'
|
||||
]);
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
@@ -437,7 +437,11 @@ class ProsesPenawaranController extends Controller
|
||||
public function show($id)
|
||||
{
|
||||
$prosespenawaran = PenawaranTender::find($id);
|
||||
return view('lpj::prosespenawaran.show', compact('id', 'prosespenawaran'));
|
||||
$permohonan = "";
|
||||
if($prosespenawaran){
|
||||
$permohonan = Permohonan::where('nomor_registrasi',$prosespenawaran->nomor_registrasi)->first();
|
||||
}
|
||||
return view('lpj::prosespenawaran.show', compact('id', 'prosespenawaran','permohonan'));
|
||||
}
|
||||
|
||||
public function updateDraft(Request $request, $id): JsonResponse
|
||||
|
||||
@@ -1,253 +1,265 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use Modules\Lpj\Models\DokumenJaminan;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use Modules\Lpj\Models\DokumenJaminan;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\Penilai;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
|
||||
class RegistrasiController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
class RegistrasiController extends Controller
|
||||
{
|
||||
return view('lpj::registrasi.index');
|
||||
}
|
||||
public $user;
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::registrasi.index');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query()
|
||||
->whereIn('status', ['preregister', 'revisi']);
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query()
|
||||
->whereIn('status', ['preregister', 'revisi']);
|
||||
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
public function edit($id)
|
||||
{
|
||||
return view('lpj::registrasi.edit', compact('id'));
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
public function setData(Request $request)
|
||||
: JsonResponse
|
||||
{
|
||||
$data = [];
|
||||
$datas = [];
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
if (request()->ajax()) {
|
||||
$id = $request->id;
|
||||
$datas = Permohonan::find($id);
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
if ($datas) {
|
||||
$jenisPenilaians = null;
|
||||
$regions = null;
|
||||
$regions = Regions::pluck('name', 'id');
|
||||
$jenisPenilaians = JenisPenilaian::pluck('name', 'id');
|
||||
|
||||
$data['status'] = 'success';
|
||||
$data['regions'] = $regions;
|
||||
$data['jenisPenilaians'] = $jenisPenilaians;
|
||||
$data['datas'] = $datas;
|
||||
$data['message'] ['message_success'] = ["data successfully found"];
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['datas'] = null;
|
||||
$data['message'] ['message_data'] = ["data not found"];
|
||||
}
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['message']['message_ajax'] = ["no ajax request"];
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
$debitur = Debiture::find($permohonan->debiture_id);
|
||||
$documents = DokumenJaminan::with('pemilik', 'detail')->where('permohonan_id', $id)->get();
|
||||
return view('lpj::registrasi.show', compact('id', 'permohonan', 'documents', 'debitur'));
|
||||
}
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
public function storeRevisi(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
$permohonan->update([
|
||||
'status' => 'registered'
|
||||
]);
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
return redirect()->route('registrasi.index')->with('success', 'Submit Revision successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('registrasi.index')
|
||||
->with('error', 'Failed to create permohonan' . $e->getMessage());
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
return view('lpj::registrasi.edit', compact('id'));
|
||||
}
|
||||
public function update(Request $request, $id)
|
||||
: JsonResponse
|
||||
{
|
||||
// init
|
||||
$data = [];
|
||||
$dataku = [];
|
||||
$tindakan = null;
|
||||
if (request()->ajax()) {
|
||||
$validator = RegistrasiController::rulesEditnya($request, $id);
|
||||
|
||||
public function setData(Request $request): JsonResponse
|
||||
{
|
||||
$data = [];
|
||||
$datas = [];
|
||||
if ($validator['fails']) {
|
||||
$data['message'] = $validator['errors'];
|
||||
$data['status'] = 'error';
|
||||
} else {
|
||||
try {
|
||||
$tindakan = $request->tindakan;
|
||||
$dataku = [
|
||||
'registrasi_by' => Auth::id(),
|
||||
'registrasi_at' => now(),
|
||||
];
|
||||
|
||||
if (request()->ajax()) {
|
||||
$id = $request->id;
|
||||
$datas = Permohonan::find($id);
|
||||
if ($tindakan == 0) {
|
||||
$dataku['jenis_penilaian_id'] = $request->jenis_penilaian;
|
||||
$dataku['region_id'] = $request->region;
|
||||
$dataku['status'] = 'registered';
|
||||
if ($request->catatan2) {
|
||||
$dataku['registrasi_catatan'] = $request->catatan2;
|
||||
}
|
||||
} else {
|
||||
$dataku['registrasi_catatan'] = $request->catatan;
|
||||
$dataku['status'] = 'revisi';
|
||||
}
|
||||
|
||||
if ($datas) {
|
||||
$jenisPenilaians = null;
|
||||
$regions = null;
|
||||
$regions = Regions::pluck('name', 'id');
|
||||
$jenisPenilaians = JenisPenilaian::pluck('name', 'id');
|
||||
$data['dataku'] = $dataku;
|
||||
|
||||
$data['status'] = 'success';
|
||||
$data['regions'] = $regions;
|
||||
$data['jenisPenilaians'] = $jenisPenilaians;
|
||||
$data['datas'] = $datas;
|
||||
$data['message'] ['message_success'] = ["data successfully found"];
|
||||
$modal = Permohonan::find($id);
|
||||
|
||||
$modal->update($dataku);
|
||||
|
||||
if ($modal && $request->jenis_laporan) {
|
||||
foreach ($modal->documents as $document) {
|
||||
Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $id,
|
||||
'dokument_id' => $document->id
|
||||
],
|
||||
['type' => $request->jenis_laporan]
|
||||
);
|
||||
}
|
||||
}
|
||||
//
|
||||
$data['status'] = 'success';
|
||||
$data['message'] ['message_success'] = ['Regitrasi ' . $modal->nomor_registrasi . ' successfully'];
|
||||
} catch (Exception $e) {
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_try_catch'] = ['Regitrasi updated failed.'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['datas'] = null;
|
||||
$data['message'] ['message_data'] = ["data not found"];
|
||||
$data['message'] ['message_ajax'] = ["no ajax request"];
|
||||
}
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['message']['message_ajax'] = ["no ajax request"];
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
public function rulesEditnya($request, $id)
|
||||
{
|
||||
$tindakan = null;
|
||||
$jenis_penilaian = null;
|
||||
$validate_catatan = '';
|
||||
$tindakan = $request->tindakan;
|
||||
$jenis_penilaian = $request->jenis_penilaian;
|
||||
|
||||
public function update(Request $request, $id): JsonResponse
|
||||
{
|
||||
// init
|
||||
$data = [];
|
||||
$dataku = [];
|
||||
$tindakan = null;
|
||||
if (request()->ajax()) {
|
||||
$validator = RegistrasiController::rulesEditnya($request, $id);
|
||||
$validateIt = [
|
||||
// 'name' diambil dari definisi parameter yang di kirim pada POST Data
|
||||
'tindakan' => 'required',
|
||||
];
|
||||
|
||||
if ($validator['fails']) {
|
||||
$data['message'] = $validator['errors'];
|
||||
$data['status'] = 'error';
|
||||
} else {
|
||||
try {
|
||||
$tindakan = $request->tindakan;
|
||||
$dataku = [
|
||||
'registrasi_by' => Auth::id(),
|
||||
'registrasi_at' => now(),
|
||||
];
|
||||
$messageIt = [
|
||||
'tindakan.required' => 'Silahkan pilih Tindakan',
|
||||
];
|
||||
|
||||
if ($tindakan == 0) {
|
||||
$dataku['jenis_penilaian_id'] = $request->jenis_penilaian;
|
||||
$dataku['region_id'] = $request->region;
|
||||
$dataku['sla'] = $request->sla;
|
||||
$dataku['status'] = 'registered';
|
||||
if ($request->catatan2) {
|
||||
$dataku['registrasi_catatan'] = $request->catatan2;
|
||||
}
|
||||
} else {
|
||||
$dataku['registrasi_catatan'] = $request->catatan;
|
||||
$dataku['status'] = 'revisi';
|
||||
}
|
||||
if ($tindakan == 0) {
|
||||
$validateIt['jenis_penilaian'] = ['required'];
|
||||
$messageIt ['jenis_penilaian.required'] = 'Silahkan pilih Jenis Penilaian';
|
||||
|
||||
$data['dataku'] = $dataku;
|
||||
|
||||
$modal = Permohonan::find($id);
|
||||
|
||||
$modal->update($dataku);
|
||||
//
|
||||
$data['status'] = 'success';
|
||||
$data['message'] ['message_success'] = ['Regitrasi ' . $modal->nomor_registrasi . ' successfully'];
|
||||
} catch (Exception $e) {
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_try_catch'] = ['Regitrasi updated failed.'];
|
||||
// INTERNAL
|
||||
if (1 == $jenis_penilaian) {
|
||||
$validateIt['region'] = ['required'];
|
||||
$messageIt ['region.required'] = 'Silahkan pilih Region';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_ajax'] = ["no ajax request"];
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function rulesEditnya($request, $id)
|
||||
{
|
||||
$tindakan = null;
|
||||
$jenis_penilaian = null;
|
||||
$validate_catatan = '';
|
||||
$tindakan = $request->tindakan;
|
||||
$jenis_penilaian = $request->jenis_penilaian;
|
||||
|
||||
$validateIt = [
|
||||
// 'name' diambil dari definisi parameter yang di kirim pada POST Data
|
||||
'tindakan' => 'required',
|
||||
];
|
||||
|
||||
$messageIt = [
|
||||
'tindakan.required' => 'Silahkan pilih Tindakan',
|
||||
];
|
||||
|
||||
if ($tindakan == 0) {
|
||||
$validateIt['jenis_penilaian'] = ['required'];
|
||||
$messageIt ['jenis_penilaian.required'] = 'Silahkan pilih Jenis Penilaian';
|
||||
|
||||
// INTERNAL
|
||||
if (1 == $jenis_penilaian) {
|
||||
$validateIt['region'] = ['required'];
|
||||
$messageIt ['region.required'] = 'Silahkan pilih Region';
|
||||
} else {
|
||||
$validateIt['sla'] = ['required'];
|
||||
$messageIt ['sla.required'] = 'Silahkan isi SLA';
|
||||
} else if ($tindakan == 1) {
|
||||
$validateIt['catatan'] = ['required'];
|
||||
$messageIt ['catatan.required'] = 'Silahkan isi Catatan';
|
||||
}
|
||||
|
||||
} elseif ($tindakan == 1) {
|
||||
$validateIt['catatan'] = ['required'];
|
||||
$messageIt ['catatan.required'] = 'Silahkan isi Catatan';
|
||||
}
|
||||
$validator = Validator::make($request->all(), $validateIt, $messageIt);
|
||||
|
||||
$validator = Validator::make($request->all(), $validateIt, $messageIt);
|
||||
|
||||
$data['fails'] = $validator->fails();
|
||||
$data['errors'] = $validator->errors();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
$debitur = Debiture::find($permohonan->debiture_id);
|
||||
$documents = DokumenJaminan::with('pemilik', 'detail')->where('debiture_id', $id)->get();
|
||||
return view('lpj::registrasi.show', compact('id', 'permohonan', 'documents', 'debitur'));
|
||||
}
|
||||
|
||||
public function storeRevisi(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
$permohonan->update([
|
||||
'status' => 'registered'
|
||||
]);
|
||||
|
||||
return redirect()->route('registrasi.index')->with('success', 'Submit Revision successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('registrasi.index')->with('error', 'Failed to create permohonan' . $e->getMessage());
|
||||
$data['fails'] = $validator->fails();
|
||||
$data['errors'] = $validator->errors();
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class SLAController extends Controller
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Authorization::query()->with('permohonan.debiture','user','approveSo','approveEo','approveDd')->where('jenis','sla');
|
||||
$query = Authorization::query()->with('permohonan.debiture', 'user', 'approveSo', 'approveEo', 'approveDd')->where('jenis', 'sla')->where('request', 'freeze');
|
||||
|
||||
// Pencarian berdasarkan parameter search
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
|
||||
@@ -148,26 +148,17 @@ use Illuminate\Support\Facades\Auth;
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
// dd(Carbon::now()->addDays(1)->format('d F Y'));
|
||||
// dd(Carbon::now()->subDays(1)->format('d F Y')); jenis_laporan_name
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('tujuan_penilaian_kjpp', 'tujuan_penilaian_kjpp.id','=','penawaran.tujuan_penilaian_kjpp_id')
|
||||
->leftJoin('penilaian', 'penilaian.nomor_registrasi','=','penawaran.nomor_registrasi')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'detail_penawaran.no_proposal as detail_penawaran_no_proposal',
|
||||
'detail_penawaran.tgl_proposal as detail_penawaran_tgl_proposal',
|
||||
'detail_penawaran.biaya_penawaran as detail_penawaran_biaya_penawaran',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name',
|
||||
'tujuan_penilaian_kjpp.name as tujuan_penilaian_kjpp_name',
|
||||
'jenis_laporan.code as jenis_laporan_code',
|
||||
'penilaian.waktu_penilaian as penilaian_waktu_penilain'
|
||||
)->first();
|
||||
$penawaran = PenawaranTender::with(['jenisLaporan','tujuanPenilaianKjpp','detail.kjpp','penilaian','persetujuan_penawaran'])->where('id',$id)->first();
|
||||
$penawaran->attachmentku = $penawaran->detail->attachment;
|
||||
$penawaran->detail_penawaran_no_proposal = $penawaran->detail->no_proposal;
|
||||
$penawaran->detail_penawaran_tgl_proposal = $penawaran->detail->tgl_proposal;
|
||||
$penawaran->detail_penawaran_biaya_penawaran = $penawaran->detail->biaya_penawaran;
|
||||
$penawaran->kjpp_name = $penawaran->detail->kjpp->name;
|
||||
$penawaran->kjpp_address = $penawaran->detail->kjpp->address;
|
||||
$penawaran->jenis_laporan_name = $penawaran->jenisLaporan->name;
|
||||
$penawaran->jenis_laporan_code = $penawaran->jenisLaporan->code;
|
||||
$penawaran->tujuan_penilaian_kjpp_name = $penawaran->tujuanPenilaianKjpp->name;
|
||||
$penawaran->penilaian_waktu_penilain = $penawaran->penilaian->waktu_penilaian ?? "";
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
@@ -236,28 +227,24 @@ use Illuminate\Support\Facades\Auth;
|
||||
|
||||
public function update(Request $request, $id): JsonResponse
|
||||
{
|
||||
|
||||
// init
|
||||
$data1 = [];
|
||||
// $dataPermohonan = array();
|
||||
$dataPenawaran = [];
|
||||
// data
|
||||
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('penilaian', 'penilaian.nomor_registrasi','=','penawaran.nomor_registrasi')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'detail_penawaran.no_proposal as detail_penawaran_no_proposal',
|
||||
'detail_penawaran.tgl_proposal as detail_penawaran_tgl_proposal',
|
||||
'detail_penawaran.biaya_penawaran as detail_penawaran_biaya_penawaran',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name',
|
||||
'jenis_laporan.code as jenis_laporan_code',
|
||||
'penilaian.waktu_penilaian as penilaian_waktu_penilain'
|
||||
)->first();
|
||||
$penawaran = PenawaranTender::with(['jenisLaporan','tujuanPenilaianKjpp','detail.kjpp','penilaian','persetujuan_penawaran'])->where('id',$id)->first();
|
||||
$penawaran->attachmentku = $penawaran->detail->attachment;
|
||||
$penawaran->detail_penawaran_no_proposal = $penawaran->detail->no_proposal;
|
||||
$penawaran->detail_penawaran_tgl_proposal = $penawaran->detail->tgl_proposal;
|
||||
$penawaran->detail_penawaran_biaya_penawaran = $penawaran->detail->biaya_penawaran;
|
||||
$penawaran->kjpp_name = $penawaran->detail->kjpp->name;
|
||||
$penawaran->kjpp_address = $penawaran->detail->kjpp->address;
|
||||
$penawaran->jenis_laporan_name = $penawaran->jenisLaporan->name;
|
||||
$penawaran->jenis_laporan_code = $penawaran->jenisLaporan->code;
|
||||
$penawaran->tujuan_penilaian_kjpp_name = $penawaran->tujuanPenilaianKjpp->name;
|
||||
$penawaran->penilaian_waktu_penilain = $penawaran->penilaian->waktu_penilaian ?? "";
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
@@ -398,4 +385,21 @@ use Illuminate\Support\Facades\Auth;
|
||||
|
||||
return response()->download(storage_path('app/public/' .$document->spk_dokumen_path));
|
||||
}
|
||||
|
||||
public function updateSla(Request $request, $id): JsonResponse
|
||||
{
|
||||
|
||||
$request->validate([
|
||||
'sla' => 'required|integer|min:1',
|
||||
]);
|
||||
|
||||
|
||||
$penawaran = PenawaranTender::find($id);
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)->first();
|
||||
|
||||
$permohonan->sla = $request->sla;
|
||||
$permohonan->save();
|
||||
|
||||
return response()->json(['message' => 'SLA updated successfully']);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -815,7 +815,7 @@ class TenderController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route('tender.penawaran.ulang.index')
|
||||
return redirect()->back()
|
||||
->with('success', 'Email Penawaran Berhasil Terkirim!');
|
||||
} catch (\Exception $e) {
|
||||
// Log email gagal untuk setiap KJPP
|
||||
@@ -871,7 +871,7 @@ class TenderController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route('tender.penawaran.showKirimEmail', ['noreg' => $noreg])
|
||||
return redirect()->back()
|
||||
->with('error', 'Email Penawaran Gagal Terkirim!');
|
||||
}
|
||||
}
|
||||
@@ -1015,7 +1015,7 @@ class TenderController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route('tender.penawaran.ulang.index')->with('success', 'Email Penawaran Berhasil Terkirim!');
|
||||
return redirect()->back()->with('success', 'Email Penawaran Berhasil Terkirim!');
|
||||
} catch (\Exception $e) {
|
||||
// Log email gagal
|
||||
foreach ($kjpps as $email) {
|
||||
@@ -1067,7 +1067,7 @@ class TenderController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route('tender.penawaran.showKirimEmail', ['noreg' => $noreg])->with('error', 'Email Penawaran Gagal Terkirim!');
|
||||
return redirect()->back()->with('error', 'Email Penawaran Gagal Terkirim!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class CustomFieldRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:255',
|
||||
'type' => 'required|in:text,select,radio,checkbox',
|
||||
'type' => 'required|in:text,select,radio,checkbox,date,number',
|
||||
'label' => 'nullable|max:255',
|
||||
'urutan_prioritas' => [
|
||||
'nullable',
|
||||
|
||||
@@ -626,6 +626,8 @@ class FormSurveyorRequest extends FormRequest
|
||||
'foto_bhumi' => 'nullable',
|
||||
'foto_argis_region' => 'nullable',
|
||||
'foto_tempat' => 'nullable',
|
||||
'upload_gs' => 'nullable',
|
||||
'foto_sentuh_tanahku' => 'nullable',
|
||||
'keterangan' => 'nullable|array',
|
||||
];
|
||||
}
|
||||
@@ -687,6 +689,8 @@ class FormSurveyorRequest extends FormRequest
|
||||
'foto_bhumi' => 'nullable',
|
||||
'foto_argis_region' => 'nullable',
|
||||
'foto_tempat' => 'nullable',
|
||||
'upload_gs' => 'nullable',
|
||||
'foto_sentuh_tanahku' => 'nullable',
|
||||
'keterangan' => 'nullable|array',
|
||||
|
||||
];
|
||||
|
||||
54
app/Http/Requests/JenisLampiranRequest.php
Normal file
54
app/Http/Requests/JenisLampiranRequest.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class JenisLampiranRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = [
|
||||
'nama' => [
|
||||
'required',
|
||||
'string',
|
||||
'max:255',
|
||||
Rule::unique('jenis_lampiran')->where(function ($query) {
|
||||
return $query->whereNull('deleted_at');
|
||||
})->ignore($this->route('jenis_lampiran')),
|
||||
],
|
||||
'deskripsi' => 'nullable|string',
|
||||
];
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom messages for validator errors.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'nama.required' => 'Nama jenis lampiran harus diisi.',
|
||||
'nama.max' => 'Nama jenis lampiran tidak boleh lebih dari 255 karakter.',
|
||||
];
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/LaporanExternalRequest.php
Normal file
41
app/Http/Requests/LaporanExternalRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LaporanExternalRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules()
|
||||
: array
|
||||
{
|
||||
return [
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'nomor_laporan' => 'nullable|string|max:255',
|
||||
'tgl_final_laporan' => 'nullable|date',
|
||||
'nilai_pasar' => 'nullable|numeric',
|
||||
'indikasi_nilai_likuidasi' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_tanah' => 'nullable|numeric',
|
||||
'estimasi_harga_tanah' => 'nullable|numeric',
|
||||
'estimasi_harga_bangunan' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_bangunan' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_sarana_pelengkap' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_mesin' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_kendaraan_alat_berat' => 'nullable|numeric',
|
||||
'file_resume' => 'nullable|file|mimes:pdf|max:10240', // 10MB max
|
||||
'file_laporan' => 'nullable|file|mimes:pdf|max:10240',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize()
|
||||
: bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
'status' => 'nullable|string',
|
||||
'jenis_fasilitas_kredit_id' => 'required|exists:jenis_fasilitas_kredit,id',
|
||||
'nilai_plafond_id' => 'required|exists:nilai_plafond,id',
|
||||
'status_bayar' => 'required|string',
|
||||
'status_bayar' => 'nullable|string',
|
||||
'nilai_njop' => 'nullable|numeric'
|
||||
];
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class TenderPenawaranRequest extends FormRequest
|
||||
{
|
||||
$rules = [
|
||||
'nama_kjpp_sebelumnya' => 'nullable',
|
||||
'biaya_kjpp_sebelumnya' => 'nullable|numeric',
|
||||
'biaya_kjpp_sebelumnya' => 'nullable',
|
||||
'tanggal_penilaian_sebelumnya' => 'nullable',
|
||||
'nomor_registrasi' => 'required',
|
||||
'kjpp.*' => 'exists:kjpp,id',
|
||||
|
||||
20
app/Models/JenisLampiran.php
Normal file
20
app/Models/JenisLampiran.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Modules\Lpj\Models\Base;
|
||||
use Modules\Lpj\Models\LampiranDokumen;
|
||||
|
||||
class JenisLampiran extends Base
|
||||
{
|
||||
|
||||
protected $table = 'jenis_lampiran';
|
||||
protected $fillable = ['nama', 'deskripsi'];
|
||||
|
||||
public function lampiranDokumen()
|
||||
{
|
||||
return $this->hasMany(LampiranDokumen::class);
|
||||
}
|
||||
}
|
||||
71
app/Models/LampiranDokumen.php
Normal file
71
app/Models/LampiranDokumen.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class LampiranDokumen extends Base
|
||||
{
|
||||
protected $table = 'lampiran_dokumen';
|
||||
|
||||
protected $fillable = ['permohonan_id', 'nama_file', 'path_file', 'keterangan','jenis_lampiran_id'];
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload lampiran dokumen for penilai or administrator
|
||||
*
|
||||
* @param int $permohonanId
|
||||
* @param array $fileData
|
||||
* @return LampiranDokumen|null
|
||||
*/
|
||||
public static function uploadLampiran($fileData)
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user && $user->hasAnyRole(['penilai', 'administrator', 'Penilai', 'admin','surveyor'])) {
|
||||
$file = $fileData['file'];
|
||||
$fileName = $fileData['nama_file'] ?? time() . '_' . $file->getClientOriginalName();
|
||||
$filePath = $file->storeAs('lampiran_dokumen', $fileName, 'public');
|
||||
|
||||
return self::create([
|
||||
'permohonan_id' => $fileData['permohonan_id'] ?? null,
|
||||
'jenis_lampiran_id' => $fileData['jenis_lampiran_id'] ?? null,
|
||||
'nama_file' => $fileName,
|
||||
'path_file' => $filePath,
|
||||
'keterangan' => $fileData['keterangan'] ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete lampiran dokumen
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteLampiran()
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user && ($user->hasRole('penilai') || $user->hasRole('administrator'))) {
|
||||
// Delete the file from storage
|
||||
Storage::disk('public')->delete($this->path_file);
|
||||
|
||||
// Delete the database record
|
||||
return $this->delete();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function jenisLampiran()
|
||||
{
|
||||
return $this->belongsTo(JenisLampiran::class);
|
||||
}
|
||||
}
|
||||
32
app/Models/LaporanExternal.php
Normal file
32
app/Models/LaporanExternal.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Lpj\Database\Factories\LaporanExternalFactory;
|
||||
|
||||
class LaporanExternal extends Base
|
||||
{
|
||||
protected $fillable = [
|
||||
'permohonan_id',
|
||||
'nomor_laporan',
|
||||
'tgl_final_laporan',
|
||||
'nilai_pasar',
|
||||
'indikasi_nilai_likuidasi',
|
||||
'indikasi_nilai_pasar_tanah',
|
||||
'estimasi_harga_tanah',
|
||||
'estimasi_harga_bangunan',
|
||||
'indikasi_nilai_pasar_bangunan',
|
||||
'indikasi_nilai_pasar_sarana_pelengkap',
|
||||
'indikasi_nilai_pasar_mesin',
|
||||
'indikasi_nilai_pasar_kendaraan_alat_berat',
|
||||
'file_resume',
|
||||
'file_laporan',
|
||||
];
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class);
|
||||
}
|
||||
}
|
||||
@@ -59,4 +59,12 @@ class PenawaranTender extends Model
|
||||
public function persetujuan(){
|
||||
return $this->belongsTo(PersetujuanPenawaran::class, 'id', 'penawaran_id');
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
return $this->belongsTo(Penilaian::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function persetujuan_penawaran(){
|
||||
return $this->belongsTo(PersetujuanPenawaran::class, 'id', 'penawaran_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,8 @@
|
||||
return $this->belongsTo(JenisFasilitasKredit::class);
|
||||
}
|
||||
|
||||
public function jenisPenilaian(){
|
||||
public function jenisPenilaian()
|
||||
{
|
||||
return $this->belongsTo(JenisPenilaian::class);
|
||||
}
|
||||
|
||||
@@ -170,7 +171,8 @@
|
||||
return $this->belongsTo(Penilaian::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function penilai(){
|
||||
public function penilai()
|
||||
{
|
||||
return $this->belongsTo(Penilai::class, 'id', 'permohonan_id');
|
||||
}
|
||||
|
||||
@@ -199,27 +201,43 @@
|
||||
return $this->hasMany(DokumenJaminan::class);
|
||||
}
|
||||
|
||||
public function pembatalan(){
|
||||
public function pembatalan()
|
||||
{
|
||||
return $this->hasMany(PermohonanPembatalan::class);
|
||||
}
|
||||
|
||||
public function approveBayar(){
|
||||
public function approveBayar()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approve_bayar_by', 'id');
|
||||
}
|
||||
|
||||
public function approveEo(){
|
||||
public function approveEo()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approval_eo', 'id');
|
||||
}
|
||||
|
||||
public function approveDd(){
|
||||
public function approveDd()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approval_dd', 'id');
|
||||
}
|
||||
|
||||
public function approveSo(){
|
||||
public function approveSo()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approval_so', 'id');
|
||||
}
|
||||
|
||||
public function authorization(){
|
||||
public function authorization()
|
||||
{
|
||||
return $this->belongsTo(Authorization::class, 'id', 'permohonan_id');
|
||||
}
|
||||
|
||||
public function lampiranDokumen()
|
||||
{
|
||||
return $this->hasMany(LampiranDokumen::class);
|
||||
}
|
||||
|
||||
public function laporanExternal()
|
||||
{
|
||||
return $this->belongsTo(LaporanExternal::class,'id','permohonan_id');
|
||||
}
|
||||
}
|
||||
|
||||
1060
app/Services/SaveFormInspesksiService.php
Normal file
1060
app/Services/SaveFormInspesksiService.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('laporan_externals', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Permohonan::class)->constrained('permohonan')->onDelete('cascade');
|
||||
$table->string('nomor_laporan');
|
||||
$table->date('tgl_final_laporan')->nullable();
|
||||
$table->decimal('nilai_pasar', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_likuidasi', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_tanah', 15, 2)->nullable();
|
||||
$table->decimal('estimasi_harga_tanah', 15, 2)->nullable();
|
||||
$table->decimal('estimasi_harga_bangunan', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_bangunan', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_sarana_pelengkap', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_mesin', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_kendaraan_alat_berat', 15, 2)->nullable();
|
||||
$table->string('file_resume')->nullable(); // New field for resume file
|
||||
$table->string('file_laporan')->nullable(); // New field for report file
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('laporan_externals');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLampiranDokumenTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('lampiran_dokumen', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('permohonan_id');
|
||||
$table->string('nama_file');
|
||||
$table->string('path_file');
|
||||
$table->text('keterangan')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
|
||||
$table->foreign('permohonan_id')->references('id')->on('permohonan')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('lampiran_dokumen');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('jenis_lampiran', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nama');
|
||||
$table->text('deskripsi')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jenis_lampiran');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\JenisLampiran;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('lampiran_dokumen', function (Blueprint $table) {
|
||||
$table->foreignIdFor(JenisLampiran::class)->constrained('jenis_lampiran')->onDelete('cascade')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('lampiran_dokumen', function (Blueprint $table) {
|
||||
$table->dropForeign(['jenis_lampiran_id']);
|
||||
$table->dropColumn('jenis_lampiran_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
23
module.json
23
module.json
@@ -218,6 +218,18 @@
|
||||
"admin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan External",
|
||||
"path": "laporan-external",
|
||||
"icon": "ki-filled ki-document text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"admin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Registrasi Final",
|
||||
"path": "registrasifinal",
|
||||
@@ -868,6 +880,17 @@
|
||||
"administrator",
|
||||
"admin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Jenis Lampiran",
|
||||
"path": "basicdata.jenis-lampiran",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"admin"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -57,45 +57,47 @@
|
||||
|
||||
@if ($permohonan->status === 'done')
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
|
||||
$jaminanId = $dokumen->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'ALAT BERAT'];
|
||||
@endphp
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
$jaminanId = $dokumen->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'ALAT BERAT'];
|
||||
@endphp
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Hasil Laporan Penilaian
|
||||
</h3>
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Hasil Laporan Penilaian
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<a class="btn btn-info" href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id ]) }}" class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success" onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="card-body">
|
||||
@include('lpj::component.lampiran-dokumen')
|
||||
|
||||
<a class="btn btn-info" href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id ]) }}" class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success" onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
@include('lpj::component.history-permohonan')
|
||||
</div>
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
@include('lpj::component.history-permohonan')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
@@ -120,8 +120,8 @@
|
||||
<th class="min-w-[100px]">Tgl Assign</th>
|
||||
<th class="min-w-[100px]">Tgl Kunjungan</th>
|
||||
<th class="min-w-[100px]">Progress</th>
|
||||
<th class="min-w-[100px]">Due Date SLA</th>
|
||||
<th class="min-w-[100px]">Paparan</th>
|
||||
<th class="min-w-[100px]">SLA Laporan</th>
|
||||
<th class="min-w-[100px]">SLA Paparan</th>
|
||||
<th class="min-w-[100px]">Approve</th>
|
||||
<th class="min-w-[50px] text-center">Keterangan</th>
|
||||
<th class="min-w-[50px] text-center">Action</th>
|
||||
@@ -251,6 +251,15 @@
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
}
|
||||
},
|
||||
due_date: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
},
|
||||
},
|
||||
|
||||
paparan: {
|
||||
title: 'Paparan',
|
||||
@@ -258,7 +267,7 @@
|
||||
if (!data.due_date_sla) {
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
return `${window.formatTanggalIndonesia(data.paparan)}`;
|
||||
}
|
||||
},
|
||||
approve: {
|
||||
@@ -283,10 +292,16 @@
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary" onclick="updateTeam(${data.user_penilai[0].penilaian_id}, ${data.permohonan.id}, ${data.user_penilai[0].user_id}, ${data.user_penilai[0].team_id})" title="Ganti Team">
|
||||
render: (item, data) => {
|
||||
const roles = data.user_penilai.map(d => d.role)
|
||||
let htmlData = ''
|
||||
|
||||
htmlData = `<a class="btn btn-sm btn-icon btn-clear btn-primary" onclick="updateTeam(${data.user_penilai[0].penilaian_id}, ${data.permohonan.id}, ${data.user_penilai[0].user_id}, ${data.user_penilai[0].team_id}, '${roles}')" title="Ganti Team">
|
||||
<i class="ki-filled ki-user-edit"></i>
|
||||
</a>`,
|
||||
</a>`
|
||||
|
||||
return htmlData;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -317,114 +332,181 @@
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function updateTeam(penilaaniId, permohonanId, userId, teamId) {
|
||||
const selectCategory = () => {
|
||||
function updateTeam(penilaaniId, permohonanId, userId, teamId, roles) {
|
||||
|
||||
|
||||
const selectCategory = () => {
|
||||
Swal.fire({
|
||||
title: 'Pilih Kategori',
|
||||
html: `
|
||||
<select id="categorySelect" class="input">
|
||||
<option value="" selected disabled>Pilih kategori Pengganti</option>
|
||||
<option value="team">Pilih dari Team</option>
|
||||
<option value="region">Pilih dari Wilayah</option>
|
||||
</select>
|
||||
`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Lanjut',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: () => {
|
||||
const selectedCategory = document.getElementById('categorySelect').value;
|
||||
if (!selectedCategory) {
|
||||
Swal.showValidationMessage('Anda harus memilih kategori!');
|
||||
}
|
||||
return selectedCategory;
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const selectedCategory = result.value;
|
||||
let subOptionsHtml = '';
|
||||
|
||||
if (selectedCategory === 'team') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
} else if (selectedCategory === 'region') {
|
||||
if (roles === 'surveyor' || roles === 'penilai') {
|
||||
subOptionsHtml = `
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input" disabled>
|
||||
<option value="${roles}" selected>${roles}</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Anggota Tim</option>
|
||||
@foreach ($teamsActivity as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div>
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
<option value="penilai">Penilai</option>
|
||||
<option value="sama">Penilai dan Surveyor Sama</option>
|
||||
</select>
|
||||
<select id="subOptionsSelect" class="input">
|
||||
<option value="" selected disabled>Pilih Wilayah</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->regions->id }}">{{ $item->regions->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: 'Pilih Kategori',
|
||||
input: 'select',
|
||||
inputOptions: {
|
||||
team: 'Pilih dari Team',
|
||||
region: 'Pilih dari Wilayah'
|
||||
},
|
||||
inputPlaceholder: 'Pilih kategori Pengganti',
|
||||
icon: 'warning',
|
||||
title: `Pilih ${selectedCategory === 'team' ? 'Anggota Tim' : 'Wilayah'}`,
|
||||
html: subOptionsHtml,
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Lanjut',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const selectedCategory = result.value;
|
||||
let subOptions = {};
|
||||
|
||||
if (selectedCategory === 'team') {
|
||||
subOptions = {
|
||||
@foreach ($teamsActivity as $item)
|
||||
{{ $item->user->id }}: '{{ $item->user->name }}',
|
||||
@endforeach
|
||||
};
|
||||
} else if (selectedCategory === 'region') {
|
||||
subOptions = {
|
||||
@foreach ($teamPenilai as $item)
|
||||
{{ $item->regions->id }}: '{{ $item->regions->name }}',
|
||||
@endforeach
|
||||
};
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Kembali',
|
||||
preConfirm: () => {
|
||||
const subOptionsPenugasan = document.getElementById('subOptionsPenugasan')?.value;
|
||||
const subSelected = document.getElementById('subOptionsSelect').value;
|
||||
if (!subSelected) {
|
||||
Swal.showValidationMessage('Anda harus memilih opsi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: 'Pilih ' + (selectedCategory === 'team' ? 'Anggota Tim' : 'Wilayah'),
|
||||
input: 'select',
|
||||
inputOptions: subOptions,
|
||||
inputPlaceholder: 'Pilih salah satu ' + (selectedCategory === 'team' ?
|
||||
'Anggota Tim' : 'Wilayah'),
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya',
|
||||
cancelButtonText: 'Kembali',
|
||||
}).then((subResult) => {
|
||||
if (subResult.dismiss === Swal.DismissReason.cancel) {
|
||||
// Kembali ke tahap pemilihan kategori
|
||||
selectCategory();
|
||||
} else if (subResult.isConfirmed) {
|
||||
if (!subResult.value) {
|
||||
Swal.fire('Error!', 'Anda harus memilih opsi sebelum melanjutkan.',
|
||||
'error');
|
||||
return;
|
||||
return {
|
||||
penugasan: subOptionsPenugasan || null,
|
||||
selectedOption: subSelected || null,
|
||||
};
|
||||
}
|
||||
}).then((subResult) => {
|
||||
|
||||
console.log(subResult);
|
||||
|
||||
if (subResult.dismiss === Swal.DismissReason.cancel) {
|
||||
selectCategory();
|
||||
} else if (subResult.isConfirmed) {
|
||||
if (!subResult.value) {
|
||||
Swal.fire('Error!', 'Anda harus memilih opsi sebelum melanjutkan.', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ URL::to('/activity/update-team') }}";
|
||||
const paramKey = selectedCategory === 'team' ? 'team_member_id' : 'region_id';
|
||||
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: penilaaniId,
|
||||
[paramKey]: subResult.value.selectedOption,
|
||||
penugasan: subResult.value.penugasan,
|
||||
permohonan_id: permohonanId,
|
||||
user_id: userId,
|
||||
team_id: teamId,
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses!', response.message, 'success').then(() => {
|
||||
location.reload(true);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
|
||||
// Define variables
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ URL::to('/activity/update-team') }}";
|
||||
|
||||
// Tentukan tipe parameter berdasarkan kategori
|
||||
const paramKey = selectedCategory === 'team' ? 'team_member_id' :
|
||||
'region_id';
|
||||
|
||||
// Prepare input data
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: penilaaniId,
|
||||
[paramKey]: subResult.value,
|
||||
permohonan_id: permohonanId,
|
||||
user_id: userId,
|
||||
team_id: teamId,
|
||||
};
|
||||
|
||||
// AJAX request
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses!', response.message,
|
||||
'success').then(() => {
|
||||
location.reload(true);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error(xhr);
|
||||
Swal.fire('Error!',
|
||||
'Terjadi kesalahan saat memproses permintaan.',
|
||||
'error');
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
console.error(xhr);
|
||||
Swal.fire('Error!', 'Terjadi kesalahan saat memproses permintaan.', 'error');
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
selectCategory();
|
||||
}
|
||||
|
||||
// Mulai dari pemilihan kategori
|
||||
selectCategory();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@if (!isset($status))
|
||||
<div class="card border border-agi-100 {{ isset($hidePermohonan) ? 'hidden' : '' }}">
|
||||
<div class="card-header light:bg-agi-50" id="advanced_settings_appearance">
|
||||
<div class="card-header bg-agi-50" id="advanced_settings_appearance">
|
||||
@php
|
||||
$title = $title ?? 'Data Permohonan';
|
||||
@endphp
|
||||
@@ -9,6 +9,7 @@
|
||||
</h3>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
{!! $customlink ?? "" !!}
|
||||
@if (isset($id))
|
||||
@php
|
||||
$parameters = isset($id) ? ['id' => $id] : [];
|
||||
@@ -49,33 +50,54 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
@if(isset($penawaran))
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $penawaran->code }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $penawaran->tujuanPenilaianKjpp->name }}
|
||||
</span>
|
||||
</div>
|
||||
@else
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nilai Plafond:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nilai Plafond:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->nilaiPlafond->name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Status Bayar:
|
||||
</h3>
|
||||
<span
|
||||
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Status Bayar:
|
||||
</h3>
|
||||
<span
|
||||
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
|
||||
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -177,6 +199,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header light:bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
@@ -236,93 +260,88 @@
|
||||
Alamat Jaminan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $dokumen->pemilik->address ?? '' }},
|
||||
<br> {{ $dokumen->pemilik->village->name ?? '' }},
|
||||
{{ $dokumen->pemilik->district->name ?? '' }},
|
||||
{{ $dokumen->pemilik->city->name ?? '' }},
|
||||
{{ $dokumen->pemilik->province->name ?? '' }} -
|
||||
{{ $dokumen->pemilik->village->postal_code ?? '' }}
|
||||
{{ formatAlamat($dokumen) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
<a href="{{ route('debitur.jaminan.bulk.download', ['id' => $permohonan->debiture->id, 'jaminan' => $dokumen->id]) }}"
|
||||
class="ml-6 btn btn-dark dark:btn-light">
|
||||
<i class="ki-outline ki-cloud-download"></i> Download Semua Dokumen
|
||||
</a>
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
@php $document = $dokumen; @endphp
|
||||
@foreach($document->detail as $detail)
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
|
||||
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normal text-2sm">
|
||||
{{ $detail->name ?? '' }}
|
||||
<td colspan="2">
|
||||
<strong class="text-2xs text-gray-600 uppercase">
|
||||
{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
@if(isset($detail->details))
|
||||
@if(json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
<tr>
|
||||
<td class="py-3 capitalize">
|
||||
{{ str_replace("_"," ",$key) ?? "" }}
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normal text-2sm">
|
||||
{{ $value ?? "" }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px] align-top">
|
||||
Dokumen Jaminan
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div class="flex w-full lg:w-[30%]">
|
||||
@if (in_array(Auth::user()->roles[0]->name, ['administrator', 'pemohon-eo']))
|
||||
@if (!empty($dokumen_nomor))
|
||||
<span class="flex-1 mt-2 text-info">Nomor Dokumen :
|
||||
{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<span class="flex-none badge badge-sm badge-outline badge-warning mt-2"
|
||||
onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i
|
||||
class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
</div>
|
||||
<br>
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<tr>
|
||||
<td>
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')">
|
||||
<i class="ki-filled ki-eye mr-2"></i>Preview
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if(isset($detail->details) && isset(json_decode($detail->details)[$index]))
|
||||
@foreach (json_decode($detail->details)[$index] as $key => $value)
|
||||
<tr>
|
||||
<td>
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
- {{ str_replace("_"," ",$key) ?? "" }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<p class="text-2xs text-gray-600 max-w-[250px]">
|
||||
{{ $value }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px]">
|
||||
Keterangan
|
||||
<td>
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
- keterangan
|
||||
</span>
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
{{ $detail->keterangan ?? '' }}
|
||||
<td class="text-right">
|
||||
<p class="text-2xs text-gray-600 max-w-[250px]">
|
||||
{{ $detail->keterangan }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
@@ -332,6 +351,10 @@
|
||||
</div>
|
||||
@if (!isset($status))
|
||||
</div>
|
||||
|
||||
@include('lpj::component.lampiran-dokumen')
|
||||
@include('lpj::component.history-permohonan')
|
||||
|
||||
|
||||
@endif
|
||||
@include('lpj::component.pdfviewer')
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@@ -17,8 +16,8 @@
|
||||
|
||||
|
||||
@if (array_intersect($kategoriUnik, ['tanah', 'bangunan', 'apartemen-kantor']))
|
||||
@include('lpj::surveyor.components.header')
|
||||
@endif
|
||||
@include('lpj::surveyor.components.header')
|
||||
@endif
|
||||
|
||||
@foreach ($kategoriUnik as $kategori)
|
||||
{{-- Tampilkan komponen sesuai kategori --}}
|
||||
@@ -36,6 +35,12 @@
|
||||
<h3 class="card-title uppercase">
|
||||
Informasi dan pembanding
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<a href="{{ route('penilai.showDataPembanding', ['id' => $permohonan->id]) }}?dokument={{ request()->documentId }}&jenis_jaminan={{ request()->jaminanId }}"
|
||||
class="btn btn-primary" data-bs-toggle="modal">
|
||||
Edit Data Pembanding
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@include('lpj::penilai.components.informasi-pembanding')
|
||||
</div>
|
||||
@@ -70,6 +75,21 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($kategoriUnik as $item)
|
||||
@php
|
||||
|
||||
if ($item === 'bangunan') {
|
||||
$luas =
|
||||
$forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ??
|
||||
($forminspeksi['bangunan']['luas_tanah_bagunan']['sesuai'] ?? null);
|
||||
} elseif ($item === 'tanah') {
|
||||
$luas =
|
||||
$forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ??
|
||||
($forminspeksi['tanah']['luas_tanah']['sesuai'] ?? null);
|
||||
} else {
|
||||
$luas = null;
|
||||
}
|
||||
$luas = old('luas_' . $item, $lpjData['luas_' . $item] ?? $luas);
|
||||
@endphp
|
||||
@if (isset($labelNilai[$item]))
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
@@ -77,16 +97,15 @@
|
||||
{{ $labelNilai[$item] }}
|
||||
</label>
|
||||
<input type="text" id="luas_{{ $item }}" class="input w-full"
|
||||
name="luas_{{ $item }}"
|
||||
value="{{ old('luas_' . $item, $lpjData['luas_' . $item] ?? null) }}"
|
||||
name="luas_{{ $item }}" value="{{ $luas }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp</i>
|
||||
<input type="text" id="nilai_{{ $item }}_1"
|
||||
class="w-full currency" name="nilai_{{ $item }}_1"
|
||||
<input type="text" id="nilai_{{ $item }}_1" class="w-full currency"
|
||||
name="nilai_{{ $item }}_1"
|
||||
value="{{ old('nilai_' . $item . '_1', $lpjData['nilai_' . $item . '_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
@@ -124,7 +143,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tambah mb-10" style="margin-bottom: 20px;">
|
||||
<div class="tambah mb-10" style="margin-bottom: 20px;">
|
||||
<button type="button" id="tambah-npw" class="btn btn-primary">
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
Tambah NPW </button>
|
||||
@@ -237,7 +256,7 @@
|
||||
placeholder="Nama NPW">
|
||||
|
||||
<input type="text"
|
||||
id="luas_npw_${npwCounter}"
|
||||
id="ls_npw_${npwCounter}"
|
||||
class="input w-full "
|
||||
name="luas_npw_${npwCounter}"
|
||||
placeholder="Luas NPW"
|
||||
@@ -314,7 +333,7 @@
|
||||
placeholder="Nama NPW"
|
||||
value="${npw.name || ''}">
|
||||
<input type="text"
|
||||
id="luas_npw_${npwCounter}"
|
||||
id="ls_npw_${npwCounter}"
|
||||
class="input w-full currency-format"
|
||||
name="luas_npw_${npwCounter}"
|
||||
placeholder="Luas NPW"
|
||||
@@ -440,6 +459,7 @@
|
||||
const kategoriItems = document.querySelectorAll('[id^="luas_"]');
|
||||
|
||||
kategoriItems.forEach(item => {
|
||||
|
||||
const kategori = item.id.replace('luas_', '');
|
||||
const luasInput = document.getElementById(`luas_${kategori}`);
|
||||
const nilaiInput = document.querySelector(`input[name="nilai_${kategori}_1"]`);
|
||||
@@ -458,7 +478,7 @@
|
||||
// Tambahkan perhitungan untuk NPW tambahan
|
||||
const npwRows = document.querySelectorAll('.npw-row');
|
||||
npwRows.forEach(row => {
|
||||
const luasInput = row.querySelector('input[id^="luas_npw_"]');
|
||||
const luasInput = row.querySelector('input[id^="ls_npw_"]');
|
||||
const nilaiInput = row.querySelector('input[id^="nilai_npw_"][id$="_1"]');
|
||||
const outputElement = row.querySelector('input[id^="nilai_npw_"][id$="_2"]');
|
||||
|
||||
@@ -475,6 +495,7 @@
|
||||
// Update total nilai pasar wajar
|
||||
const totalElement = document.getElementById('total_nilai_pasar_wajar');
|
||||
if (totalElement) {
|
||||
|
||||
totalElement.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
}
|
||||
|
||||
@@ -491,7 +512,10 @@
|
||||
totalNilaiPasarLikuidasi.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
|
||||
// Perhitungan Likuidasi
|
||||
const hasilLikuidasi = (persentaseLikuidasi / 100) * totalNilaiPasarWajar;
|
||||
const hasilLikuidasi = Math.ceil((persentaseLikuidasi / 100) * totalNilaiPasarWajar / 10) * 10;
|
||||
|
||||
console.log('hasilLikuidasi', hasilLikuidasi);
|
||||
|
||||
totalLikuidasi.value = formatCurrency(hasilLikuidasi.toString());
|
||||
}
|
||||
}
|
||||
|
||||
75
resources/views/component/lampiran-dokumen.blade.php
Normal file
75
resources/views/component/lampiran-dokumen.blade.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!-- New section for Lampiran Dokumen -->
|
||||
<div class="card border border-agi-100 min-w-full mt-5">
|
||||
<div class="card-header light:bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Lampiran Dokumen
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
@forelse($permohonan->lampiranDokumen as $lampiran)
|
||||
<div class="border p-4 rounded-lg">
|
||||
<h4 class="font-semibold mb-2">{{ $lampiran->nama_file }}</h4>
|
||||
<p class="text-sm text-gray-600 mb-2">Keterangan : {{ $lampiran->keterangan }}</p>
|
||||
<p class="text-sm text-gray-600 mb-2 capitalize">Jenis Lampiran : {{ str_replace('-',' ',$lampiran->jenisLampiran->nama) }}</p>
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<a href="{{ Storage::url($lampiran->path_file) }}" target="_blank" class="text-blue-600 hover:underline">
|
||||
<i class="ki-filled ki-eye mr-2"></i>View
|
||||
</a>
|
||||
<a href="{{ Storage::url($lampiran->path_file) }}" download="{{ Storage::url($lampiran->path_file) }}" class="text-green-600 hover:underline ml-4">
|
||||
<i class="ki-filled ki-cloud-download mr-2"></i>Download
|
||||
</a>
|
||||
</div>
|
||||
@if(Auth::user()->hasRole('administrator'))
|
||||
<form action="{{ route('lampiran.delete', $lampiran->id) }}" method="POST" onsubmit="return confirm('Are you sure you want to delete this lampiran?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="text-red-600 hover:underline">
|
||||
<i class="ki-filled ki-trash mr-2"></i>Delete
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<p class="col-span-3 text-center text-gray-500">Tidak ada lampiran dokumen.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
@if(Auth::user()->hasRole(['Penilai', 'administrator','penilai','admin','surveyor']))
|
||||
<form action="{{ route('lampiran.upload') }}" method="POST" enctype="multipart/form-data" class="mt-6">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="nama_file" class="block text-sm font-medium text-gray-700">Nama File</label>
|
||||
<input type="text" name="nama_file" id="nama_file" required class="input mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
|
||||
</div>
|
||||
<div>
|
||||
<label for="file" class="block text-sm font-medium text-gray-700">File</label>
|
||||
<input type="file" name="file" id="file" required class="file-input mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md">
|
||||
</div>
|
||||
<div>
|
||||
<label for="jenis_lampiran_id" class="block text-sm font-medium text-gray-700">Jenis Lampiran</label>
|
||||
<select name="jenis_lampiran_id" id="jenis_lampiran_id" required class="tomselect mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||
<option value="">Pilih Jenis Lampiran</option>
|
||||
@foreach(\Modules\Lpj\Models\JenisLampiran::all() as $jenisLampiran)
|
||||
<option value="{{ $jenisLampiran->id }}">{{ $jenisLampiran->nama }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="md:col-span-2">
|
||||
<label for="keterangan" class="block text-sm font-medium text-gray-700">Keterangan</label>
|
||||
<textarea name="keterangan" id="keterangan" rows="3" class="textarea mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Upload Lampiran
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
42
resources/views/component/print-out-dokument.blade.php
Normal file
42
resources/views/component/print-out-dokument.blade.php
Normal file
@@ -0,0 +1,42 @@
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
@if (!empty($detail->name) && isset($detail->details) && !empty($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td width="25%"><strong>{{ $detail->name ?? '' }}</strong></td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (isset($detail->details))
|
||||
@php
|
||||
$details = json_decode($detail->details, true);
|
||||
@endphp
|
||||
|
||||
@if (is_array($details) && count($details) > 0)
|
||||
@foreach ($details as $value)
|
||||
@if (is_array($value))
|
||||
@foreach ($value as $key => $item)
|
||||
@if (!empty($item))
|
||||
<tr>
|
||||
<td style="padding: 2px;">
|
||||
{{ formatLabel($key) }}
|
||||
</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px;">
|
||||
@if (strpos(strtolower($key), 'tanggal') !== false)
|
||||
{{ formatTanggalIndonesia($item) }}
|
||||
@else
|
||||
{{ $item }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -1,9 +1,34 @@
|
||||
<style>
|
||||
.signature-pad-container canvas {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.signature-pad-container {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.signature-pad {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
aspect-ratio: 2/1;
|
||||
object-fit: contain;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="signature-pad-container mx-auto border p-4 max-w-md sm:max-w-lg lg:max-w-xl">
|
||||
<h3 class="signature-title text-lg sm:text-xl font-semibold mb-2">{{ ucfirst($type) }}</h3>
|
||||
<canvas
|
||||
id="signature-pad-{{ $type }}"
|
||||
class="signature-pad w-full h-48 sm:h-56 bg-white border rounded"
|
||||
></canvas>
|
||||
<h3 class="signature-title text-md sm:text-lg mb-2 uppercase">{{ ucfirst($type) }}</h3>
|
||||
<div class="w-full aspect-w-2 aspect-h-1">
|
||||
<canvas
|
||||
id="signature-pad-{{ $type }}"
|
||||
class="signature-pad w-full h-full bg-white border rounded"
|
||||
></canvas>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
class="input w-full border p-2 mt-2 rounded"
|
||||
|
||||
@@ -58,8 +58,10 @@
|
||||
<select class="input @error('type') border-danger bg-danger-light @enderror" name="type">
|
||||
<option value="text" {{ (isset($customField->type) && $customField->type == 'text') ? 'selected' : '' }}>Text</option>
|
||||
<option value="radio" {{ (isset($customField->type) && $customField->type == 'radio') ? 'selected' : '' }}>Radio</option>
|
||||
<option value="number" {{ (isset($customField->type) && $customField->type == 'select') ? 'selected' : '' }}>Select</option>
|
||||
<option value="option" {{ (isset($customField->type) && $customField->type == 'checkbox') ? 'selected' : '' }}>Checkbox</option>
|
||||
<option value="select" {{ (isset($customField->type) && $customField->type == 'select') ? 'selected' : '' }}>Select</option>
|
||||
<option value="checkbox" {{ (isset($customField->type) && $customField->type == 'checkbox') ? 'selected' : '' }}>Checkbox</option>
|
||||
<option value="date" {{ (isset($customField->type) && $customField->type == 'date') ? 'selected' : '' }}>Date</option>
|
||||
<option value="number" {{ (isset($customField->type) && $customField->type == 'number') ? 'selected' : '' }}>Number</option>
|
||||
</select>
|
||||
@error('type')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 gap-1">
|
||||
Address
|
||||
Alamat
|
||||
<span class="text-danger">
|
||||
*
|
||||
</span>
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Address
|
||||
Alamat
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
@@ -255,14 +255,23 @@
|
||||
|
||||
<div id="doctainer" class="grid gap-5">
|
||||
@if(isset($document->id))
|
||||
@php $n = 0; @endphp
|
||||
@php $n = 0; $p_index = 0; @endphp
|
||||
@foreach($document->detail as $detail)
|
||||
<input type="hidden" name="detail_dokumen_jaminan_id[]" value="{{ $detail->id }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $detail->jenis_legalitas_jaminan_id }}">
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="{{ $detail->jenis_legalitas_jaminan_id }}">
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="clearDetail({{ $detail->id }})">
|
||||
<i class="ki-duotone ki-trash-square fs-2">
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
<span class="path3"></span>
|
||||
<span class="path4"></span>
|
||||
</i>
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -273,74 +282,178 @@
|
||||
<input class="input " type="text" id="name" name="name[]" value="{{ $detail->name ?? "" }}" placeholder="Nomor">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
<button type="button" class="flex-none btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
|
||||
</div>
|
||||
<div id="additional-files-{{ $n }}"></div>
|
||||
</div>
|
||||
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
<div id="document-container-{{ $n }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
|
||||
@endphp
|
||||
<div class="flex flex-col w-full gap-2">
|
||||
<div class="flex flex-col w-full gap-2" id="document_container">
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<div class="flex w-full lg:w-[30%]">
|
||||
@if(!empty($dokumen_nomor))
|
||||
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : {{ $dokumen_nomor[$index] }}</span>
|
||||
<div class="flex flex-col w-full gap-2 custom-field-set" id="document_container_{{ $p_index }}">
|
||||
<div class="flex items-start gap-2 mt-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen" value="{{ $dokumen_nomor[$index] ?? '' }}">
|
||||
<span class="flex-1">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
<input type="hidden" name="dokumen_jaminan[{{ $n }}][]" value="{{ $dokumen }}">
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
</span>
|
||||
<button type="button" class="flex-none btn btn-danger w-[100px] text-center" onclick="removeFileInput(this)">Remove</button>
|
||||
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 custom-field">
|
||||
@php
|
||||
$customField = getCustomField($key);
|
||||
$fieldValue = json_decode($detail->details)[$index]->{$customField->name} ?? '';
|
||||
@endphp
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $customField->label ?? "" }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($customField->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">{{ $fieldValue }}</textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($customField->options as $option)
|
||||
<option value="{{ $option }}" {{ $fieldValue == $option ? 'selected' : '' }}>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" value="{{ $fieldValue }}" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@else
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$customField = getCustomField($key);
|
||||
@endphp
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $customField->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($customField->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="..."></textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($customField->options as $option)
|
||||
<option value="{{ $option }}">{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
@php $p_index++; @endphp
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput({{$n}},{{ $detail->jenisLegalitasJaminan->id }})">Add File</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="flex flex-col w-full gap-2" id="document_container">
|
||||
<div class="flex items-start gap-2 mt-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumenss">
|
||||
<span class="flex-1">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
</span>
|
||||
</div>
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$customField = getCustomField($key);
|
||||
@endphp
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $customField->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($customField->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="..."></textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($customField->options as $option)
|
||||
<option value="{{ $option }}">{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$customField->name}}]" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput({{ $n }},{{ $detail->jenisLegalitasJaminan->id }})">Add File</button>
|
||||
</div>
|
||||
@php $p_index++; @endphp
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ getCustomField($key)->label ?? "" }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{getCustomField($key)->name}}]" value="{{ json_decode($detail->details)->{getCustomField($key)->name} ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@else
|
||||
@if($detail->jenisLegalitasJaminan->custom_fields)
|
||||
@foreach($detail->jenisLegalitasJaminan->custom_fields as $key)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ getCustomField($key)->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="custom_field[{{$detail->jenisLegalitasJaminan->id}}][{{getCustomField($key)->name}}]" placeholder="...">
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
@@ -351,64 +464,95 @@
|
||||
</div>
|
||||
@php $n++; @endphp
|
||||
@endforeach
|
||||
|
||||
@if($legalitas)
|
||||
@foreach($legalitas as $item)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $item->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $item->id }}">
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="" placeholder="Nomor">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
<button type="button" class="flex-none btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
|
||||
</div>
|
||||
<div id="additional-files-{{ $n }}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($item->custom_fields)
|
||||
@foreach($item->custom_fields as $field)
|
||||
<div id="document-container-{{ $n }}">
|
||||
<div class="flex flex-col w-full gap-2">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ getCustomField($field)->label }}
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $item->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $item->id }}">
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="custom_field[{{$item->id}}][{{getCustomField($field)->name}}]" placeholder="...">
|
||||
<input class="input " type="text" id="name" name="name[]" value="" placeholder="Nomor">
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]"></textarea>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="document_container">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[{{ $n }}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" accept=".pdf,image/*">
|
||||
</div>
|
||||
|
||||
@if($item->custom_fields)
|
||||
@foreach($item->custom_fields as $field)
|
||||
@php $custom_field = getCustomField($field) @endphp
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ $custom_field->label }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@switch($custom_field->type)
|
||||
@case('text')
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('number')
|
||||
<input class="input" type="number" step="0.01" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="...">
|
||||
@break
|
||||
@case('date')
|
||||
<input class="input" type="date" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]">
|
||||
@break
|
||||
@case('textarea')
|
||||
<textarea class="textarea" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="..."></textarea>
|
||||
@break
|
||||
@case('select')
|
||||
<select class="select" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]">
|
||||
<option value="">Select an option</option>
|
||||
@foreach($custom_field->options as $option)
|
||||
<option value="{{ $option }}">{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@default
|
||||
<input class="input" type="text" name="custom_field[{{$n}}][{{$p_index}}][{{$custom_field->name}}]" placeholder="...">
|
||||
@endswitch
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput({{ $n }}, {{ $item->id }})">Add File</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@php $n++; @endphp
|
||||
@php $n++;$p_index++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
@@ -418,6 +562,7 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@push('scripts')
|
||||
{{--Pemilik Jaminan--}}
|
||||
<script>
|
||||
@@ -475,6 +620,42 @@
|
||||
|
||||
{{--Legalitas Jaminan--}}
|
||||
<script>
|
||||
function getCustomFields(jenisLegalitasJaminanId, index, newFieldIndex) {
|
||||
return fetch(`/basic-data/jenis-jaminan/custom-fields/${jenisLegalitasJaminanId}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(customFields => {
|
||||
let customFieldsHtml = '';
|
||||
customFields.forEach(field => {
|
||||
customFieldsHtml += `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-2 custom-field">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${field.label}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(index, field.type, field.name, null, jenisLegalitasJaminanId, newFieldIndex)}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
return customFieldsHtml;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error fetching custom fields:", error);
|
||||
return '';
|
||||
});
|
||||
}
|
||||
|
||||
function getLegalitasJaminan() {
|
||||
var legalitasJaminan = document.getElementById("jenis_jaminan_id").value;
|
||||
var documentId = "{{ $document->id ?? "0" }}";
|
||||
@@ -497,6 +678,7 @@
|
||||
var doctainer = document.getElementById("doctainer");
|
||||
doctainer.innerHTML = "";
|
||||
data.forEach((item, index) => {
|
||||
console.log(item);
|
||||
doctainer.innerHTML += `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
@@ -514,33 +696,37 @@
|
||||
<input class="input" type="text" name="name[]" value="${item.name || ""}" placeholder="Nomor">
|
||||
</div>
|
||||
</div>
|
||||
<div id="document-container-${index}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full" id="document_container">
|
||||
<div class="flex flex-col w-full gap-2">
|
||||
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ""}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full" id="file-container-${index}">
|
||||
<div class="flex flex-col w-full gap-2">
|
||||
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ""}
|
||||
</div>
|
||||
<div class="flex items-center gap-2 my-2 w-full">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
|
||||
<button type="button" class="flex-none btn btn-primary w-[100px] text-center" onclick="addFileInput(${index})">Add File</button>
|
||||
<div class="flex items-center gap-2 my-2 w-full">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
|
||||
</div>
|
||||
${item.custom_fields && item.custom_fields.length > 0 ? item.custom_fields.map(field => `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-2 custom-field">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${field.label}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(index, field.type, field.name, item.details, item.jenis_legalitas_jaminan_id, 0)}
|
||||
</div>
|
||||
</div>
|
||||
`).join('') : ""}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${item.custom_fields && item.custom_fields.length > 0 ? item.custom_fields.map(field => `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${field.label}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(field.type, field.name, item.details, item.jenis_legalitas_jaminan_id)}
|
||||
</div>
|
||||
<div class="flex items-center justify-end gap-2 my-2 w-full">
|
||||
<button type="button" class="flex-none btn btn-primary text-center" onclick="addFileInput(${index},${item.jenis_legalitas_jaminan_id})">Add File</button>
|
||||
</div>
|
||||
</div>
|
||||
`).join('') : ""}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
@@ -556,20 +742,39 @@
|
||||
.catch(error => console.error("Error:", error));
|
||||
}
|
||||
|
||||
function addFileInput(index) {
|
||||
const container = document.getElementById(`file-container-${index}`);
|
||||
function addFileInput(index, jenisLegalitasJaminanId = null) {
|
||||
const documentContainer = document.getElementById(`document-container-${index}`);
|
||||
const container = documentContainer.querySelector('#document_container');
|
||||
|
||||
const customFields = container.querySelectorAll('.custom-field');
|
||||
|
||||
|
||||
// Get the current number of custom field sets
|
||||
const currentFieldSets = container.querySelectorAll('.custom-field-set').length;
|
||||
const newFieldIndex = currentFieldSets + 1;
|
||||
|
||||
const newInput = document.createElement("div");
|
||||
newInput.className = "flex items-center gap-2 mb-2 w-full";
|
||||
newInput.innerHTML = `
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
|
||||
<button type="button" class="flex-none btn btn-danger w-[100px] text-center" onclick="removeFileInput(this)">Remove</button>
|
||||
`;
|
||||
container.appendChild(newInput);
|
||||
newInput.className = "flex flex-col w-full gap-2 mb-4 custom-field-set";
|
||||
|
||||
getCustomFields(jenisLegalitasJaminanId, index, newFieldIndex).then(customFieldsHtml => {
|
||||
newInput.innerHTML = `
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex items-center gap-2 w-full">
|
||||
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
|
||||
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
|
||||
<button type="button" class="flex-none btn btn-danger text-center" onclick="removeFileInput(this)">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
${customFieldsHtml}
|
||||
`;
|
||||
|
||||
container.appendChild(newInput);
|
||||
});
|
||||
}
|
||||
|
||||
function removeFileInput(button) {
|
||||
button.closest(".flex.items-center.gap-2.mb-2").remove();
|
||||
button.closest(".custom-field-set").remove();
|
||||
|
||||
}
|
||||
|
||||
function renderExistingFiles(dokumenJaminan, debiturId, itemId, dokumenNomor) {
|
||||
@@ -621,20 +826,90 @@
|
||||
return dokumenNomor;
|
||||
}
|
||||
|
||||
function getCustomFieldInput(type, fieldName, value, itemId) {
|
||||
function getCustomFieldInput(index, type, fieldName, value, itemId, fieldIndex = 0) {
|
||||
value = value ? JSON.parse(value)[fieldName] || "" : "";
|
||||
switch (type) {
|
||||
case "text":
|
||||
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="text" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
case "number":
|
||||
return `<input class="input" type="number" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="number" step="0.01" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
case "date":
|
||||
return `<input class="input" type="date" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="date" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
case "textarea":
|
||||
return `<textarea class="textarea" rows="3" name="custom_field[${itemId}][${fieldName}]">${value}</textarea>`;
|
||||
return `<textarea class="textarea" rows="3" name="custom_field[${index}][${fieldIndex}][${fieldName}]">${value}</textarea>`;
|
||||
default:
|
||||
return `<input class="input" type="text" name="custom_field[${itemId}][${fieldName}]" value="${value}">`;
|
||||
return `<input class="input" type="text" name="custom_field[${index}][${fieldIndex}][${fieldName}]" value="${value}">`;
|
||||
}
|
||||
}
|
||||
|
||||
function clearDetail(detailId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: "Anda akan menghapus detail ini!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, yakin!',
|
||||
cancelButtonText: 'Batal'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: "Data yang telah di hapus tidak dapat di kembalikan",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, hapus!',
|
||||
cancelButtonText: 'Batal'
|
||||
}).then((result2) => {
|
||||
if (result2.isConfirmed) {
|
||||
// Hapus input fields
|
||||
$(`input[name="detail_dokumen_jaminan_id[]"][value="${detailId}"]`).closest('.grid.gap-5').remove();
|
||||
|
||||
// Kirim request AJAX untuk menghapus data dari database
|
||||
$.ajax({
|
||||
url: '{{ route("debitur.jaminan.clearDetail", $debitur->id ) }}',
|
||||
type: 'POST',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}',
|
||||
detail_id: detailId
|
||||
},
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: 'Detail berhasil dihapus',
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Gagal!',
|
||||
text: 'Detail gagal dihapus',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
Swal.fire({
|
||||
title: 'Gagal!',
|
||||
text: 'Terjadi kesalahan saat menghapus detail',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -76,17 +76,28 @@
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
@foreach($document->detail as $detail)
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase">
|
||||
{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
<strong>{{ $loop->index+1 }}. {{ $detail->jenisLegalitasJaminan->name }}</strong>
|
||||
</span>
|
||||
<div>
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) ? json_decode($detail->dokumen_nomor) : ($detail->dokumen_nomor ? [$detail->dokumen_nomor] : []);
|
||||
$count_jaminan = 0;
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] }}
|
||||
</span>
|
||||
<div>
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="flex-none badge badge-sm badge-outline mt-2 mr-2">
|
||||
@@ -95,40 +106,39 @@
|
||||
</a>
|
||||
@endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
<br>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
@if(isset($detail->details))
|
||||
@if(json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
{{ str_replace("_"," ",$key) ?? "" }}
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $value ?? "" }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
keterangan
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $detail->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed mb-3.5">
|
||||
</div>
|
||||
@if(isset($detail->details))
|
||||
@if(isset(json_decode($detail->details)[$index]))
|
||||
@foreach (json_decode($detail->details)[$index] as $key => $value)
|
||||
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
{{ str_replace("_"," ",$key) ?? "" }}
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $value }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed">
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
|
||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||
keterangan
|
||||
</span>
|
||||
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
|
||||
{{ $detail->keterangan }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed mb-3.5">
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@@ -178,6 +188,7 @@
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
@include('lpj::component.pdfviewer')
|
||||
|
||||
@push('scripts')
|
||||
|
||||
62
resources/views/jenis_lampiran/create.blade.php
Normal file
62
resources/views/jenis_lampiran/create.blade.php
Normal file
@@ -0,0 +1,62 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
@if(isset($jenisLampiran->id))
|
||||
{{ Breadcrumbs::render(request()->route()->getName(),$jenisLampiran->id) }}
|
||||
@else
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if(isset($jenisLampiran->id))
|
||||
<form action="{{ route('basicdata.jenis-lampiran.update', $jenisLampiran->id) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $jenisLampiran->id }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.jenis-lampiran.store') }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisLampiran->id) ? 'Edit' : 'Tambah' }} Jenis Lampiran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.jenis-lampiran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nama') border-danger bg-danger-light @enderror" type="text" name="nama" value="{{ $jenisLampiran->nama ?? old('nama') }}">
|
||||
@error('nama')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Deskripsi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('deskripsi') border-danger bg-danger-light @enderror" name="deskripsi" rows="3">{{ $jenisLampiran->deskripsi ?? old('deskripsi') }}</textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
145
resources/views/jenis_lampiran/index.blade.php
Normal file
145
resources/views/jenis_lampiran/index.blade.php
Normal file
@@ -0,0 +1,145 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.jenis-lampiran') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="jenis-lampiran-table" data-api-url="{{ route('basicdata.jenis-lampiran.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Jenis Lampiran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Jenis Lampiran" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('basicdata.jenis-lampiran.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.jenis-lampiran.create') }}"> Tambah Jenis Lampiran </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="nama">
|
||||
<span class="sort"> <span class="sort-label"> Nama </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="deskripsi">
|
||||
<span class="sort"> <span class="sort-label"> Deskripsi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/jenis-lampiran/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'Jenis Lampiran has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the jenis lampiran.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#jenis-lampiran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nama: {
|
||||
title: 'Nama',
|
||||
},
|
||||
deskripsi: {
|
||||
title: 'Deskripsi',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/jenis-lampiran/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -93,6 +93,24 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function formatDate(date) {
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
// Months are 0-indexed
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day} ${getIndonesianMonth(month)} ${year}`;
|
||||
}
|
||||
|
||||
function getIndonesianMonth(month) {
|
||||
const months = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni',
|
||||
'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'
|
||||
];
|
||||
return months[month -
|
||||
1];
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
@@ -168,14 +186,40 @@
|
||||
tanggal_survei: {
|
||||
title: 'Tanggal Survei',
|
||||
render: (item, data) => {
|
||||
return '-';
|
||||
}
|
||||
if(data.penilaian.waktu_penilaian){
|
||||
return `${formatDate(new Date(data.penilaian.waktu_penilaian))}`;
|
||||
}
|
||||
return `${formatDate(new Date(data.penilaian.created_at))}`;
|
||||
},
|
||||
},
|
||||
due_date_sla: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
return '-';
|
||||
}
|
||||
const tujuan_penilaian = data.tujuan_penilaian.name;
|
||||
const tipe_laporan = data.penilai?.type;
|
||||
const nilai_plafond = data.penilaian.nilaiPlafond?.name;
|
||||
let waktu_penilaian = new Date(data.penilaian.created_at);
|
||||
if(data.penilaian.waktu_penilaian){
|
||||
waktu_penilaian = new Date(data.penilaian.waktu_penilaian);
|
||||
}
|
||||
|
||||
if(tujuan_penilaian.name==="RAP"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
if(tipe_laporan==="sederhana"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 2);
|
||||
} else if(tipe_laporan==="standar"){
|
||||
if(nilai_plafond==="2 M - 5 M"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else if(nilai_plafond==="< 2M"){
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
return formatDate(waktu_penilaian);
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
@@ -194,6 +238,8 @@
|
||||
let laporanButton = '';
|
||||
let resumeButton = '';
|
||||
|
||||
|
||||
|
||||
if(data.penilai.resume) {
|
||||
resumeButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0" class="btn btn-sm btn-success">
|
||||
@@ -203,7 +249,7 @@
|
||||
|
||||
if(data.nilai_liquidasi==null) {
|
||||
laporanButton = `
|
||||
<a href="laporan/${data.id}" class="btn btn-sm btn-dark">
|
||||
<a href="laporan/${data.id}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
</a>`;
|
||||
}
|
||||
@@ -211,19 +257,20 @@
|
||||
if(data.status_bayar=="sudah_bayar" && data.nilai_liquidasi >0) {
|
||||
if(data.penilai.type_penilai=='resume' && !data.penilai.resume){
|
||||
laporanButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${type}" class="btn btn-sm btn-dark">
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${type}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
</a>`;
|
||||
} else {
|
||||
laporanButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${typePenilaian}" class="btn btn-sm btn-dark">
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${typePenilaian}" class="btn btn-sm btn-primary">
|
||||
Laporan
|
||||
</a>`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return `${resumeButton} ${laporanButton}`;
|
||||
|
||||
return `<div class="flex flex-wrap justify-end gap-1.5"> ${resumeButton} ${laporanButton} </div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
167
resources/views/laporan_external/create.blade.php
Normal file
167
resources/views/laporan_external/create.blade.php
Normal file
@@ -0,0 +1,167 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form method="POST" action="{{ isset($laporanExternal) ? route('laporan-external.update', $laporanExternal->id) : route('laporan-external.store') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@if(isset($laporanExternal))
|
||||
@method('PUT')
|
||||
@endif
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($laporanExternal) ? 'Edit' : 'Tambah' }} Laporan External
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('laporan-external.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Permohonan ID</label>
|
||||
<input type="hidden" name="permohonan_id" value="{{ $laporanExternal->permohonan_id ?? "" }}">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<strong>{{ $permohonan->nomor_registrasi }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Laporan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nomor_laporan') border-danger bg-danger-light @enderror" type="text" name="nomor_laporan" value="{{ old('nomor_laporan', $laporanExternal->nomor_laporan ?? '') }}">
|
||||
@error('nomor_laporan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Final Laporan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('tgl_final_laporan') border-danger bg-danger-light @enderror" type="date" name="tgl_final_laporan" value="{{ old('tgl_final_laporan', $laporanExternal->tgl_final_laporan ?? '') }}">
|
||||
@error('tgl_final_laporan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nilai Pasar</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_pasar') border-danger bg-danger-light @enderror" type="number" name="nilai_pasar" value="{{ old('nilai_pasar', $laporanExternal->nilai_pasar ?? '') }}">
|
||||
@error('nilai_pasar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Likuidasi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_likuidasi') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_likuidasi" value="{{ old('indikasi_nilai_likuidasi', $laporanExternal->indikasi_nilai_likuidasi ?? '') }}">
|
||||
@error('indikasi_nilai_likuidasi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_tanah') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_tanah" value="{{ old('indikasi_nilai_pasar_tanah', $laporanExternal->indikasi_nilai_pasar_tanah ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Estimasi Harga Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('estimasi_harga_tanah') border-danger bg-danger-light @enderror" type="number" name="estimasi_harga_tanah" value="{{ old('estimasi_harga_tanah', $laporanExternal->estimasi_harga_tanah ?? '') }}">
|
||||
@error('estimasi_harga_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Estimasi Harga Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('estimasi_harga_bangunan') border-danger bg-danger-light @enderror" type="number" name="estimasi_harga_bangunan" value="{{ old('estimasi_harga_bangunan', $laporanExternal->estimasi_harga_bangunan ?? '') }}">
|
||||
@error('estimasi_harga_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_bangunan') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_bangunan" value="{{ old('indikasi_nilai_pasar_bangunan', $laporanExternal->indikasi_nilai_pasar_bangunan ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Sarana Pelengkap</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_sarana_pelengkap') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_sarana_pelengkap" value="{{ old('indikasi_nilai_pasar_sarana_pelengkap', $laporanExternal->indikasi_nilai_pasar_sarana_pelengkap ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_sarana_pelengkap')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Mesin</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_mesin') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_mesin" value="{{ old('indikasi_nilai_pasar_mesin', $laporanExternal->indikasi_nilai_pasar_mesin ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_mesin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Nilai Pasar Kendaraan/Alat Berat</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('indikasi_nilai_pasar_kendaraan_alat_berat') border-danger bg-danger-light @enderror" type="number" name="indikasi_nilai_pasar_kendaraan_alat_berat" value="{{ old('indikasi_nilai_pasar_kendaraan_alat_berat', $laporanExternal->indikasi_nilai_pasar_kendaraan_alat_berat ?? '') }}">
|
||||
@error('indikasi_nilai_pasar_kendaraan_alat_berat')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">File Resume</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('file_resume') border-danger bg-danger-light @enderror" type="file" name="file_resume">
|
||||
@if(isset($laporanExternal) && $laporanExternal->file_resume)
|
||||
<p class="mt-2">File saat ini: <p class="mt-2">File saat ini: <a href="storage/{{ $laporanExternal->file_resume }}" download="{{ $laporanExternal->file_resume }}" target="_blank" class="badge badge-sm badge-outline">
|
||||
{{ basename($laporanExternal->file_resume) }} <i class="ki-filled ki-cloud-download"></i>
|
||||
</a></p></p>
|
||||
@endif
|
||||
@error('file_resume')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">File Laporan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('file_laporan') border-danger bg-danger-light @enderror" type="file" name="file_laporan">
|
||||
@if(isset($laporanExternal) && $laporanExternal->file_laporan)
|
||||
<p class="mt-2">File saat ini: <a href="storage/{{ $laporanExternal->file_laporan }}" download="{{ $laporanExternal->file_laporan }}" target="_blank" class="badge badge-sm badge-outline">
|
||||
{{ basename($laporanExternal->file_laporan) }} <i class="ki-filled ki-cloud-download"></i>
|
||||
</a></p>
|
||||
@endif
|
||||
@error('file_laporan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-footer flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">{{ isset($laporanExternal) ? 'Update' : 'Simpan' }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
205
resources/views/laporan_external/index.blade.php
Normal file
205
resources/views/laporan_external/index.blade.php
Normal file
@@ -0,0 +1,205 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-external') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-external-table" data-api-url="{{ route('laporan-external.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Laporan External
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Laporan External" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5 hidden">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('laporan-external.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('laporan-external.create') }}"> Tambah Laporan External </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_laporan">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_jaminan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Jaminan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="indikasi_nilai_likuidasi">
|
||||
<span class="sort"> <span class="sort-label"> Indikasi Nilai Likuidasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
|
||||
<th class="min-w-[150px]" data-datatable-column="file_resume">
|
||||
<span class="sort"> <span class="sort-label"> File Resume </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="file_laporan">
|
||||
<span class="sort"> <span class="sort-label"> File Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`laporan-external/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'Laporan External has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the laporan.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-external-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_laporan: {
|
||||
title: 'Nomor Laporan',
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.penawaran?.tujuan_penilaian_kjpp?.name}` ?? '';
|
||||
}
|
||||
},
|
||||
jenis_jaminan: {
|
||||
title: 'Jenis Jaminan',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.dokumenjaminan[0]?.jenisjaminan?.name}` ?? '';
|
||||
}
|
||||
},
|
||||
nilai_pasar: {
|
||||
title: 'Nilai Pasar',
|
||||
},
|
||||
indikasi_nilai_likuidasi: {
|
||||
title: 'Indikasi Nilai Likuidasi',
|
||||
},
|
||||
file_resume: {
|
||||
title: 'File Resume',
|
||||
render: (item, data) => {
|
||||
return data.file_resume ? `<a href="storage/${data.file_resume}" download="${data.file_resume}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>` : 'N/A';
|
||||
},
|
||||
},
|
||||
file_laporan: {
|
||||
title: 'File Laporan',
|
||||
render: (item, data) => {
|
||||
return data.file_laporan ? `<a href="storage/${data.file_laporan}" download="${data.file_laporan}" target="_blank" class="badge badge-sm badge-outline">
|
||||
Download <i class="ki-filled ki-cloud-download"></i>
|
||||
</a>` : 'N/A';
|
||||
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="laporan-external/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -8,35 +8,19 @@
|
||||
@endphp
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Detail Data Otorisasi Penawaran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('otorisasitender.penawaran.edit', $id) }}" class="btn btn-xs btn-primary" title="Register"><i class="ki-filled ki-arrow-circle-right"></i> Otorisasi Penawaran</a>
|
||||
<a href="{{ route('otorisasitender.penawaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $prosespenawaran->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $prosespenawaran->code }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@php
|
||||
$buttonProses='';
|
||||
$buttonProses='<a href="'. route('otorisasitender.penawaran.edit', $id) .'" class="btn btn-xs btn-primary" title="Otorisasi Penawaran"><i class="ki-outline ki-arrow-circle-right"></i> Otorisasi Penawaran</a>';
|
||||
@endphp
|
||||
|
||||
@include('lpj::component.detail-jaminan', [
|
||||
'customlink' => $buttonProses,
|
||||
'backLink' => 'otorisasitender.penawaran.index',
|
||||
'title' => 'Detail Data Otorisasi Penawaran',
|
||||
'penawaran' => $prosespenawaran,
|
||||
])
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Address
|
||||
Alamat
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||
|
||||
@@ -53,8 +53,9 @@
|
||||
Biaya KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text"
|
||||
name="biaya_kjpp_sebelumnya" readonly
|
||||
<input type="hidden" name="biaya_kjpp_sebelumnya"
|
||||
value="{{ $penawaran->biaya_kjpp_sebelumnya !== null ? $penawaran->biaya_kjpp_sebelumnya : '' }}">
|
||||
<input class="flex w-full text-gray-600 font-medium text-sm input-custom" type="text" readonly
|
||||
value="{{ $penawaran->biaya_kjpp_sebelumnya !== null ? formatRupiah($penawaran->biaya_kjpp_sebelumnya) : '' }}">
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
@@ -124,35 +124,41 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@if (isset($details->luas_tanah) && isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
/
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_tanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah :
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@@ -106,8 +106,7 @@
|
||||
<div class="content-max">
|
||||
Aset Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->jenisJaminan->name }}
|
||||
@endforeach
|
||||
<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->documents as $document)
|
||||
@endforeach<span class="flex-wrap">Lokasi Jaminan: @foreach ($permohonan->documents as $document)
|
||||
{{ $document->address }}, Kel. @foreach ($villages as $village)
|
||||
{{ $village->name }}
|
||||
@endforeach, Kec. @foreach ($districts as $district)
|
||||
@@ -126,35 +125,41 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@if (isset($details->luas_tanah) && isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
/
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_tanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah :
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@@ -109,35 +109,41 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@if (isset($details->luas_tanah) && isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
/
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_tanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah :
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@@ -124,35 +124,41 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@if (isset($details->luas_tanah) && isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
/
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_tanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah :
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@@ -107,35 +107,41 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@if (isset($details->luas_tanah) && isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
/
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_tanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah :
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@@ -126,35 +126,41 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@php
|
||||
$details = json_decode($detail->details);
|
||||
@endphp
|
||||
@foreach ($document->detail as $index => $detail)
|
||||
@if($detail->details)
|
||||
@php $luastanah = $luasbangunan = 0; @endphp
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@foreach($value as $k => $v)
|
||||
@if($k=='luas_tanah')
|
||||
@php
|
||||
$luastanah += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@if($k=='luas_bangunan')
|
||||
@php
|
||||
$luasbangunan += (int) preg_replace('/[^0-9.]/', '', str_replace('m2', '', $v));
|
||||
@endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@if (isset($luastanah) && isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan: {{ $luastanah }} m<sup>2</sup> / {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luastanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah : {{ $luastanah }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($luasbangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan: {{ $luasbangunan }} m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
|
||||
@if (isset($details->luas_tanah) && isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah / Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
/
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_tanah))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Tanah :
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_tanah)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@elseif (isset($details->luas_bangunan))
|
||||
{{ $n }}. {{ $detail->name }}<br>
|
||||
Luas Bangunan:
|
||||
{{ preg_replace('/[^0-9.]/', '', str_replace('m2', '', $details->luas_bangunan)) }}
|
||||
m<sup>2</sup>
|
||||
<br>
|
||||
@php $n++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<a href="/tender/penawaran/${nomor_registrasi}/edit" class="btn btn-sm btn-icon btn-clear btn-info" title="Penawaran">
|
||||
<i class="ki-outline ki-arrow-circle-right"></i>
|
||||
</a>
|
||||
<a href="/tender/penawaran/${nomor_registrasi}/showKirimEmail" class="btn btn-sm btn-icon btn-clear btn-success" title="Kirim Email">
|
||||
<a href="/tender/penawaran/${nomor_registrasi}/showKirimEmail" class="btn btn-sm btn-icon btn-clear btn-success hidden" title="Kirim Email">
|
||||
<i class="ki-filled ki-paper-plane"></i>
|
||||
</a>
|
||||
`;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
@@ -80,3 +81,4 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
@@ -143,3 +144,4 @@
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="no-break">
|
||||
<table class="judul" style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
@@ -102,3 +103,4 @@
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="no-break">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;">Informasi Dinas Tata Ruang
|
||||
@@ -58,3 +59,4 @@
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
@@ -127,3 +128,4 @@
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,151 +1,155 @@
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
ANALISA TANAH
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
ANALISA TANAH
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
@php
|
||||
$cekLuas = isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai']) ? 'tidak sesuai' : 'sesuai';
|
||||
|
||||
$luas = $forminspeksi['tanah']['luas_tanah'][$cekLuas] ?? null;
|
||||
@endphp
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Luas Tanah</td>
|
||||
<td style=" width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
$cekMataAngin = isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])
|
||||
? 'tidak sesuai'
|
||||
: 'sesuai';
|
||||
|
||||
$Arah = $forminspeksi['tanah']['hadap_mata_angin'][$cekMataAngin] ?? null;
|
||||
@endphp
|
||||
<td style="padding: 2px; vertical-align: top;">Hadap Mata Angin</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $Arah ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Bentuk Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
@php
|
||||
$bentukTanah = isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah'])
|
||||
? $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']
|
||||
: [];
|
||||
$lainnya = isset($forminspeksi['tanah']['bentuk_tanah']['lainnya'])
|
||||
? $forminspeksi['tanah']['bentuk_tanah']['lainnya']
|
||||
: null;
|
||||
$cekLuas = isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai']) ? 'tidak sesuai' : 'sesuai';
|
||||
|
||||
$luas = $forminspeksi['tanah']['luas_tanah'][$cekLuas] ?? null;
|
||||
@endphp
|
||||
|
||||
{{ !empty($bentukTanah) ? implode(', ', $bentukTanah) : '' }}
|
||||
|
||||
@if (!empty($bentukTanah) && in_array('Lainnya', $bentukTanah) && !is_null($lainnya))
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Kontur Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Luas Tanah</td>
|
||||
<td style=" width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
$konturTanah = $forminspeksi['tanah']['kontur_tanah'] ?? [];
|
||||
$cekMataAngin = isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])
|
||||
? 'tidak sesuai'
|
||||
: 'sesuai';
|
||||
|
||||
$Arah = $forminspeksi['tanah']['hadap_mata_angin'][$cekMataAngin] ?? null;
|
||||
@endphp
|
||||
<td style="padding: 2px; vertical-align: top;">Hadap Mata Angin</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $Arah ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Bentuk Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$bentukTanah = isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah'])
|
||||
? $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']
|
||||
: [];
|
||||
$lainnya = isset($forminspeksi['tanah']['bentuk_tanah']['lainnya'])
|
||||
? $forminspeksi['tanah']['bentuk_tanah']['lainnya']
|
||||
: null;
|
||||
@endphp
|
||||
|
||||
@if (!empty($konturTanah))
|
||||
{{ implode(', ', $konturTanah) }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Beda Ketinggian dengan Jalan</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$ketinggianTanah = $forminspeksi['tanah']['ketinggian_tanah'];
|
||||
$ketinggian = $ketinggianTanah['ketinggian'][0] ?? '-';
|
||||
$lebihTinggi = $ketinggianTanah['lebih_tinggi'];
|
||||
$lebihRendah = $ketinggianTanah['lebih_rendah'];
|
||||
@endphp
|
||||
{{ !empty($bentukTanah) ? implode(', ', $bentukTanah) : '' }}
|
||||
|
||||
{{ $ketinggian }}
|
||||
@if ($ketinggian === 'Lebih Tinggi' && $lebihTinggi !== null)
|
||||
(Ketinggian: {{ $lebihTinggi }} cm)
|
||||
@elseif($ketinggian === 'Lebih Rendah' && $lebihRendah !== null)
|
||||
(Kerendahan: {{ $lebihRendah }} cm)
|
||||
@endif
|
||||
</td>
|
||||
@if (!empty($bentukTanah) && in_array('Lainnya', $bentukTanah) && !is_null($lainnya))
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kontur Jalan Depan Objek</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ $forminspeksi['tanah']['kontur_jalan'] == 'menurun' ? 'Menurun' : 'Rata' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Posisi Kavling</td>
|
||||
<td>:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$posisiKavling = $forminspeksi['tanah']['posisi_kavling']['posisi_kavling'] ?? [];
|
||||
$lainnya = $forminspeksi['tanah']['posisi_kavling']['lainnya'] ?? null;
|
||||
@endphp
|
||||
</td>
|
||||
|
||||
{{ !empty($posisiKavling) ? implode(', ', $posisiKavling) : '' }}
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Kontur Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$konturTanah = $forminspeksi['tanah']['kontur_tanah'] ?? [];
|
||||
@endphp
|
||||
|
||||
@if (!empty($posisiKavling) && in_array('Lainnya', $posisiKavling) && !empty($lainnya))
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
@if (!empty($konturTanah))
|
||||
{{ implode(', ', $konturTanah) }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Beda Ketinggian dengan Jalan</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$ketinggianTanah = $forminspeksi['tanah']['ketinggian_tanah'];
|
||||
$ketinggian = $ketinggianTanah['ketinggian'][0] ?? '-';
|
||||
$lebihTinggi = $ketinggianTanah['lebih_tinggi'];
|
||||
$lebihRendah = $ketinggianTanah['lebih_rendah'];
|
||||
@endphp
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{{ $ketinggian }}
|
||||
@if ($ketinggian === 'Lebih Tinggi' && $lebihTinggi !== null)
|
||||
(Ketinggian: {{ $lebihTinggi }} cm)
|
||||
@elseif($ketinggian === 'Lebih Rendah' && $lebihRendah !== null)
|
||||
(Kerendahan: {{ $lebihRendah }} cm)
|
||||
@endif
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tusuk Sate</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'Ya' : 'Tidak' }}
|
||||
@if (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate_ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate_ya'] . ')' : '' }}
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kontur Jalan Depan Objek</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ $forminspeksi['tanah']['kontur_jalan'] == 'menurun' ? 'Menurun' : 'Rata' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Posisi Kavling</td>
|
||||
<td>:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$posisiKavling = $forminspeksi['tanah']['posisi_kavling']['posisi_kavling'] ?? [];
|
||||
$lainnya = $forminspeksi['tanah']['posisi_kavling']['lainnya'] ?? null;
|
||||
@endphp
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lockland</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'yes' ? 'Ya' : 'Tidak' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Kondisi Fisik Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$kondisiFisikTanah = $forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah'][0] ?? '-';
|
||||
$lainnya = $forminspeksi['tanah']['kondisi_fisik_tanah']['lainnya'] ?? null;
|
||||
@endphp
|
||||
{{ !empty($posisiKavling) ? implode(', ', $posisiKavling) : '' }}
|
||||
|
||||
{{ $kondisiFisikTanah }}
|
||||
@if ($kondisiFisikTanah === 'Lainnya' && !empty($lainnya))
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
@if (!empty($posisiKavling) && in_array('Lainnya', $posisiKavling) && !empty($lainnya))
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tusuk Sate</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate']) && is_array($forminspeksi['tanah']['tusuk_sate']) && !empty($forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'Ya' : 'Tidak' }}
|
||||
|
||||
</table>
|
||||
@if (isset($forminspeksi['tanah']['tusuk_sate']) &&
|
||||
is_array($forminspeksi['tanah']['tusuk_sate']) &&
|
||||
!empty($forminspeksi['tanah']['tusuk_sate']['Ya']))
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate_ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate_ya'] . ')' : '' }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lockland</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'yes' ? 'Ya' : 'Tidak' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Kondisi Fisik Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$kondisiFisikTanah = $forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah'][0] ?? '-';
|
||||
$lainnya = $forminspeksi['tanah']['kondisi_fisik_tanah']['lainnya'] ?? null;
|
||||
@endphp
|
||||
|
||||
{{ $kondisiFisikTanah }}
|
||||
@if ($kondisiFisikTanah === 'Lainnya' && !empty($lainnya))
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
<div class="w-full grid grid-cols-1 lg:grid-cols-1 gap-4">
|
||||
|
||||
<!-- Bagian Nilai KJPP -->
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
|
||||
@@ -293,7 +293,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Bagian Nilai Internal -->
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md hidden">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai Internal</h1>
|
||||
</div>
|
||||
@@ -505,23 +505,23 @@
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()">
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
<span id="saveButtonText">Simpan</span>
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
Lampiran Foto dan Dokument
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}"
|
||||
class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
<i class="ki-filled ki-printer"></i>Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-primary"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,110 @@
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<table style="width: 100%; border-collapse: collapse; border: 1px solid #000;">
|
||||
<tr>
|
||||
<td style="width:20%; padding: 2px; border: 1px solid #000">Nama Debitur</td>
|
||||
<td style=" width: 1%; padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; border: 1px solid #000">Nomor Laporan</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ $nomorLaporan }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; border: 1px solid #000">Tanggal Laporan</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ formatTanggalIndonesia($tanggalLaporan) ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
PETA DAN BLAD TATA RUANG
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div>
|
||||
@php
|
||||
$fotoTypes = [
|
||||
'upload_gs',
|
||||
'foto_sentuh_tanahku',
|
||||
'foto_gistaru',
|
||||
'foto_bhumi',
|
||||
'foto_argis_region',
|
||||
'foto_tempat',
|
||||
];
|
||||
|
||||
$customLabels = [
|
||||
'upload_gs' => 'Gambar Situasi',
|
||||
'foto_sentuh_tanahku' => 'Sentuh Tanahku',
|
||||
'foto_gistaru' => 'Gistaru',
|
||||
'foto_bhumi' => 'Bhumi',
|
||||
'foto_argis_region' => 'Blad Tata Ruang ',
|
||||
'foto_tempat' => 'Peta Lokasi',
|
||||
];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
if (($key = array_search('upload_gs', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'upload_gs');
|
||||
}
|
||||
// Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
|
||||
$validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
|
||||
return isset($forminspeksi[$type]) &&
|
||||
file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
});
|
||||
@endphp
|
||||
|
||||
<table width="100%" border="0">
|
||||
@foreach ($validPhotoTypes as $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<tr>
|
||||
<td style="width: 100%; vertical-align: top; text-align: center" class="photo-item border">
|
||||
<p style="margin: 0; font-size: 10px; text-align: center;">
|
||||
{{ $customLabels[$type] ?? '' }}
|
||||
</p>
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
|
||||
style="max-height: 400px; height: auto; max-width: 100%;">
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page-break"></div>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
FOTO JAMINAN
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.foto-jaminan')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer id="footer">
|
||||
Cabang : {{ $permohonan->debiture->branch->name ?? '' }}
|
||||
{{-- Cabang : {{ $permohonan->debiture->branch->name ?? '' }} --}}
|
||||
</footer>
|
||||
<script type="text/php">
|
||||
if (isset($pdf)) {
|
||||
$pdf->page_script('
|
||||
$font = $fontMetrics->get_font("Arial, Helvetica, sans-serif", "normal");
|
||||
$size = 10;
|
||||
$pageText = $PAGE_NUM;
|
||||
$y = 800;
|
||||
$x = 550;
|
||||
$pdf->text($x, $y, $pageText, $font, $size);
|
||||
');
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
const datas = @json($forminspeksi);
|
||||
console.log(datas);
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
|
||||
/* Image Styling */
|
||||
.photo-item img {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
width: auto;
|
||||
height: 400px;
|
||||
max-height: 400px;
|
||||
object-fit: contain;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 5px;
|
||||
@@ -46,34 +47,25 @@
|
||||
|
||||
/* Media Print */
|
||||
@media print {
|
||||
.photo-item {
|
||||
width: 48%;
|
||||
margin-right: 2%;
|
||||
float: left;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top;
|
||||
text-align: center;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.photo-item img {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
object-fit: contain;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 5px;
|
||||
page-break-inside: avoid;
|
||||
.photo-image {
|
||||
width: 100;
|
||||
height: 400px;
|
||||
max-height: 400px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.photo-container {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.photo-row {
|
||||
page-break-inside: avoid;
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -100,142 +92,78 @@
|
||||
|
||||
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
|
||||
@if (count($subPhotos) > 0)
|
||||
<table width="100%" border="0" style="align-content: center; text-align: center">
|
||||
<tr>
|
||||
@if (count($subPhotos) === 1)
|
||||
@foreach ($subPhotos->chunk(2) as $chunkedPhotos)
|
||||
<table width="100%" border="0"
|
||||
style="align-content: center; text-align: center; margin-bottom: 20px">
|
||||
@foreach ($chunkedPhotos as $item)
|
||||
@php
|
||||
$item = $subPhotos->first();
|
||||
$imagePath = storage_path('app/public/' . $item['path']);
|
||||
@endphp
|
||||
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2"
|
||||
class="photo-item border">
|
||||
<p style="font-weight: medium; font-size: 10px">{{ $category }} -
|
||||
|
||||
@isset($subcategory)
|
||||
@if (trim($subcategory) !== '')
|
||||
{{ $subcategory }} -
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
{{ $item['name'] ?? '' }}
|
||||
</p>
|
||||
@if ($statusLpj || file_exists($imagePath))
|
||||
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
@isset($item['description'])
|
||||
<p style="font-size:9px">{{ $item['description'] }}</p>
|
||||
@endisset
|
||||
</td>
|
||||
@else
|
||||
@foreach ($subPhotos as $index => $item)
|
||||
@php
|
||||
$imagePath = storage_path('app/public/' . $item['path']);
|
||||
@endphp
|
||||
<td style="width: 50%; vertical-align: top; text-align: center"
|
||||
class="photo-item border">
|
||||
<tr>
|
||||
<td style="width: 100%; padding: 10px;" class="photo-item border">
|
||||
<p style="font-weight: medium; font-size: 10px">{{ $category }} -
|
||||
|
||||
@isset($subcategory)
|
||||
@if (trim($subcategory) !== '')
|
||||
{{ $subcategory }} -
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
{{ $item['name'] ?? '' }}
|
||||
</p>
|
||||
@if ($statusLpj || file_exists($imagePath))
|
||||
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
|
||||
@endif
|
||||
@isset($item['description'])
|
||||
<p style="font-size:9px">{{ $item['description'] }}</p>
|
||||
@endisset
|
||||
</td>
|
||||
@if (($index + 1) % 2 == 0)
|
||||
</tr>
|
||||
<tr>
|
||||
</tr>
|
||||
@endforeach
|
||||
@if (count($chunkedPhotos) < 2)
|
||||
<tr style="width: 100%;"></tr>
|
||||
@endif
|
||||
</table>
|
||||
<div class="page-break"></div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@if (count($subPhotos) % 2 != 0)
|
||||
<td style="width: 50%;"></td>
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<div class="page-break"></div>
|
||||
|
||||
@if (!$otherPhotos->isEmpty())
|
||||
@foreach ($otherPhotos->groupBy('sub') as $subcategory => $subPhotos)
|
||||
@if (count($subPhotos) > 0)
|
||||
<table width="100%" border="0" style="align-content: center; text-align: center">
|
||||
<tr>
|
||||
@if (count($subPhotos) === 1)
|
||||
@php
|
||||
$item = $subPhotos->first();
|
||||
$imagePath = storage_path('app/public/' . $item['path']);
|
||||
@endphp
|
||||
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2"
|
||||
class="photo-item border">
|
||||
<p style="font-weight: medium; font-size: 10px">Lainnya -
|
||||
|
||||
@isset($subcategory)
|
||||
@if (trim($subcategory) !== '')
|
||||
{{ $subcategory }} -
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
{{ $item['name'] ?? '' }}
|
||||
</p>
|
||||
@if ($statusLpj || file_exists($imagePath))
|
||||
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
@isset($item['description'])
|
||||
<p style="font-size:9px">{{ $item['description'] }}</p>
|
||||
@endisset
|
||||
</td>
|
||||
@else
|
||||
@foreach ($subPhotos as $index => $item)
|
||||
@if (!$otherPhotos->isEmpty())
|
||||
@foreach ($otherPhotos->groupBy('sub') as $subcategory => $subPhotos)
|
||||
@if (count($subPhotos) > 0)
|
||||
@foreach ($subPhotos->chunk(2) as $chunkedPhotos)
|
||||
<table width="100%" border="0"
|
||||
style="align-content: center; text-align: center; margin-bottom: 20px">
|
||||
@foreach ($chunkedPhotos as $item)
|
||||
@php
|
||||
$imagePath = storage_path('app/public/' . $item['path']);
|
||||
@endphp
|
||||
<td style="width: 50%; vertical-align: top; text-align: center" class="photo-item border">
|
||||
<p style="font-weight: medium; font-size: 10px">Lainnya -
|
||||
|
||||
@isset($subcategory)
|
||||
@if (trim($subcategory) !== '')
|
||||
{{ $subcategory }} -
|
||||
@endif
|
||||
<tr>
|
||||
<td style="width: 100%; padding: 10px;" class="photo-item border">
|
||||
<p style="font-weight: medium; font-size: 10px">Lainnya -
|
||||
@isset($subcategory)
|
||||
@if (trim($subcategory) !== '')
|
||||
{{ $subcategory }} -
|
||||
@endif
|
||||
@endisset
|
||||
{{ $item['name'] ?? '' }}
|
||||
</p>
|
||||
@if ($statusLpj || file_exists($imagePath))
|
||||
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
|
||||
@endif
|
||||
@isset($item['description'])
|
||||
<p style="font-size:9px">{{ $item['description'] }}</p>
|
||||
@endisset
|
||||
|
||||
{{ $item['name'] ?? '' }}
|
||||
</p>
|
||||
@if ($statusLpj || file_exists($imagePath))
|
||||
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
@isset($item['description'])
|
||||
<p style="font-size:9px">{{ $item['description'] }}</p>
|
||||
@endisset
|
||||
</td>
|
||||
@if (($index + 1) % 2 == 0)
|
||||
</tr>
|
||||
<tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@if (count($subPhotos) % 2 != 0)
|
||||
<td style="width: 50%;"></td>
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@if (count($chunkedPhotos) < 2)
|
||||
<tr style="width: 100%;"></tr>
|
||||
@endif
|
||||
</table>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
@@ -109,10 +109,20 @@
|
||||
|
||||
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat', 'foto_sentuh_tanahku'];
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
$fotoTypes = ['upload_gs','foto_sentuh_tanahku','foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
|
||||
$customLabels = [
|
||||
'upload_gs' => 'Gambar Situasi',
|
||||
'foto_sentuh_tanahku' => 'Sentuh Tanahku',
|
||||
'foto_gistaru' => 'Gistaru',
|
||||
'foto_bhumi' => 'Bhumi',
|
||||
'foto_argis_region' => 'Blad Tata Ruang',
|
||||
'foto_tempat' => 'Tempat',
|
||||
];
|
||||
|
||||
if (($key = array_search('upload_gs', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
array_unshift($fotoTypes, 'upload_gs');
|
||||
}
|
||||
$adaFoto = false;
|
||||
if (isset($forminspeksi)) {
|
||||
@@ -129,12 +139,11 @@
|
||||
@if ($adaFoto)
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Peta
|
||||
<h3 class="card-title uppercase">
|
||||
GS, Tata Ruang dan Peta
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div>
|
||||
@if (isset($forminspeksi))
|
||||
@forelse ($fotoTypes as $type)
|
||||
@@ -147,7 +156,7 @@
|
||||
<img src="{{ asset('storage/' . $imagePath) }}" alt="{{ $type }}"
|
||||
class="w-full h-auto object-cover">
|
||||
@endif
|
||||
<p class="mt-2 text-sm">{{ Str::title(str_replace('_', ' ', $type)) }}</p>
|
||||
<p class="mt-2 text-sm">{{ $customLabels[$type] ?? '' }}</p>
|
||||
</div>
|
||||
@empty
|
||||
<p>Tidak ada tipe foto yang tersedia</p>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
text-align: center;
|
||||
border-top: 1px solid #ddd;
|
||||
padding-top: 10px;
|
||||
font-size: 9px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.page-number:after {
|
||||
@@ -96,8 +96,40 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@php
|
||||
$data = '';
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$teams = $permohonan->region->teams;
|
||||
|
||||
if ($teams) {
|
||||
foreach ($teams as $team) {
|
||||
$team_users = $team->teamsUsers;
|
||||
// print_r($team_users);
|
||||
if ($team_users) {
|
||||
foreach ($team_users as $team_user) {
|
||||
$user = $team_user->user;
|
||||
|
||||
if ($user && $user->hasRole('senior-officer')) {
|
||||
$senior_officer = $user;
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
use Modules\Usermanagement\Models\User;
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
|
||||
$data = rtrim($data, ', ');
|
||||
@endphp
|
||||
|
||||
<body style="width: 90%; margin: auto;">
|
||||
|
||||
<header id="header">
|
||||
<table style="width: 100%; border: none;">
|
||||
<tr>
|
||||
@@ -105,11 +137,13 @@
|
||||
@include('lpj::component.logo-bag', ['width' => 150, 'height' => 40])
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<div style="">
|
||||
<p style="margin: 0; padding:0; font-size:10px;">Tanggal: {{ date('Y-m-d') }}</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">Waktu: {{ date('H:i:s') }}</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">User: {{ Auth::user()->name }}</p>
|
||||
</div>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">
|
||||
Tanggal: {{ \Carbon\Carbon::parse($permohonan->penilaian->updated_at)->format('d-m-Y') }}
|
||||
</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">
|
||||
Waktu: {{ \Carbon\Carbon::parse($permohonan->penilaian->updated_at)->format('H:i') }}
|
||||
</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">User: {{ $penilaiUser->name }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -51,20 +51,19 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Harga Transaksi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ isset($item['harga_diskon']) ? formatRupiah($item['harga_diskon']) : '' }}</span>
|
||||
<span>{{ isset($item['total']) ? formatRupiah($item['total']) : '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Penjual (HP)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['telepon'] }}</span>
|
||||
<span>{{ $item['telepon'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Ditawarkan sejak</label>
|
||||
<label class="form-label max-w-56">Tanggal Data</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['penawaran'] ?? '' }}</span>
|
||||
<span>{{ isset($item['tanggal']) ? formatTanggalIndonesia($item['tanggal']) : '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -45,23 +45,23 @@
|
||||
</div>
|
||||
<div class="flex card-footer justify-end gap-5">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="saveLpjSederhanadanStandard()">
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="saveLpjSederhanadanStandard()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
<span id="saveButtonText">Simpan</span>
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
Lampiran Foto dan Dokumen
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}" class="btn btn-light"
|
||||
>
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
@@ -211,7 +211,7 @@
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Dokument
|
||||
Dokumen
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
@@ -289,11 +289,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border border-agi-100 rounded-lg shadow-md">
|
||||
<div class="card-body">
|
||||
<div class=" py-4 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Upload Foto</h1>
|
||||
</div>
|
||||
|
||||
<div class="dropzone" id="dropzone-upload">
|
||||
<div class="dz-message needsclick" data-foto-type="upload_foto">
|
||||
<i class="ki-duotone ki-file-up text-primary text-3xl"><span class="path1"></span><span
|
||||
class="path2"></span></i>
|
||||
<div class="ms-4">
|
||||
<h3 class="fs-5 fw-bold text-gray-900 mb-1">Drop files here or click to upload.</h3>
|
||||
<span class="fs-7 fw-semibold text-gray-500">Upload up to 10 files</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div id="existing-photos" class="flex gap-5"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- @include('lpj::penilai.components.foto-lampiran') --}}
|
||||
|
||||
<div class="flex card-footer justify-end gap-5">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<a class="btn btn-primary" onclick="saveMemo()">
|
||||
<a class="btn btn-primary" onclick="saveMemo()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
Simpan
|
||||
</a>
|
||||
@@ -301,7 +323,7 @@
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
Lampiran Foto dan Dokument
|
||||
Lampiran Foto dan Dokumen
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}"
|
||||
class="btn btn-light">
|
||||
@@ -318,7 +340,75 @@
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::surveyor.js.utils')
|
||||
<script>
|
||||
@push('scripts')
|
||||
<script>
|
||||
Dropzone.autoDiscover = false;
|
||||
let myDropzone;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
myDropzone = new Dropzone("#dropzone-upload", {
|
||||
url: "{{ route('penilai.uploadTempPhoto') }}", // Temporary upload route
|
||||
paramName: "file",
|
||||
maxFilesize: 5, // MB
|
||||
acceptedFiles: "image/*",
|
||||
addRemoveLinks: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
init: function() {
|
||||
this.on("success", function(file, response) {
|
||||
file.serverId = response.id; // Store the server's file ID
|
||||
});
|
||||
|
||||
// Load existing photos
|
||||
loadExistingPhotos();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function loadExistingPhotos() {
|
||||
const existingPhotosContainer = document.getElementById('existing-photos');
|
||||
if (!existingPhotosContainer) return;
|
||||
|
||||
@if(isset($memo) && isset($memo->foto))
|
||||
let existingPhotos;
|
||||
try {
|
||||
existingPhotos = @json($memo->foto);
|
||||
} catch (e) {
|
||||
console.error('Error parsing existing photos:', e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(existingPhotos)) {
|
||||
existingPhotos.forEach(function(photoPath) {
|
||||
if (typeof photoPath === 'string') {
|
||||
const photoDiv = document.createElement('div');
|
||||
photoDiv.className = 'col-md-3 mb-3';
|
||||
|
||||
const img = document.createElement('img');
|
||||
img.src = photoPath;
|
||||
img.className = 'img-fluid';
|
||||
img.style.maxHeight = '150px';
|
||||
|
||||
photoDiv.appendChild(img);
|
||||
existingPhotosContainer.appendChild(photoDiv);
|
||||
|
||||
if (myDropzone) {
|
||||
let mockFile = { name: photoPath.split('/').pop(), size: 12345 };
|
||||
myDropzone.emit("addedfile", mockFile);
|
||||
myDropzone.emit("thumbnail", mockFile, photoPath);
|
||||
myDropzone.emit("complete", mockFile);
|
||||
mockFile.previewElement.classList.add("dz-success");
|
||||
mockFile.previewElement.classList.add("dz-complete");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('Existing photos is not an array:', existingPhotos);
|
||||
}
|
||||
@endif
|
||||
}
|
||||
|
||||
function saveMemo() {
|
||||
const form = document.getElementById('form-memo');
|
||||
const formData = new FormData(form);
|
||||
@@ -352,17 +442,26 @@
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const requestUrl = `{{ route('penilai.storeMemo') }}`;
|
||||
// Create a new FormData object to send both JSON and files
|
||||
const sendFormData = new FormData();
|
||||
sendFormData.append('permohonan_id', permohonanId);
|
||||
sendFormData.append('document_id', documentId);
|
||||
sendFormData.append('inspeksi_id', inspeksiId);
|
||||
sendFormData.append('memo', JSON.stringify(jsonData));
|
||||
|
||||
// Append all files from Dropzone
|
||||
myDropzone.getAcceptedFiles().forEach((file, index) => {
|
||||
sendFormData.append(`foto_${index}`, file);
|
||||
});
|
||||
|
||||
const requestUrl = `{{ route('penilai.storeMemoWithPhotos') }}`;
|
||||
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
memo: jsonData,
|
||||
}),
|
||||
contentType: 'application/json',
|
||||
data: sendFormData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
@@ -390,17 +489,15 @@
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
toastrErrorBuild(value[0]);
|
||||
});
|
||||
}
|
||||
hideLoadingSwal();
|
||||
console.log(errors);
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: 'Terjadi kesalahan saat mengirim data',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -35,32 +35,29 @@
|
||||
<td style="text-align: center; margin-top: 5px;">
|
||||
<h2 style="text-decoration: underline; text-transform: uppercase; text-align: center; margin: 0;">
|
||||
MEMO ANTAR KANTOR</h2>
|
||||
<p style="font-size: 12px; margin: 0;">NO: {{ $nomorLaporan ?? '' }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Kepada</td>
|
||||
<td style="width: 25%; padding: 2px;">Kepada</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $memo['kepada'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Dari</td>
|
||||
<td style="width: 25%; padding: 2px;">Dari</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $memo['dari'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">No memo</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $nomorLaporan ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Tanggal</td>
|
||||
<td style="width: 25%; padding: 2px;">Tanggal</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ formatTanggalIndonesia($memo['tanggal']) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Perihal</td>
|
||||
<td style="width: 25%; padding: 2px;">Perihal</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $memo['perihal'] ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -86,102 +83,44 @@
|
||||
<table style="width: 100%">
|
||||
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Nama Calon Debitur</td>
|
||||
<td style="width: 25%; padding: 2px;">Nama Calon Debitur</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Jenis Aset</td>
|
||||
<td style="width: 25%; padding: 2px;">Jenis Aset</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $data ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<td style=" padding: 2px;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
<td style=" padding: 2px;">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="padding: 2px;">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
<td style="">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@include('lpj::component.print-out-dokument')
|
||||
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Atas Nama</td>
|
||||
<td style="width: 25%; padding: 2px;">Atas Nama</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
@if (!empty($memo['lokasi']['address']))
|
||||
<tr>
|
||||
<td width="20%">Terletak di</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['address'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Desa/Kelurahan</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['village_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kecamatan</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['district_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kabupaten/Kota</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['city_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Provinsi</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['province_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
@php
|
||||
$alamatFields = [
|
||||
'Terletak di' => 'address',
|
||||
'Desa/Kelurahan' => 'village_code',
|
||||
'Kecamatan' => 'district_code',
|
||||
'Kabupaten/Kota' => 'city_code',
|
||||
'Provinsi' => 'province_code'
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($alamatFields as $label => $field)
|
||||
@if (!empty($alamat[$field]))
|
||||
<tr>
|
||||
<td width="25%">{{ $label }}</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat[$field] }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</table>
|
||||
|
||||
@@ -197,25 +136,25 @@
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Tanggal Kunjungan</td>
|
||||
<td style="width: 25%; padding: 2px;">Tanggal Kunjungan</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Surveyor</td>
|
||||
<td style="width: 25%; padding: 2px;">Surveyor</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $surveyor->userPenilaiTeam->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Pihak Pemohon</td>
|
||||
<td style="width: 25%; padding: 2px;">Pihak Pemohon</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $permohonan->user->name ?? '' }} -
|
||||
{{ $permohonan->debiture->branch->name ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Pihak Cadeb/Debitur</td>
|
||||
<td style="width: 25%; padding: 2px;">Pihak Cadeb/Debitur</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -259,7 +198,9 @@
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path('app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign);
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
@@ -342,17 +283,23 @@
|
||||
</table>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page-break"></div>
|
||||
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center">
|
||||
FOTO JAMINAN
|
||||
</h6>
|
||||
</div>
|
||||
@include('lpj::penilai.components.foto-jaminan')
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<div class="page-break"></div>
|
||||
@if (isset($memo['foto']))
|
||||
|
||||
<table width="100%" border="0" style="align-content: center; text-align: center; margin-bottom: 20px">
|
||||
@foreach ($memo['foto'] as $item)
|
||||
@php
|
||||
$cleanedPath = str_replace('/storage/', '', $item);
|
||||
$imagePath = storage_path('app/public/' . $cleanedPath);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style="width: 100%; padding: 10px;" class="photo-item border">
|
||||
<img src="{{ $imagePath }}" alt="{{ $item }}" class="photo-image">
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -39,25 +39,26 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr />
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Kepada</td>
|
||||
<td style="width: 25%; padding: 2px;">Kepada</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $report['kepada'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Dari</td>
|
||||
<td style="width: 25%; padding: 2px;">Dari</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $report['dari'] ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Tanggal</td>
|
||||
<td style="width: 25%; padding: 2px;">Tanggal</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ formatTanggalIndonesia($report['tanggal']) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Perihal</td>
|
||||
<td style="width: 25%; padding: 2px;">Perihal</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $report['perihal'] ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -75,24 +76,24 @@
|
||||
<table style="width: 100%">
|
||||
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Nama Debitur</td>
|
||||
<td style="width: 25%; padding: 2px;">Nama Debitur</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">KJPP</td>
|
||||
<td style="width: 25%; padding: 2px;">KJPP</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ preg_replace('/^K\\d+ - /', '', $permohonan->penawaran->nama_kjpp_sebelumnya ?? '-') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Jenis Aset</td>
|
||||
<td style="width: 25%; padding: 2px;">Jenis Aset</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $data ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
@if (!empty($report['lokasi']['address']))
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Lokasi Objek Penilaian</td>
|
||||
<td style="width: 25%; padding: 2px;">Lokasi Objek Penilaian</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $report['lokasi']['address'] ?? '' }},
|
||||
{{ $alamat['village_code'] ?? '' }} {{ $alamat['district_code'] ?? '' }},
|
||||
@@ -100,82 +101,31 @@
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<td style=" padding: 2px;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
<td style=" padding: 2px;">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="padding: 2px;">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
<td style="">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@include('lpj::component.print-out-dokument')
|
||||
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Tanggal Penilaian</td>
|
||||
<td style="width: 25%; padding: 2px;">Tanggal Penilaian</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ isset($permohonan->penilaian->tanggal_kunjungan) ? formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Lelang ke</td>
|
||||
<td style="width: 25%; padding: 2px;">Lelang ke</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $report['lelang'] ?? '' }}</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $report['lelang_kjpp'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Nilai Pasar Wajar (NPW)</td>
|
||||
<td style="width: 25%; padding: 2px;">Nilai Pasar Wajar (NPW)</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ isset($report['nilai_pasar']) ? formatRupiah($report['nilai_pasar']) : '-' }}</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ isset($report['nilai_pasar_kjpp']) ? formatRupiah($report['nilai_pasar_kjpp']) : '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">
|
||||
<td style="width: 25%; padding: 2px;">
|
||||
Nilai Likuidasi
|
||||
{{ isset($report['persentase_likuidasi']) ? '(' . $report['persentase_likuidasi'] . '%)' : '-' }}
|
||||
{{ isset($report['persentase_likuidasi_kjpp']) ? '(' . $report['persentase_likuidasi_kjpp'] . '%)' : '-' }}
|
||||
</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
{{ isset($report['hasil_nilai_likuidasi']) ? formatRupiah($report['hasil_nilai_likuidasi']) : '-' }}
|
||||
{{ isset($report['hasil_nilai_likuidasi_kjpp']) ? formatRupiah($report['hasil_nilai_likuidasi_kjpp']) : '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -193,25 +143,25 @@
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Staf Subdit Appraisal </td>
|
||||
<td style="width: 25%; padding: 2px;">Staf Subdit Appraisal </td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Pihak KJPP</td>
|
||||
<td style="width: 25%; padding: 2px;">Pihak KJPP</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $forminspeksi['signature']['kjjp']['name'] ?? $report['pihak_kjjpp'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Pihak BAGI Cab </td>
|
||||
<td style="width: 25%; padding: 2px;">Pihak BAGI Cab </td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $permohonan->user->name ?? '' }} -
|
||||
{{ $permohonan->debiture->branch->name ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Debitur/perwakilan debitur </td>
|
||||
<td style="width: 25%; padding: 2px;">Debitur/perwakilan debitur </td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -369,16 +319,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center">
|
||||
FOTO JAMINAN
|
||||
</h6>
|
||||
</div>
|
||||
@include('lpj::penilai.components.foto-jaminan')
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -28,32 +28,26 @@
|
||||
$data = rtrim($data, ', ');
|
||||
@endphp
|
||||
<main class="content">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<h2 style="text-transform: uppercase;">Report Analisa Property</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="text-align: center; margin-top: 5px;">
|
||||
<h4 style="text-transform: uppercase; font-size: 16px; margin: 0;">Report Analisa Property
|
||||
{{ $data }}</h4>
|
||||
<p style="font-size: 12px; margin: 5px 0;">NO: {{ $nomorLaporan }}</p>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px; vertical-align: top;">Kepada</td>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Kepada</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="width: 79%; vertical-align: top;">{{ $rap['kepada'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Dari</td>
|
||||
<td style="width: 25%; padding: 2px;">Dari</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $rap['dari'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">No</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $nomorLaporan ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Tanggal Survey</td>
|
||||
<td style="width: 25%; padding: 2px;">Tanggal Survey</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->waktu_penilaian) }}</td>
|
||||
@@ -77,7 +71,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Perihal</td>
|
||||
<td style="width: 25%; padding: 2px;">Perihal</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{{ $rap['perihal'] ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -87,7 +81,7 @@
|
||||
<h2 style="text-transform: uppercase;">NAMA DEVELOPER</h2>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Nama</td>
|
||||
<td style="width: 25%; padding: 2px;">Nama</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -96,7 +90,7 @@
|
||||
<h2 style="text-transform: uppercase;">NAMA PROYEK</h2>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Proyek</td>
|
||||
<td style="width: 25%; padding: 2px;">Proyek</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{{ $data ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -104,7 +98,7 @@
|
||||
<h2 style="text-transform: uppercase;">ALAMAT</h2>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td width="20%">Terletak di</td>
|
||||
<td width="25%">Terletak di</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['address'] ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -132,71 +126,13 @@
|
||||
<h2 style="text-transform: uppercase;">DOKUMEN TERLAMPIR</h2>
|
||||
<table style="width: 100%;">
|
||||
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
@php
|
||||
$dokumen_jaminan = is_string($detail->dokumen_jaminan)
|
||||
? json_decode($detail->dokumen_jaminan, true)
|
||||
: [];
|
||||
$dokumen_jaminan = is_array($dokumen_jaminan)
|
||||
? $dokumen_jaminan
|
||||
: [$detail->dokumen_jaminan];
|
||||
|
||||
$dokumen_nomor = is_string($detail->dokumen_nomor)
|
||||
? json_decode($detail->dokumen_nomor, true)
|
||||
: [];
|
||||
$dokumen_nomor = is_array($dokumen_nomor) ? $dokumen_nomor : [$detail->dokumen_nomor];
|
||||
@endphp
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (isset($detail->details))
|
||||
@php
|
||||
$detailItems = json_decode($detail->details, true);
|
||||
@endphp
|
||||
@if (is_array($detailItems))
|
||||
@foreach ($detailItems as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}
|
||||
</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@include('lpj::component.print-out-dokument')
|
||||
|
||||
|
||||
@if (isset($forminspeksi['perizinan']) && is_array($forminspeksi['perizinan']) && count($forminspeksi['perizinan']) > 0)
|
||||
@foreach ($forminspeksi['perizinan'] as $perizinan)
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Perizinan</td>
|
||||
<td style="width: 25%; padding: 2px;">Perizinan</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $perizinan['perizinan'] }}</td>
|
||||
</tr>
|
||||
@@ -206,7 +142,7 @@
|
||||
@if (isset($forminspeksi['brosur_price_list']) && count($forminspeksi['brosur_price_list']) > 0)
|
||||
@foreach ($forminspeksi['brosur_price_list'] as $perizinan)
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Brosur & Pricelist</td>
|
||||
<td style="width: 25%; padding: 2px;">Brosur & Pricelist</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $perizinan['jenis'] }}</td>
|
||||
</tr>
|
||||
@@ -218,13 +154,13 @@
|
||||
<h2 style="text-transform: uppercase;">DESKRIPSI DEVELOPER</h2>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Pengalaman Developer & Proyek Yang Pernah
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Pengalaman Developer & Proyek Yang Pernah
|
||||
Dibuat</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{!! nl2br(e($forminspeksi['pengalaman_developer'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Apakah Developer Anggota REI</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Apakah Developer Anggota REI</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['developer_anggota'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
@@ -233,7 +169,7 @@
|
||||
@isset($forminspeksi['lainnya_developer'])
|
||||
@foreach ($forminspeksi['lainnya_developer'] as $item)
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Lainnya</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Lainnya</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>
|
||||
{!! nl2br(e($item)) !!}
|
||||
@@ -245,43 +181,43 @@
|
||||
<h2 style="text-transform: uppercase;">KONDISI, LINGKUNGAN DAN PROGRESS PEMBANGUNAN</h2>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Kapan Mulai Dibangun & Target Penyelesaian
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Kapan Mulai Dibangun & Target Penyelesaian
|
||||
</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['kapan_mulai_dibangun'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Kondisi Perumahan Saat Ini</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Kondisi Perumahan Saat Ini</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['kondisi_perumahan'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Progress Pembangunan</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Progress Pembangunan</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['progres_pembangunan'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Kontraktor (internal/eksternal)</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Kontraktor (internal/eksternal)</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['kontraktor'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Lingkungan Sekitar</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Lingkungan Sekitar</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['lingkungan_sekitar'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Komplek Lain Disekitar Lokasi</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Komplek Lain Disekitar Lokasi</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['komplek_disekitar'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Pusat Keramaian Dekat Lokasi</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Pusat Keramaian Dekat Lokasi</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['pusat_keramaian'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Transportasi Umum Yang Tersedia</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Transportasi Umum Yang Tersedia</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>{!! nl2br(e($forminspeksi['transportasi_umum'] ?? 'Data tidak tersedia')) !!}</td>
|
||||
</tr>
|
||||
@@ -290,7 +226,7 @@
|
||||
@isset($forminspeksi['lainnya_kondisi'])
|
||||
@foreach ($forminspeksi['lainnya_kondisi'] as $item)
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Lainnya</td>
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">Lainnya</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td>
|
||||
{!! nl2br(e($item)) !!}
|
||||
@@ -307,7 +243,7 @@
|
||||
@foreach ($forminspeksi['partisi'] as $key => $item)
|
||||
@if (is_array($item))
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">
|
||||
<td style="vertical-align: top; width: 25%; padding: 2px;">
|
||||
{{ $item['nama'] ?? '' }}
|
||||
</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
@@ -562,61 +498,5 @@
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center;">
|
||||
PETA
|
||||
</h6>
|
||||
</div>
|
||||
<div class="photo-container">
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (isset($forminspeksi))
|
||||
@php $counter = 0; @endphp
|
||||
@foreach ($fotoTypes as $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
@if ($counter % 2 == 0)
|
||||
<div class="photo-row clearfix">
|
||||
@endif
|
||||
<div class="photo-item border">
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $type }}"
|
||||
class="photo-image">
|
||||
<p style="margin: 0; font-size: 12px;">
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
</div>
|
||||
@if ($counter % 2 == 1 || $loop->last)
|
||||
</div>
|
||||
@endif
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-break"></div>
|
||||
|
||||
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center">
|
||||
FOTO JAMINAN
|
||||
</h6>
|
||||
</div>
|
||||
@include('lpj::penilai.components.foto-jaminan')
|
||||
</div>
|
||||
</main>
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
@endphp
|
||||
|
||||
<main class="content">
|
||||
<div style="text-align: center; margin-top: 5px;">
|
||||
<h4 style="text-transform: uppercase; font-size: 16px; margin: 0;">LAPORAN PENILAIAN ATAS
|
||||
{{ $data }}</h4>
|
||||
<p style="font-size: 12px; margin: 5px 0;">NO: {{ $nomorLaporan }}</p>
|
||||
</div>
|
||||
<hr />
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
@@ -45,13 +51,13 @@
|
||||
<td style="padding: 2px; vertical-align: top;">Tanggal Order</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}</td>
|
||||
{{ formatTanggalIndonesia($permohonan->tanggal_permohonan) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Tanggal Survey</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->updated_at) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">User</td>
|
||||
@@ -99,11 +105,6 @@
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $senior_officer->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">No Laporan</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $nomorLaporan ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Tanggal Laporan</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
@@ -114,7 +115,7 @@
|
||||
<td style="padding: 2px; vertical-align: top;">Waktu Penyelesaian</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ hitungHariKerja($permohonan->penilaian->tanggal_kunjungan, $tanggalLaporan) }}</td>
|
||||
{{ hitungHariKerja($permohonan->penilaian->updated_at, $tanggalLaporan) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -164,55 +165,7 @@
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $alamat['province_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $detail->name ?? '' }}</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (isset($detail->details) && json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}
|
||||
</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@include('lpj::component.print-out-dokument')
|
||||
|
||||
@if (isset($forminspeksi['asset']['nomor_nib']))
|
||||
<tr>
|
||||
@@ -230,9 +183,12 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="no-break">
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td style="width: 50%; border: 1px solid #000;">
|
||||
A. STATUS KEPEMILIKAN, HUBUNGAN DAN PENGHUNI
|
||||
</td>
|
||||
@@ -314,7 +270,7 @@
|
||||
@endphp
|
||||
<td style="padding: 2px; vertical-align: top;">Luas Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $luas ?? '' }}</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $luas ?? '' }} <sup>m2</sup></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Bentuk Tanah</td>
|
||||
@@ -736,7 +692,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
@@ -825,10 +781,10 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:30%">
|
||||
<td style="padding: 3px; text-align: right; width:20%">
|
||||
{{ $lpjData['likuidasi'] ?? '' }}%
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width:30%">
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width:40%">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Total Nilai Pasar Wajar
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:40%;">
|
||||
@@ -1068,107 +1024,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="page-break"></div>
|
||||
<table style="width: 100%; border-collapse: collapse; border: 1px solid #000;">
|
||||
<tr>
|
||||
<td style="width:20%; padding: 2px; border: 1px solid #000">Nama Debitur</td>
|
||||
<td style=" width: 1%; padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; border: 1px solid #000">Nomor Laporan</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ $nomorLaporan }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; border: 1px solid #000">Tanggal Laporan</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ formatTanggalIndonesia($tanggalLaporan) ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center;">
|
||||
PETA
|
||||
</h6>
|
||||
</div>
|
||||
<div class="photo-container">
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat', 'foto_sentuh_tanahku'];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
}
|
||||
// Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
|
||||
$validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
|
||||
return isset($forminspeksi[$type]) &&
|
||||
file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
});
|
||||
@endphp
|
||||
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
@if (count($validPhotoTypes) === 1)
|
||||
@php
|
||||
$type = reset($validPhotoTypes);
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2"
|
||||
class="photo-item border">
|
||||
<p style="margin: 0; font-size: 10px; text-align: center;">
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
@if ($imagePath)
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}"
|
||||
alt="{{ $imagePath }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
</td>
|
||||
@else
|
||||
@foreach ($fotoTypes as $index => $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
@isset($imagePath)
|
||||
<td style="width: 50%; vertical-align: top; text-align: center" class="photo-item border">
|
||||
<p style="margin: 0; font-size: 10px; text-align: center;">
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}"
|
||||
alt="{{ $imagePath }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
</td>
|
||||
@endisset
|
||||
@if (($index + 1) % 2 == 0)
|
||||
</tr>
|
||||
<tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@if (count($fotoTypes) % 2 != 0)
|
||||
<td style="width: 50%;"></td>
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center">
|
||||
FOTO JAMINAN
|
||||
</h6>
|
||||
</div>
|
||||
@include('lpj::penilai.components.foto-jaminan')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -73,13 +73,13 @@
|
||||
<td style="width: 25%; padding: 2px;">Tanggal Order</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
{{ formatTanggalIndonesia($permohonan->create_at) }}</td>
|
||||
{{ formatTanggalIndonesia($permohonan->tanggal_permohonan) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px;">Tannggal Survey</td>
|
||||
<td style="width: 25%; padding: 2px;">Tanggal Survey</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; width: 79%;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->waktu_penilaian) }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -154,7 +154,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="no-break">
|
||||
{{-- <div class="no-break"> --}}
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
@@ -163,61 +163,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
@include('lpj::component.print-out-dokument')
|
||||
</table>
|
||||
{{-- </div> --}}
|
||||
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
@@ -264,7 +212,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="no-break">
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
@@ -284,7 +232,7 @@
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
@@ -532,106 +480,5 @@
|
||||
</div>
|
||||
|
||||
</table>
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<table style="width: 100%; border-collapse: collapse; border: 1px solid #000;">
|
||||
<tr>
|
||||
<td style="width:20%; padding: 2px; border: 1px solid #000">Nama Debitur</td>
|
||||
<td style=" width: 1%; padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; border: 1px solid #000">Nomor Laporan</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ $nomorLaporan }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; border: 1px solid #000">Tanggal Laporan</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">:</td>
|
||||
<td style="padding: 2px; border: 1px solid #000">{{ formatTanggalIndonesia($tanggalLaporan) ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
PETA
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="photo-container">
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat','foto_sentuh_tanahku'];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
}
|
||||
// Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
|
||||
$validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
|
||||
return isset($forminspeksi[$type]) &&
|
||||
file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
});
|
||||
@endphp
|
||||
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
@if (count($validPhotoTypes) === 1)
|
||||
@php
|
||||
$type = reset($validPhotoTypes); // Ambil elemen pertama
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2"
|
||||
class="photo-item border">
|
||||
<p style="margin: 0; font-size: 10px; text-align: center;">
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
@if ($imagePath)
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
|
||||
class="photo-image" style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
</td>
|
||||
@else
|
||||
@foreach ($fotoTypes as $index => $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
@isset($imagePath)
|
||||
<td style="width: 50%; vertical-align: top; text-align: center" class="photo-item border">
|
||||
<p style="margin: 0; font-size: 10px; text-align: center;">
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}"
|
||||
alt="{{ $imagePath }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
</td>
|
||||
@endisset
|
||||
@if (($index + 1) % 2 == 0)
|
||||
</tr>
|
||||
<tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@if (count($fotoTypes) % 2 != 0)
|
||||
<td style="width: 50%;"></td>
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="page-break"></div>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; text-align: center;">
|
||||
FOTO JAMINAN
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.foto-jaminan')
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@include('lpj::penilai.components.footer')
|
||||
@@ -15,10 +15,9 @@
|
||||
'jenis_aset' => 'Jenis properti',
|
||||
'hak_properti' => 'Status Hak Tanah',
|
||||
'address' => 'Alamat Lokasi',
|
||||
'harga_penawaran' => 'Harga Penawaran',
|
||||
'harga_diskon' => 'Indikasi Harga Transaksi',
|
||||
'harga' => 'Harga Penawaran',
|
||||
'total' => 'Indikasi Harga Transaksi',
|
||||
'telepon' => 'Penjual (HP)',
|
||||
'penawaran' => 'Ditawarkan Sejak',
|
||||
'luas_tanah' => 'Luas Tanah',
|
||||
'luas_bangunan' => 'Luas Bangunan',
|
||||
'tanggal' => 'Tanggal Data',
|
||||
@@ -40,8 +39,14 @@
|
||||
<td style="width: 62%;">
|
||||
@if ($key == 'luas_tanah' || $key == 'luas_bangunan')
|
||||
{{ $data[$key] ?? '-' }} m²
|
||||
@elseif($key == 'harga' || $key == 'harga_diskon')
|
||||
@elseif($key == 'harga' || $key == 'total')
|
||||
{{ formatRupiah($data[$key]) ?? 0 }}
|
||||
|
||||
@elseif($key == 'tanggal')
|
||||
{{ formatTanggalIndonesia($data[$key]) ?? '-' }}
|
||||
@elseif($key == 'telepon')
|
||||
{{ isset($data['telepon']) ? ubahNomorHp($data['telepon']) : '-' }}
|
||||
|
||||
@elseif($key == 'kordinat')
|
||||
@php
|
||||
$lat = $data['kordinat_lat'] ?? null;
|
||||
|
||||
@@ -1,32 +1,5 @@
|
||||
@include('lpj::penilai.components.header')
|
||||
@php
|
||||
$data = '';
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$teams = $permohonan->region->teams;
|
||||
|
||||
if ($teams) {
|
||||
foreach ($teams as $team) {
|
||||
$team_users = $team->teamsUsers;
|
||||
// print_r($team_users);
|
||||
if ($team_users) {
|
||||
foreach ($team_users as $team_user) {
|
||||
$user = $team_user->user;
|
||||
|
||||
if ($user && $user->hasRole('senior-officer')) {
|
||||
$senior_officer = $user;
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$data = rtrim($data, ', ');
|
||||
@endphp
|
||||
|
||||
<main class="content">
|
||||
<table style="width: 100%">
|
||||
@@ -62,69 +35,9 @@
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Legalitas</td>
|
||||
<td style="vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">
|
||||
<table style="margin: 0; padding: 0;">
|
||||
@if (isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<td style="padding: 0; margin: 0;">
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
@include('lpj::component.print-out-dokument')
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@if (isset($permohonan->documents))
|
||||
@foreach ($permohonan->documents as $document)
|
||||
@foreach ($document->detail as $detail)
|
||||
@if (isset($detail->details))
|
||||
@php
|
||||
$details = json_decode($detail->details, true);
|
||||
@endphp
|
||||
@if ($details)
|
||||
@foreach ($details as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
<td style="">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%">Terletak di</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
@@ -335,16 +248,6 @@
|
||||
<td>Resume ini sudah di setujui</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center">
|
||||
FOTO JAMINAN
|
||||
</h6>
|
||||
</div>
|
||||
@include('lpj::penilai.components.foto-jaminan')
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@include('lpj::penilai.components.footer')
|
||||
|
||||
@@ -66,9 +66,9 @@
|
||||
</div>
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()">
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
<span id="saveButtonText" >Save</span>
|
||||
<div class="spinner-border spinner-border-sm text-light" role="status" style="display: none;"
|
||||
id="saveButtonSpinner">
|
||||
|
||||
@@ -78,15 +78,15 @@
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
Lampiran Foto dan Dokumen
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}" class="btn btn-light"
|
||||
>
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
<div class="flex card-footer justify-end gap-5">
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" onclick="saveResume()">
|
||||
<button type="button" class="btn btn-primary" onclick="saveResume()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
Simpan</button>
|
||||
@endif
|
||||
@@ -432,7 +432,7 @@
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
Lampiran Foto dan Dokument
|
||||
Lampiran Foto dan Dokumen
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}"
|
||||
class="btn btn-light">
|
||||
|
||||
@@ -12,13 +12,15 @@
|
||||
Upload File Paparan
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('pembayaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
<a href="{{ route('penilai.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('penilai.storePaparan',['id'=> $permohonan->id]) }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
<input type="hidden" name="dokument_id" value="{{ request('document_id') }}">
|
||||
<input type="hidden" name="inspeksi_id" value="{{ request('inspeksi_id') }}">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
<span class="sort"> <span class="sort-label"> Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_laporan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Laporan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_survei">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Survei </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
@@ -161,25 +165,64 @@
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.tujuan_penilaian && data.tujuan_penilaian.name ? `${data.tujuan_penilaian.name}` : '-';
|
||||
return data.tujuan_penilaian && data.tujuan_penilaian.name ?
|
||||
`${data.tujuan_penilaian.name}` : '-';
|
||||
},
|
||||
},
|
||||
jenis_fasilitas_kredit_id: {
|
||||
title: 'Fasilitas Kredit',
|
||||
render: (item, data) => {
|
||||
return data.jenisfasilitas_kredit && data.jenisfasilitas_kredit.name ? `${data.jenisfasilitas_kredit.name}` : '-';
|
||||
return data.jenisfasilitas_kredit && data.jenisfasilitas_kredit.name ?
|
||||
`${data.jenisfasilitas_kredit.name}` : '-';
|
||||
},
|
||||
},
|
||||
jenis_laporan: {
|
||||
title: 'Jenis Laporan',
|
||||
render: (item, data) => {
|
||||
return data.penilai?.type;
|
||||
},
|
||||
},
|
||||
tanggal_survei: {
|
||||
title: 'Tanggal Survei',
|
||||
render: (item, data) => {
|
||||
return `${formatDate(new Date(data.created_at))}`;
|
||||
if (data.penilaian.waktu_penilaian) {
|
||||
return `${formatDate(new Date(data.penilaian.waktu_penilaian))}`;
|
||||
}
|
||||
return `${formatDate(new Date(data.penilaian.created_at))}`;
|
||||
},
|
||||
},
|
||||
due_date_sla: {
|
||||
title: 'Due Date SLA',
|
||||
render: (item, data) => {
|
||||
return `${formatDate(new Date(data.created_at))}`;
|
||||
const tujuan_penilaian = data.tujuan_penilaian.name;
|
||||
const tipe_laporan = data.penilai?.type;
|
||||
const nilai_plafond = data.penilaian.nilaiPlafond?.name;
|
||||
let waktu_penilaian = new Date(data.penilaian.created_at);
|
||||
if (data.penilaian.waktu_penilaian) {
|
||||
waktu_penilaian = new Date(data.penilaian.waktu_penilaian);
|
||||
}
|
||||
|
||||
if (tujuan_penilaian.name === "RAP") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
if (tipe_laporan === "sederhana") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 2);
|
||||
} else if (tipe_laporan === "standar") {
|
||||
if (nilai_plafond === "2 M - 5 M") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else if (nilai_plafond === "< 2M") {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 3);
|
||||
} else {
|
||||
waktu_penilaian.setDate(waktu_penilaian.getDate() + 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return formatDate(waktu_penilaian);
|
||||
|
||||
},
|
||||
},
|
||||
status: {
|
||||
@@ -191,16 +234,33 @@
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data.status === 'paparan' || data.status === 'proses-paparan' || data.status === 'paparan' || data.status == 'revisi-laporan' || data.status === 'done') {
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data
|
||||
.status === 'paparan' || data.status === 'proses-paparan' || data.status ===
|
||||
'paparan' || data.status == 'revisi-laporan' || data.status === 'done' || data
|
||||
.status === 'revisi-paparan' || data.status === 'unfreeze-sla') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a class="btn btn-sm btn-outline btn-info" href="penilai/${data.id}/show">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="penilai/${data.id}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-icon btn-clear btn-warning"
|
||||
onclick="surveyorFreeze('${data.id}', '${data.nomor_registrasi}', '${data.debiture?.name}')"
|
||||
title="Freeze SLA">
|
||||
<i class="ki-filled ki-arrow-circle-right"></i>
|
||||
</button>
|
||||
</div>`;
|
||||
} else {
|
||||
} else if (data.status === 'freeze' || data.status === 'request-freeze') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" onclick="showLoadingSwal('Masih dalam proses pengajuan freeze...')">
|
||||
<i class="ki-filled ki-watch"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
} else
|
||||
{
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-success" onclick="showLoadingSwal('Masih Menunggu proses inspeksi dari surveyor...')">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-success" onclick="showLoadingSwal('Masih Menunggu proses ...')">
|
||||
<i class="ki-filled ki-watch"></i>
|
||||
</a>
|
||||
</div>`
|
||||
@@ -221,6 +281,57 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function surveyorFreeze(permohonanId, noReg, debitur) {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: "Yakin akan Request Freeze dengan " + noReg + " untuk Debitur " + debitur +
|
||||
" ?",
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || ''; // Ambil pesan dari textarea
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/surveyor/storeFreeze/${permohonanId}`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
keterangan: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!',
|
||||
response.message,
|
||||
'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Freeze.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function showLoadingSwal(message, duration = 5000) {
|
||||
Swal.fire({
|
||||
title: message,
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
@include('lpj::component.detail-jaminan', [
|
||||
'backLink' => 'penilai.show',
|
||||
'id' => $permohonan->id,
|
||||
'title' => 'Lampiran foto dan dokument',
|
||||
'title' => 'Lampiran foto dan dokumen',
|
||||
])
|
||||
@endif
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
@@ -93,21 +92,24 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) ?? '' }}</p>
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->waktu_penilaian) ?? '' }}</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56 ">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span
|
||||
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
|
||||
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@if (!in_array(strtolower($permohonan->tujuanPenilaian->name), ['penilaian ulang', 'asuransi', 'lelang']))
|
||||
|
||||
<label class="form-label max-w-56 ">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span
|
||||
class="text-md font-bold {{ $permohonan->status_bayar === 'belum_bayar' ? 'text-red-600' : 'text-green-600' }} uppercase">
|
||||
{{ str_replace('_', ' ', $permohonan->status_bayar) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@@ -166,7 +168,7 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}</p>
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->updated_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -175,7 +177,12 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}</p>
|
||||
|
||||
@php
|
||||
$tglLaporan = getNomorLaporan($permohonan->id, $dokumen->id, 'tanggal_laporan');
|
||||
@endphp
|
||||
|
||||
{{ isset($tglLaporan) ? formatTanggalIndonesia($tglLaporan) : '-' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -190,17 +197,16 @@
|
||||
</div>
|
||||
|
||||
@if ($permohonan->status == 'revisi-laporan')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan Revisi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $permohonan->keterangan ?? '' }}
|
||||
</p>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan Revisi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $permohonan->keterangan ?? '' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -218,15 +224,16 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full card-footer mt-2 ">
|
||||
<div class="flex gap-5">
|
||||
<a class="btn btn-primary"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
|
||||
Lampiran Foto dan Dokument
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
|
||||
Lampiran Foto dan Dokumen
|
||||
</a>
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) != 'rap')
|
||||
<a class="btn btn-primary" data-modal-toggle="#modal_2">
|
||||
Kertas Kerja
|
||||
</a>
|
||||
@endif
|
||||
<a class="btn btn-primary" onclick="paparan({{ $permohonan->id }})">
|
||||
<a class="btn btn-primary"
|
||||
onclick="paparan({{ $permohonan->id }}, {{ $dokumen->id }}, {{ $inspeksiId }}, {{ $dokumen->jenis_jaminan_id }})">
|
||||
Paparan
|
||||
</a>
|
||||
|
||||
@@ -241,7 +248,7 @@
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) == 'rap')
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="rap('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="rap('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-message-programming">
|
||||
</i>
|
||||
@@ -257,7 +264,7 @@
|
||||
{{-- existing di --}}
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="memo('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="memo('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-badge">
|
||||
</i>
|
||||
@@ -271,7 +278,7 @@
|
||||
@if ($permohonan->status_bayar === 'belum_bayar')
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="resume('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="resume('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
@@ -287,7 +294,7 @@
|
||||
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{ $permohonan->status_bayar }}')">
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{ $permohonan->status_bayar }}')">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-setting-2"></i>
|
||||
</span>
|
||||
@@ -295,12 +302,9 @@
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
{{-- @if ($permohonan->penilaian->jenis_penilaian_id == 2 && $permohonan->tujuanPenilaian->id == 4) --}}
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
@@ -310,23 +314,71 @@
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- @if ($permohonan->penilaian->jenis_penilaian_id == 2 && $permohonan->tujuanPenilaian->id == 4) --}}
|
||||
|
||||
{{-- @endif --}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($permohonan->jenisPenilaian->name=="Eksternal")
|
||||
@if(isset($permohonan->laporanExternal->file_resume) || isset($permohonan->laporanExternal->file_laporan))
|
||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button class="dropdown-toggle btn btn-primary">
|
||||
Laporan Eksternal
|
||||
</button>
|
||||
<div class="dropdown-content w-full max-w-56 py-2 !ml-[200px] !mt-[-20px]">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
@if(isset($permohonan->laporanExternal->file_resume) && !empty($permohonan->laporanExternal->file_resume))
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" onclick="viewPDF('{{ Storage::url($permohonan->laporanExternal->file_resume) }}')">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-badge"></i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
Resume
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@if(isset($permohonan->laporanExternal->file_laporan) && !empty($permohonan->laporanExternal->file_laporan))
|
||||
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" onclick="viewPDF('{{ Storage::url($permohonan->laporanExternal->file_laporan) }}')">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-setting-2"></i>
|
||||
</span>
|
||||
<span class="menu-title">
|
||||
Laporan
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-5">
|
||||
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id]) }}"
|
||||
class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
|
||||
</a>
|
||||
|
||||
<a class="btn btn-outline btn-info "
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 1 )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 1 )">
|
||||
<i class="ki-filled ki-eye"></i>
|
||||
Lihat Laporan
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i>
|
||||
Cetak Laporan
|
||||
</a>
|
||||
@@ -336,16 +388,19 @@
|
||||
@endforeach
|
||||
<div class="flex justify-start gap-5">
|
||||
<a class="btn btn-success" onclick="savePenilai()">
|
||||
<i class="ki-filled ki-paper-plane"></i>
|
||||
REPORT
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="revisiSurveyor('{{ $permohonan->id }}', '{{$permohonan->debiture->name }}', '{{$permohonan->nomor_registrasi }}')">
|
||||
|
||||
<a class="btn btn-warning"
|
||||
{{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' ? 'disabled' : '' }}
|
||||
onclick="revisiSurveyor('{{ $permohonan->id }}', '{{ $permohonan->debiture->name }}', '{{ $permohonan->nomor_registrasi }}')">
|
||||
<i class="ki-filled ki-arrow-circle-right"></i>
|
||||
REVISI
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -394,20 +449,17 @@
|
||||
<div class="flex justify-center items-center gap-2">
|
||||
<input type="file" id="kertas_kerja" class="file-input">
|
||||
<button type="button" class="btn btn-outline btn-success"
|
||||
onclick="uploadKertasKerja({{ $permohonan->id }}, '{{ $documentId }}', '{{ $inspeksiId }}', '{{ $jenisJaminanId }}')">Upload</button>
|
||||
onclick="uploadKertasKerja({{ $permohonan->id }}, '{{ $documentId }}', '{{ $inspeksiId }}', '{{ $jenisJaminanId }}')">Upload
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class="form-group flex items-baseline flex-wrap">
|
||||
|
||||
@if ($jenisJaminanId)
|
||||
<a class="btn btn-outline btn-primary w-full"
|
||||
href="{{ route('penilai.export.kertas-kerja') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}">
|
||||
Export Kertas Kerja
|
||||
</a>
|
||||
@else
|
||||
<p class="text-red-500">Tidak ada dokumen yang memiliki jenis jaminan.</p>
|
||||
<div class="flex justify-between items-center">
|
||||
@if (isset($permohonan->penilai) && isset($permohonan->penilai->kertas_kerja) && $permohonan->penilai->kertas_kerja)
|
||||
<span data-modal-dismiss="true" class="btn btn-warning btn-outline"
|
||||
onclick="viewPDF('{{ Storage::url($permohonan->penilai->kertas_kerja) }}')"><i
|
||||
class="ki-filled ki-eye mr-2"></i>Lihat Kertas Kerja</span>
|
||||
@endif
|
||||
</div> --}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -417,6 +469,7 @@
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('lpj::component.pdfviewer')
|
||||
|
||||
<script>
|
||||
function seletSederhanaStandart(permohonanId, documentId, inspeksiId, jaminanId, fasilitasKredit, statusBayar) {
|
||||
@@ -433,16 +486,16 @@
|
||||
|
||||
} else {
|
||||
fetch(
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}`
|
||||
)
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}`
|
||||
)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.status) {
|
||||
// Jika status LPJ sudah ada, arahkan langsung ke halaman
|
||||
if (data.status === 'standard') {
|
||||
if (data.status === 'standar') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.standard', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
} else if (data.status === 'sederhana') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
@@ -472,7 +525,7 @@
|
||||
denyButtonColor: '#d33',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'standard',
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'standar',
|
||||
jaminanId);
|
||||
} else if (result.isDenied) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana',
|
||||
@@ -490,23 +543,23 @@
|
||||
|
||||
function saveStatusLpj(permohonanId, documentId, inspeksiId, type, jaminanId) {
|
||||
fetch(`{{ url('/penilai/save-status-lpj') }}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
type: type,
|
||||
}),
|
||||
}).then(response => response.json())
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
type: type,
|
||||
}),
|
||||
}).then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
if (type === 'standard') {
|
||||
if (type === 'standar') {
|
||||
window.location.href =
|
||||
`{{ route('penilai.standard', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
} else if (type === 'sederhana') {
|
||||
window.location.href =
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
@@ -537,12 +590,12 @@
|
||||
formData.append('kertas_kerja', kertasKerja);
|
||||
|
||||
fetch(`{{ url('/penilai/import/kertas-kerja') }}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||
},
|
||||
body: formData,
|
||||
})
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||
},
|
||||
body: formData,
|
||||
})
|
||||
.then(response => response.json()) // Pastikan respons diurai menjadi JSON
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
@@ -595,7 +648,7 @@
|
||||
}
|
||||
|
||||
|
||||
function paparan(permohonanId) {
|
||||
function paparan(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Kamu yakin ingin melakukan paparan',
|
||||
icon: 'warning',
|
||||
@@ -605,7 +658,8 @@
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = `/penilai/${permohonanId}/edit`;
|
||||
window.location.href =
|
||||
`/penilai/${permohonanId}/edit?document_id=${documentId}&inspeksi_id=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -625,14 +679,17 @@
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
// window.location.reload();
|
||||
hideLoadingSwal();
|
||||
toastrSuccessBuild(response.message);
|
||||
} else {
|
||||
// hideLoadingSwal();
|
||||
Swal.fire('Perhatian!', response.message, 'warning');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
error: function (xhr, status, error) {
|
||||
console.log('Error checking button status:', error, status, xhr);
|
||||
if (xhr.responseJSON.message) {
|
||||
// window.location.reload();
|
||||
@@ -650,52 +707,52 @@
|
||||
|
||||
function revisiSurveyor(dataId, debitur, noreg) {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan Revisi nomor registrasi ${noreg} atas nama debiture ${debitur} !`,
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan Revisi nomor registrasi ${noreg} atas nama debiture ${debitur} !`,
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || '';
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || '';
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/penilai/revisi-surveyor/${dataId}`,
|
||||
type: 'PUT',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', response.message , 'success').then(
|
||||
});
|
||||
$.ajax({
|
||||
url: `/penilai/revisi-surveyor/${dataId}`,
|
||||
type: 'PUT',
|
||||
data: {
|
||||
keterangan: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', response.message, 'success').then(
|
||||
() => {
|
||||
window.location.href =
|
||||
'{{ route('penilai.index') }}';
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
window.location.href =
|
||||
'{{ route('penilai.index') }}';
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
},
|
||||
},
|
||||
alasan: {
|
||||
keterangan: {
|
||||
title: 'Alasan',
|
||||
},
|
||||
request: {
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
@endif
|
||||
|
||||
|
||||
@if ($permohonan->authorization->approve_so && $dataHeader == 'paparan' )
|
||||
@if (isset($permohonan->authorization->approve_so) && $dataHeader == 'paparan' )
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
@@ -216,7 +216,7 @@
|
||||
</a>
|
||||
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $authorization->approve_so == null)
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $authorization->approve_so == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'SO')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
@@ -224,7 +224,7 @@
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) && $authorization->approve_eo == null)
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) && $authorization->approve_so && $authorization->approve_eo == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'EO')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
@@ -232,7 +232,7 @@
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_dd == null)
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
@@ -247,7 +247,7 @@
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const handleRejection = (dataId) => {
|
||||
const handleRejection = (dataId,dataHeader='') => {
|
||||
Swal.fire({
|
||||
title: 'Masukkan alasan penolakan:',
|
||||
input: 'textarea',
|
||||
@@ -267,8 +267,9 @@
|
||||
}).then((rejectResult) => {
|
||||
if (rejectResult.isConfirmed) {
|
||||
handleAjaxRequest(
|
||||
`/otorisator/revisi/${dataId}`, {
|
||||
message: rejectResult.value
|
||||
`/otorisator/revisi-laporan/${dataId}`, {
|
||||
keterangan: rejectResult.value,
|
||||
dataHeader: dataHeader
|
||||
},
|
||||
'Data berhasil ditolak.',
|
||||
'Terjadi kesalahan saat melakukan penolakan.'
|
||||
@@ -370,10 +371,10 @@
|
||||
).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const requestData = isPaparanSO ? {
|
||||
message: result.value.message,
|
||||
keterangan: result.value.message,
|
||||
tanggalPaparan: result.value.tanggalPaparan
|
||||
} : {
|
||||
message: result.value.message
|
||||
keterangan: result.value.message
|
||||
};
|
||||
|
||||
handleAjaxRequest(
|
||||
@@ -383,7 +384,7 @@
|
||||
'Terjadi kesalahan saat melakukan otorisasi.'
|
||||
);
|
||||
} else if (result.isDenied) {
|
||||
handleRejection(dataId);
|
||||
handleRejection(dataId,dataHeader);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@php
|
||||
if($header=="sla"){
|
||||
$header = "Freze SLA";
|
||||
if ($header == 'sla') {
|
||||
$header = 'Freze SLA';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@@ -20,55 +20,56 @@
|
||||
@include('lpj::component.detail-jaminan', ['backLink' => 'otorisator.' . $dataHeader . '.index'])
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Team
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Team
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
|
||||
@endphp
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@endphp
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $surveyor->userPenilaiTeam->name }}
|
||||
</p>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $surveyor->userPenilaiTeam->name }}
|
||||
</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">{{ checkRegionUserName($surveyor->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ checkRegionUserName($surveyor->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $penilai->userPenilaiTeam->name }}
|
||||
</p>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $penilai->userPenilaiTeam->name }}
|
||||
</p>
|
||||
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ checkRegionUserName($penilai->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ checkRegionUserName($penilai->userPenilaiTeam->id) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
@endphp
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
@endphp
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
@@ -78,7 +79,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body grid gap-5">
|
||||
{{ $authorization->alasan ?? ''}}
|
||||
{{ $authorization->keterangan ?? '' }}
|
||||
<table class="table table-border">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -87,11 +88,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alasan</td>
|
||||
<td>{{ $authorization->alasan }}</td>
|
||||
<td>{{ $authorization->keterangan }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tanggal Permohonan</td>
|
||||
<td>{{ formatTanggalIndonesia($authorization->created_at,1) }}</td>
|
||||
<td>{{ formatTanggalIndonesia($authorization->created_at, 1) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -99,12 +100,12 @@
|
||||
</div>
|
||||
|
||||
@php
|
||||
if($header=="SLA"){
|
||||
$header = "Freze SLA";
|
||||
if ($header == 'SLA') {
|
||||
$header = 'Freze SLA';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if($authorization->approve_so)
|
||||
@if ($authorization->approve_so)
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
@@ -118,21 +119,24 @@
|
||||
<tr>
|
||||
<td>Diperiksa Oleh</td>
|
||||
<td>{{ getUser($authorization->approve_so)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $authorization->approve_so_at ? formatTanggalIndonesia($authorization->approve_so_at,1) : 'N/A' }}</td>
|
||||
</tr>
|
||||
@if($authorization->approve_eo!=null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (EO)</td>
|
||||
<td>{{ getUser($authorization->approve_eo)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $authorization->approve_eo_at ? formatTanggalIndonesia($authorization->approve_eo_at,1) : 'N/A' }}</td>
|
||||
<td>{{ $authorization->approve_so_at ? formatTanggalIndonesia($authorization->approve_so_at, 1) : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
@if ($authorization->approve_eo != null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (EO)</td>
|
||||
<td>{{ getUser($authorization->approve_eo)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $authorization->approve_eo_at ? formatTanggalIndonesia($authorization->approve_eo_at, 1) : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if(in_array($authorization->nilai_eafond_id,[1,4]) && $authorization->approve_dd!=null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (DD)</td>
|
||||
<td>{{ getUser($authorization->approve_dd)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $authorization->approve_dd_at ? formatTanggalIndonesia($authorization->approve_dd_at,1) : 'N/A' }}</td>
|
||||
</tr>
|
||||
@if (in_array($authorization->nilai_eafond_id, [1, 4]) && $authorization->approve_dd != null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (DD)</td>
|
||||
<td>{{ getUser($authorization->approve_dd)->name ?? 'N/A' }}</td>
|
||||
<td>{{ $authorization->approve_dd_at ? formatTanggalIndonesia($authorization->approve_dd_at, 1) : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -141,99 +145,230 @@
|
||||
@endif
|
||||
<div>
|
||||
<div>
|
||||
<div class="flex gap-2.5">
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
$documentId = null;
|
||||
$jenisJaminanId = null;
|
||||
foreach ($permohonan->documents as $item) {
|
||||
foreach ($item->inspeksi as $key => $value) {
|
||||
$inspeksiId = $item->id;
|
||||
<div class="flex gap-2.5">
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
$documentId = null;
|
||||
$jenisJaminanId = null;
|
||||
foreach ($permohonan->documents as $item) {
|
||||
foreach ($item->inspeksi as $key => $value) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
$documentId = $item->id;
|
||||
$jenisJaminanId = $item->jenis_jaminan_id;
|
||||
}
|
||||
$documentId = $item->id;
|
||||
$jenisJaminanId = $item->jenis_jaminan_id;
|
||||
}
|
||||
@endphp
|
||||
@endphp
|
||||
|
||||
@if ($dataHeader == 'pelaporan')
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{true}}">
|
||||
Lihat Laporan
|
||||
</a>
|
||||
@endif
|
||||
@if ($dataHeader == 'pelaporan')
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat Laporan
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','senior-officer']) && $authorization->approve_so==null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $authorization->approve_so == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }}, 'SO')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','EO Appraisal']) && $authorization->approve_so && $authorization->approve_eo==null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) &&
|
||||
$authorization->approve_so &&
|
||||
$authorization->approve_eo == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }}, 'EO')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator','DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd==null && in_array($permohonan->nilai_plafond_id,[1,4]))
|
||||
<button onclick="otorisatorData({{ $authorization->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
||||
$authorization->approve_eo &&
|
||||
$authorization->approve_dd == null &&
|
||||
in_array($permohonan->nilai_plafond_id, [1, 4]))
|
||||
<button onclick="otorisatorData({{ $authorization->id }}, 'DD')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (
|
||||
(Auth::user()->hasAnyRole(['administrator', 'senior-officer']) &&
|
||||
$authorization->approve_so != null &&
|
||||
$authorization->approve_eo != null) ||
|
||||
$authorization->approve_dd != null
|
||||
)
|
||||
@php
|
||||
$memoDeviasiExists = false;
|
||||
if ($authorization->permohonan && $authorization->permohonan->lampiranDokumen) {
|
||||
$memoDeviasiExists = $authorization->permohonan->lampiranDokumen()
|
||||
->whereHas('jenisLampiran', function($query) {
|
||||
$query->where('nama', 'memo-deviasi');
|
||||
})
|
||||
->exists();
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if ($memoDeviasiExists)
|
||||
<button onclick="otorisatorData({{ $authorization->id }}, 'UNFREZE')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisasi Un{{ $header ?? '' }}
|
||||
</button>
|
||||
@else
|
||||
<span class="badge badge-warning">
|
||||
Memo Deviasi Belum Ada
|
||||
</span>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
function otorisatorData(dataId) {
|
||||
const dataHeader = @json($header);
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan otorisator ${dataHeader}!`,
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || ''; // Ambil pesan dari textarea
|
||||
@push('scripts')
|
||||
<script>
|
||||
const handleRejection = (dataId, dataHeader = '') => {
|
||||
Swal.fire({
|
||||
title: 'Masukkan alasan penolakan:',
|
||||
input: 'textarea',
|
||||
inputPlaceholder: 'Tuliskan alasan...',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#f39c12',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Kirim',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: (alasan) => {
|
||||
if (!alasan) {
|
||||
Swal.showValidationMessage('Alasan harus diisi!');
|
||||
return false;
|
||||
}
|
||||
return alasan;
|
||||
}
|
||||
}).then((rejectResult) => {
|
||||
if (rejectResult.isConfirmed) {
|
||||
handleAjaxRequest(
|
||||
`/otorisator/revisi-laporan/${dataId}`, {
|
||||
keterangan: rejectResult.value,
|
||||
dataHeader: dataHeader
|
||||
},
|
||||
'Data berhasil ditolak.',
|
||||
'Terjadi kesalahan saat melakukan penolakan.'
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const showSwalConfirmation = (
|
||||
title, text, html, confirmText, denyText, cancelText, preConfirm, icon = 'question'
|
||||
) => {
|
||||
return Swal.fire({
|
||||
title: title,
|
||||
text: text,
|
||||
html: html,
|
||||
icon: icon,
|
||||
focusConfirm: false,
|
||||
preConfirm: preConfirm,
|
||||
showCancelButton: true,
|
||||
showDenyButton: !!denyText,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
denyButtonColor: '#f39c12',
|
||||
confirmButtonText: confirmText,
|
||||
denyButtonText: denyText,
|
||||
cancelButtonText: cancelText,
|
||||
});
|
||||
};
|
||||
|
||||
const handleAjaxRequest = (url, data, successMessage, errorMessage) => {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/otorisator/${dataId}/SLA`,
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', 'Data berhasil diotorisasi. Menunggu Approval EO dan atau DD', 'success').then(() => {
|
||||
window.location.reload();
|
||||
data: data,
|
||||
success: () => {
|
||||
Swal.fire('Berhasil!', successMessage, 'success').then(() => {
|
||||
const redirectUrl = `/otorisator/sla`;
|
||||
window.location.href = redirectUrl;
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
Swal.fire('Gagal!', errorMessage, 'error');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function otorisatorData(dataId, role = '') {
|
||||
let dataHeader = @json($header);
|
||||
|
||||
// Update dataHeader if condition matches
|
||||
if (dataHeader === 'Freze SLA' && (role === 'UNFREZE' || role === 'FREZE')) {
|
||||
dataHeader = 'Unfreeze SLA';
|
||||
}
|
||||
|
||||
const isPaparanSO = dataHeader === 'Unfreeze SLA' && role === 'UNFREZE';
|
||||
const hideDenyButton = (dataHeader === 'Unfreeze SLA' && (role === 'UNFREZE' || role === 'FREZE'));
|
||||
|
||||
const swalHtml = isPaparanSO ? `
|
||||
<div class="text-left space-y-4">
|
||||
<p class="text-gray-700 text-center">Untuk melakukan otorisasi ${dataHeader}!</p>
|
||||
<div>
|
||||
<textarea id="swal-keterangan" class="textarea" placeholder="Masukkan Keterangan"></textarea>
|
||||
</div>
|
||||
</div>` : '';
|
||||
|
||||
showSwalConfirmation(
|
||||
'Apakah Anda yakin?',
|
||||
`Untuk melakukan otorisasi ${dataHeader}!`,
|
||||
swalHtml,
|
||||
'Ya, Lanjutkan!',
|
||||
hideDenyButton ? null : 'Tolak',
|
||||
'Batal',
|
||||
() => {
|
||||
if (isPaparanSO) {
|
||||
const message = document.getElementById('swal-keterangan')?.value;
|
||||
|
||||
if (!message) {
|
||||
Swal.showValidationMessage('Keterangan harus diisi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
message,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
message: 'Ya, lanjutkan.'
|
||||
};
|
||||
}
|
||||
},
|
||||
'question'
|
||||
).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const requestData = isPaparanSO ? {
|
||||
keterangan: result.value.message,
|
||||
} : {
|
||||
keterangan: result.value.message
|
||||
};
|
||||
|
||||
handleAjaxRequest(
|
||||
`/otorisator/otorisator/${dataId}/${dataHeader}`,
|
||||
requestData,
|
||||
'Data berhasil diotorisasi.',
|
||||
'Terjadi kesalahan saat melakukan otorisasi.'
|
||||
);
|
||||
} else if (!hideDenyButton && result.isDenied) {
|
||||
handleRejection(dataId, dataHeader);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
title: 'Tanggal Paparan',
|
||||
render: (item, data) => {
|
||||
if(data.tanggal_paparan) {
|
||||
return ` ${data?.keterangan} | ${window.formatTanggalIndonesia(data.tanggal_paparan)}`;
|
||||
return ` ${data?.authorization?.keterangan_so} | ${window.formatTanggalIndonesia(data.tanggal_paparan)}`;
|
||||
}
|
||||
|
||||
return "-";
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.debiture.name}`;
|
||||
return `${data.debiture?.name}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
|
||||
@@ -5,172 +5,31 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if(isset($permohonan))
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
<a href="{{ route('permohonan.edit',array_merge(request()->query(),['permohonan'=>$permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('permohonan.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Permohonan</a>
|
||||
<a href="{{ route('debitur.edit',array_merge(request()->query(),['debitur'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Debitur</a>
|
||||
<a href="{{ route('debitur.jaminan.index',array_merge(request()->query(),['id'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.jaminan.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Dokumen Jaminan</a>
|
||||
<a href="{{ route('debitur.pemilik.index',array_merge(request()->query(),['id'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.pemilik.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Pemilk Jaminan</a>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
@if(isset($debitur->id) && !isset($permohonan->id))
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat Permohonan </a>
|
||||
@endif
|
||||
|
||||
@if(request()->get('from') == 'permohonan')
|
||||
<a href="{{ route('permohonan.create') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@elseif($permohonan->id)
|
||||
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@else
|
||||
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
@if(isset($permohonan->id))
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
<a href="{{ route('permohonan.edit',array_merge(request()->query(),['permohonan'=>$permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('permohonan.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Permohonan</a>
|
||||
<a href="{{ route('debitur.edit',array_merge(request()->query(),['debitur'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Debitur</a>
|
||||
<a href="{{ route('debitur.jaminan.index',array_merge(request()->query(),['id'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.jaminan.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Dokumen Jaminan</a>
|
||||
<a href="{{ route('debitur.pemilik.index',array_merge(request()->query(),['id'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.pemilik.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Pemilk Jaminan</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(request()->routeIs('permohonan.edit', $permohonan))
|
||||
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@if(isset($permohonan->id))
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $permohonan->id }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="flex items-center gap-2">
|
||||
@if(isset($debitur->id) && !isset($permohonan->id))
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat Permohonan </a>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="hidden" name="debiture_id" value="{{ $debitur->id }}">
|
||||
<p class="text-base text-bold">{{ $debitur->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('tujuan_penilaian_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<option value="">Pilih Tujuan Penilaian</option>
|
||||
@if(isset($tujuanPenilaian))
|
||||
@foreach($tujuanPenilaian as $row)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('tujuan_penilaian_id') == $row->id) || (isset($permohonan) && $permohonan->tujuan_penilaian_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('tujuan_penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Fasilitas Kredit
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('jenis_fasilitas_kredit_id') border-danger bg-danger-light @enderror" name="jenis_fasilitas_kredit_id" id="jenis_fasilitas_kredit_id">
|
||||
<option value="">Pilih Fasilitas Kredit</option>
|
||||
@if(isset($fasilitasKredit))
|
||||
@foreach($fasilitasKredit as $row)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('jenis_fasilitas_kredit_id') == $row->id) || (isset($permohonan) && $permohonan->jenis_fasilitas_kredit_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('jenis_fasilitas_kredit_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nilai Plafond
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
|
||||
<option value="">Pilih Nilai Plafond</option>
|
||||
@if(isset($plafond))
|
||||
@foreach($plafond as $row)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('nilai_plafond_id') == $row->id) || (isset($permohonan) && $permohonan->nilai_plafond_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('nilai_plafond_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nilai NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror"
|
||||
type="text"
|
||||
name="nilai_njop"
|
||||
value="{{ old('nilai_njop', $permohonan->nilai_njop ?? '') }}">
|
||||
@error('nilai_njop')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($permohonan->status=='revisi')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
Catatan : <br>
|
||||
<em class="text-red-500">{{ $permohonan->keterangan }}</em>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ $permohonan->status=='revisi' ? 'Submit Ulang' : 'Save' }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@elseif(request()->routeIs('debitur.edit', $debitur))
|
||||
@include('lpj::debitur.components.debitur')
|
||||
@elseif(request()->routeIs('debitur.pemilik.index', $debitur))
|
||||
@include('lpj::debitur.components.pemilik')
|
||||
@if(request()->get('from') == 'permohonan')
|
||||
<a href="{{ route('permohonan.create') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@elseif($permohonan->id)
|
||||
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@else
|
||||
@include('lpj::debitur.components.jaminan')
|
||||
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
@else
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($permohonan->id) ? 'Edit' : 'Tambah' }} Permohonan
|
||||
@@ -179,129 +38,121 @@
|
||||
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@if(isset($permohonan->id))
|
||||
@method('PUT')
|
||||
@endif
|
||||
@csrf
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Debitur
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="hidden" name="debiture_id" value="{{ $debitur->id }}">
|
||||
<p class="text-base text-bold">{{ $debitur->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@if(isset($permohonan->id))
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $permohonan->id }}">
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian
|
||||
</label>
|
||||
<input type="hidden" name="debiture_id" value="{{ $debitur->id }}">
|
||||
|
||||
@php
|
||||
$formFields = [
|
||||
'tujuan_penilaian_id' => ['label' => 'Tujuan Penilaian', 'type' => 'select', 'options' => $tujuanPenilaian],
|
||||
'jenis_fasilitas_kredit_id' => ['label' => 'Fasilitas Kredit', 'type' => 'select', 'options' => $fasilitasKredit],
|
||||
'nilai_plafond_id' => ['label' => 'Nilai Plafond', 'type' => 'select', 'options' => $plafond],
|
||||
'status_bayar' => ['label' => 'Status Bayar', 'type' => 'select', 'options' => [
|
||||
'sudah_bayar' => 'Sudah Bayar',
|
||||
'belum_bayar' => 'Belum Bayar'
|
||||
]],
|
||||
'nilai_njop' => ['label' => 'Nilai NJOP', 'type' => 'text'],
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach($formFields as $field => $config)
|
||||
<div id="{{ $field }}_wrapper" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $config['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('tujuan_penilaian_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<option value="">Pilih Tujuan Penilaian</option>
|
||||
@if(isset($tujuanPenilaian))
|
||||
@foreach($tujuanPenilaian as $row)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('tujuan_penilaian_id') == $row->id) || (isset($permohonan) && $permohonan->tujuan_penilaian_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
@if($config['type'] === 'select')
|
||||
<select class="input {{ $field != 'status_bayar' ? 'tomselect' : '' }} w-full @error($field) border-danger bg-danger-light @enderror" name="{{ $field }}" id="{{ $field }}">
|
||||
<option value="">Pilih {{ $config['label'] }}</option>
|
||||
@foreach($config['options'] as $key => $value)
|
||||
<option value="{{ $value->id ?? $key }}"
|
||||
{{ (old($field) == ($value->id ?? $key)) || (isset($permohonan) && $permohonan->$field == ($value->id ?? $key)) ? 'selected' : '' }}>
|
||||
{{ $value->name ?? $value }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('tujuan_penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
</select>
|
||||
@else
|
||||
<input class="input @error($field) border-danger bg-danger-light @enderror"
|
||||
type="{{ $config['type'] }}"
|
||||
name="{{ $field }}"
|
||||
value="{{ old($field, $permohonan->$field ?? '') }}">
|
||||
@endif
|
||||
@error($field)
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@if(isset($permohonan) && $permohonan->status == 'revisi')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Fasilitas Kredit
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('jenis_fasilitas_kredit_id') border-danger bg-danger-light @enderror" name="jenis_fasilitas_kredit_id" id="jenis_fasilitas_kredit_id">
|
||||
<option value="">Pilih Fasilitas Kredit</option>
|
||||
@if(isset($fasilitasKredit))
|
||||
@foreach($fasilitasKredit as $row)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('jenis_fasilitas_kredit_id') == $row->id) || (isset($permohonan) && $permohonan->jenis_fasilitas_kredit_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('jenis_fasilitas_kredit_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
Catatan : <br>
|
||||
<em class="text-red-500">{{ $permohonan->keterangan }} {{ $permohonan->registrasi_catatan }}</em>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nilai Plafond
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
|
||||
<option value="">Pilih Nilai Plafond</option>
|
||||
@if(isset($plafond))
|
||||
@foreach($plafond as $row)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('nilai_plafond_id') == $row->id) || (isset($permohonan) && $permohonan->nilai_plafond_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('nilai_plafond_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Status Bayar
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nilai NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror"
|
||||
type="text"
|
||||
name="nilai_njop"
|
||||
value="{{ old('nilai_njop', $permohonan->nilai_njop ?? '') }}">
|
||||
@error('nilai_njop')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ isset($permohonan) && $permohonan->status == 'revisi' ? 'Submit Ulang' : 'Save' }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const tujuanPenilaianSelect = document.getElementById('tujuan_penilaian_id');
|
||||
const nilaiPlafondSelect = document.getElementById('nilai_plafond_id');
|
||||
const statusBayarSelect = document.getElementById('status_bayar');
|
||||
const statusBayarWrapper = document.getElementById('status_bayar_wrapper');
|
||||
|
||||
// Initialize TomSelect
|
||||
const statusBayarTomSelect = new window.TomSelect(statusBayarSelect, {
|
||||
create: false,
|
||||
sortField: {
|
||||
field: "text",
|
||||
direction: "asc"
|
||||
}
|
||||
});
|
||||
|
||||
function updateStatusBayar() {
|
||||
const tujuanPenilaianValue = tujuanPenilaianSelect.value;
|
||||
const nilaiPlafondValue = nilaiPlafondSelect.value;
|
||||
console.log('Tujuan Penilaian:', tujuanPenilaianValue, 'Nilai Plafond:', nilaiPlafondValue);
|
||||
|
||||
if (tujuanPenilaianValue === '2' && (nilaiPlafondValue === '2' || nilaiPlafondValue === '3')) {
|
||||
statusBayarTomSelect.setValue('sudah_bayar');
|
||||
statusBayarWrapper.style.display = 'none';
|
||||
} else {
|
||||
@if(isset($permohonan))
|
||||
statusBayarTomSelect.setValue('{{$permohonan->status_bayar ?? ''}}');
|
||||
@else
|
||||
statusBayarTomSelect.setValue('');
|
||||
@endif
|
||||
statusBayarWrapper.style.display = 'flex';
|
||||
}
|
||||
console.log('Status Bayar:', statusBayarTomSelect.getValue());
|
||||
}
|
||||
|
||||
if (tujuanPenilaianSelect && nilaiPlafondSelect && statusBayarSelect) {
|
||||
tujuanPenilaianSelect.addEventListener('change', updateStatusBayar);
|
||||
nilaiPlafondSelect.addEventListener('change', updateStatusBayar);
|
||||
|
||||
// Call the function when the page loads to set the initial status
|
||||
updateStatusBayar();
|
||||
} else {
|
||||
console.error('One or more required elements not found');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -197,7 +197,17 @@
|
||||
}
|
||||
},
|
||||
keterangan: {
|
||||
title: 'Keterangan'
|
||||
title: 'Keterangan',
|
||||
render : (item, data) => {
|
||||
|
||||
let keterangan = data.keterangan ?? ""
|
||||
if(data.registrasi_catatan){
|
||||
if(keterangan) keterangan += "\n";
|
||||
keterangan += data.registrasi_catatan;
|
||||
}
|
||||
|
||||
return keterangan
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
title: 'Actions',
|
||||
@@ -206,22 +216,32 @@
|
||||
|
||||
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
|
||||
actionHtml += `
|
||||
<a onclick="surveyorRescheduleJadwalSurvey(
|
||||
${data.id},
|
||||
${data.penilaian.id},
|
||||
'${data.nomor_registrasi}',
|
||||
'${data.debiture?.name}',
|
||||
'${data.penilaian.waktu_penilaian}',
|
||||
${JSON.stringify(data.penilaian.rejected_note)}
|
||||
)" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey">
|
||||
<i class="ki-filled ki-calendar-remove"></i>
|
||||
</a>`;
|
||||
<a
|
||||
title="Reschedule Jadwal Survey"
|
||||
data-permohonan-id="${data.id}"
|
||||
data-id-penilaian="${data.penilaian.id}"
|
||||
data-no-reg="${data.nomor_registrasi}"
|
||||
data-debitur="${data.debiture ? data.debiture.name.replace(/'/g, "\\'") : ""}"
|
||||
data-waktu-penilaian="${data.penilaian.waktu_penilaian}"
|
||||
data-rejected-note="${data.penilaian.rejected_note ? JSON.stringify(data.penilaian.rejected_note).replace(/'/g, "\\'").replace(/"/g, '"') : '{}'}"
|
||||
onclick="surveyorRescheduleJadwalSurvey(this)"
|
||||
class="delete btn btn-sm btn-outline btn-light">
|
||||
<i class="ki-filled ki-calendar-remove"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if (data && data.penilaian && data.penilaian.waktu_penilaian !== null && data.status !==
|
||||
'done' && data.penilaian.authorized_status == null || data.status === 'approved-reschedule') {
|
||||
'done' && data.penilaian.authorized_status == null || data.status ===
|
||||
'approved-reschedule') {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-outline btn-primary" href="javascript:void(0)" onclick="surveyorApproveKunjungan(${data.id},${data.penilaian.id},'${data.nomor_registrasi}', '${data.debiture?.name}', '${data.penilaian.waktu_penilaian}')" title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}" >
|
||||
<a class="btn btn-sm btn-outline btn-primary"
|
||||
title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
data-permohonan-id="${data.id}"
|
||||
data-id-penilaian="${data.penilaian.id}"
|
||||
data-no-reg="${data.nomor_registrasi}"
|
||||
data-debitur="${data.debiture ? data.debiture.name.replace(/'/g, "\\'") : ""}"
|
||||
data-waktu-penilaian="${data.penilaian.waktu_penilaian}"
|
||||
onclick="surveyorApproveKunjungan(this)" >
|
||||
<i class="ki-filled ki-calendar-edit"></i>
|
||||
</a>
|
||||
`;
|
||||
@@ -265,16 +285,26 @@
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function surveyorApproveKunjungan(permohonanId, idPenilaian, noReg, debitur, waktuPenilaian) {
|
||||
function surveyorApproveKunjungan(element) {
|
||||
const permohonanId = element.getAttribute('data-permohonan-id');
|
||||
const idPenilaian = element.getAttribute('data-id-penilaian');
|
||||
const noReg = element.getAttribute('data-no-reg');
|
||||
const debitur = element.getAttribute('data-debitur');
|
||||
const waktuPenilaian = element.getAttribute('data-waktu-penilaian');
|
||||
|
||||
Swal.fire({
|
||||
title: ' ',
|
||||
text: "Yakin akan Menyetujui Jadwal Kunjungan " + noReg + " untuk Debitur " + debitur +
|
||||
" pada waktu " + window.formatTanggalWaktuIndonesia(waktuPenilaian) + "?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Yes',
|
||||
cancelButtonText: 'Cancel',
|
||||
showDenyButton: true,
|
||||
denyButtonText: 'Reschedule',
|
||||
confirmButtonColor: '#3085d6',
|
||||
denyButtonColor: '#f4b400',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
//define variable
|
||||
@@ -312,18 +342,11 @@
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
function surveyorRescheduleJadwalSurvey(permohonanId, idPenilaian, noReg, debitur, waktuPenilaian, rejectedNote) {
|
||||
rejectedNote = JSON.parse(rejectedNote);
|
||||
Swal.fire({
|
||||
title: 'Reschedule Jadwal Kunjungan',
|
||||
html: `
|
||||
<div class="text-left space-y-4">
|
||||
} else if (result.isDenied) {
|
||||
Swal.fire({
|
||||
title: 'Reschedule Jadwal Kunjungan',
|
||||
html: `
|
||||
<div class="text-left space-y-4">
|
||||
|
||||
<p class="text-gray-700">
|
||||
Yakin akan Reschedule Jadwal Kunjungan
|
||||
@@ -347,64 +370,182 @@
|
||||
placeholder="Masukkan alasan reschedule..."></textarea>
|
||||
</div>
|
||||
|
||||
${rejectedNote && rejectedNote.trim() ? `
|
||||
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${rejectedNote}</p>
|
||||
` : ''}
|
||||
|
||||
</div>
|
||||
`,
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Reschedule',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: () => {
|
||||
const rescheduleDate = document.getElementById('reschedule_date').value;
|
||||
const rescheduleNote = document.getElementById('reschedule_note').value;
|
||||
|
||||
if (!rescheduleDate || !rescheduleNote) {
|
||||
Swal.showValidationMessage('Semua input wajib diisi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return {
|
||||
rescheduleDate,
|
||||
rescheduleNote
|
||||
};
|
||||
}
|
||||
}).then((rescheduleResult) => {
|
||||
if (rescheduleResult.isConfirmed) {
|
||||
const {
|
||||
rescheduleDate,
|
||||
rescheduleNote
|
||||
} = rescheduleResult.value;
|
||||
|
||||
const data = {
|
||||
_token: "{{ csrf_token() }}",
|
||||
penilaian_id: idPenilaian,
|
||||
nomor_registrasi: noReg,
|
||||
permohonan_id: permohonanId,
|
||||
reschedule_date: rescheduleDate,
|
||||
reschedule_note: rescheduleNote,
|
||||
keterangan: rescheduleNote
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: `{{ URL::to('/permohonan/store-reschedule-survey') }}/${idPenilaian}`,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses Reschedule!', response.message,
|
||||
'success').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
function surveyorRescheduleJadwalSurvey(element) {
|
||||
const permohonanId = element.getAttribute('data-permohonan-id');
|
||||
const idPenilaian = element.getAttribute('data-id-penilaian');
|
||||
const noReg = element.getAttribute('data-no-reg');
|
||||
const debitur = element.getAttribute('data-debitur');
|
||||
const waktuPenilaian = element.getAttribute('data-waktu-penilaian');
|
||||
let rejectedNote = element.getAttribute('data-rejected-note');
|
||||
try {
|
||||
rejectedNote = rejectedNote ? JSON.parse(rejectedNote) : null;
|
||||
} catch (e) {
|
||||
console.warn('Failed to parse rejectedNote:', e);
|
||||
rejectedNote = null;
|
||||
}
|
||||
const note = rejectedNote && typeof rejectedNote === 'string' && rejectedNote.trim() ? String(rejectedNote)
|
||||
.trim() : '';
|
||||
|
||||
Swal.fire({
|
||||
title: 'Reschedule Jadwal Kunjungan',
|
||||
html: `
|
||||
<div class="text-left space-y-4">
|
||||
|
||||
<p class="text-gray-700">
|
||||
Yakin akan Reschedule Jadwal Kunjungan
|
||||
<span class="font-semibold text-blue-600">${noReg}</span>
|
||||
untuk Debitur
|
||||
<span class="font-semibold text-blue-600">${debitur}</span>
|
||||
pada waktu
|
||||
<span class="font-semibold">${window.formatTanggalWaktuIndonesia(waktuPenilaian)}</span>?
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<label for="reschedule_date" class="block text-sm font-medium text-gray-700 mb-1">Tanggal Baru</label>
|
||||
<input type="datetime-local" id="reschedule_date"
|
||||
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="reschedule_note" class="block text-sm font-medium text-gray-700 mb-1">Catatan</label>
|
||||
<textarea id="reschedule_note"
|
||||
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
||||
placeholder="Masukkan alasan reschedule..."></textarea>
|
||||
</div>
|
||||
${note ? `
|
||||
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${note}</p>
|
||||
` : ''}
|
||||
|
||||
</div>
|
||||
`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Reschedule',
|
||||
preConfirm: () => {
|
||||
const rescheduleDate = document.getElementById('reschedule_date').value;
|
||||
const rescheduleNote = document.getElementById('reschedule_note').value;
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Reschedule',
|
||||
preConfirm: () => {
|
||||
const rescheduleDate = document.getElementById('reschedule_date').value;
|
||||
const rescheduleNote = document.getElementById('reschedule_note').value;
|
||||
|
||||
if (!rescheduleDate || !rescheduleNote) {
|
||||
Swal.showValidationMessage('Semua inputan wajib diisi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return { rescheduleDate, rescheduleNote };
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const { rescheduleDate, rescheduleNote } = result.value;
|
||||
|
||||
// Data to send
|
||||
const data = {
|
||||
_token: "{{ csrf_token() }}",
|
||||
penilaian_id: idPenilaian,
|
||||
nomor_registrasi: noReg,
|
||||
permohonan_id: permohonanId,
|
||||
reschedule_date: rescheduleDate,
|
||||
reschedule_note: rescheduleNote
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: `{{ URL::to('/permohonan/store-reschedule-survey') }}/${idPenilaian}`,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses Reschedule!', response.message, 'success').then(() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
if (!rescheduleDate || !rescheduleNote) {
|
||||
Swal.showValidationMessage('Semua inputan wajib diisi!');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function(response) {
|
||||
const errorMessage = response.responseJSON?.message || 'Terjadi kesalahan saat memproses data.';
|
||||
Swal.fire('Error!', errorMessage, 'error');
|
||||
|
||||
return {
|
||||
rescheduleDate,
|
||||
rescheduleNote
|
||||
};
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const {
|
||||
rescheduleDate,
|
||||
rescheduleNote
|
||||
} = result.value;
|
||||
|
||||
// Data to send
|
||||
const data = {
|
||||
_token: "{{ csrf_token() }}",
|
||||
penilaian_id: idPenilaian,
|
||||
nomor_registrasi: noReg,
|
||||
permohonan_id: permohonanId,
|
||||
reschedule_date: rescheduleDate,
|
||||
reschedule_note: rescheduleNote,
|
||||
keterangan: rescheduleNote
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: `{{ URL::to('/permohonan/store-reschedule-survey') }}/${idPenilaian}`,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
|
||||
() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(response) {
|
||||
const errorMessage = response.responseJSON?.message ||
|
||||
'Terjadi kesalahan saat memproses data.';
|
||||
Swal.fire('Error!', errorMessage, 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// window.formatTanggalIndonesia(date)
|
||||
|
||||
@@ -1,212 +1,155 @@
|
||||
@extends('layouts.auth')
|
||||
|
||||
@push('styles')
|
||||
<style>
|
||||
@media print {
|
||||
body {
|
||||
font-size: 10pt;
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.crd {
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.crd-header {
|
||||
background-color: #f1f1f1 !important;
|
||||
-webkit-print-color-adjust: exact;
|
||||
padding: 3px 8px !important; /* Mengubah padding menjadi lebih tipis */
|
||||
font-weight: bold;
|
||||
font-size: 11pt; /* Sedikit memperkecil ukuran font */
|
||||
}
|
||||
|
||||
.crd-body {
|
||||
padding: 8px !important; /* Menyesuaikan padding body agar seimbang */
|
||||
}
|
||||
.no-print {
|
||||
display: none !important;
|
||||
}
|
||||
.page-break {
|
||||
page-break-before: always;
|
||||
}
|
||||
h1 {
|
||||
font-size: 16pt;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
h3 {
|
||||
font-size: 12pt;
|
||||
margin: 0;
|
||||
}
|
||||
h4 {
|
||||
font-size: 11pt;
|
||||
margin: 10px 0 5px;
|
||||
}
|
||||
p {
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
.grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.col-1 {
|
||||
flex: 0 0 33.333%;
|
||||
max-width: 33.333%;
|
||||
}
|
||||
.col-2 {
|
||||
flex: 0 0 66.666%;
|
||||
max-width: 66.666%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="w-full gap-5 mx-auto" id="printtable">
|
||||
<div class="gap-5 w-full">
|
||||
<div class="card">
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-2">
|
||||
<div>
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900 w-1/2">
|
||||
Nomor Register Permohonan
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900 w-1/2">
|
||||
: {{ $permohonan->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="container" id="printtable">
|
||||
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900 w-1/2">
|
||||
Pemohon
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900 w-1/2">
|
||||
: {{ $permohonan->user->nik }} | {{ $permohonan->user->name }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="crd">
|
||||
<div class="crd-body">
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="width: 40%; vertical-align: top; padding-right: 10px;">
|
||||
@include('lpj::component.logo-bag')
|
||||
</td>
|
||||
<td style="width: 60%; vertical-align: top; text-align: right;">
|
||||
<h1 style="font-size: 12pt; margin: 0; font-weight: bold;">PT BANK ARTHA GRAHA INTERNASIONAL</h1>
|
||||
<p style="font-size: 10pt; margin:0;">Sub Direktorat Appraisal</p>
|
||||
<p style="font-size: 10pt; margin: 0;">Jl. Kwitang Raya No. 24-26,<br>Jakarta – 10420, Indonesia</p>
|
||||
<p style="font-size: 10pt; margin: 0;">Telp. (021) 3903040</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900 w-1/2">
|
||||
Tujan Permohonan
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900 w-1/2">
|
||||
: {{ $permohonan->tujuanPenilaian->name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900 w-1/2">
|
||||
Status Permohonan
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900 w-1/2">
|
||||
: {{ ucwords($permohonan->status) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900 w-1/2">
|
||||
Cabang Pemohon
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900 w-1/2">
|
||||
: {{ $permohonan->user->branch->name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900 w-1/2">
|
||||
Tanggal Permohonan
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900 w-1/2">
|
||||
: {{ formatTanggalIndonesia($permohonan->created_at) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="crd">
|
||||
<div class="crd-body">
|
||||
<div class="grid">
|
||||
<div class="col-1">
|
||||
<p><strong>Nomor Register:</strong> {{ $permohonan->nomor_registrasi }}</p>
|
||||
<p><strong>Pemohon:</strong> {{ $permohonan->user->nik }} | {{ $permohonan->user->name }}</p>
|
||||
<p><strong>Tujuan Permohonan:</strong> {{ $permohonan->tujuanPenilaian->name }}</p>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<p><strong>Status Permohonan:</strong> {{ ucwords($permohonan->status) }}</p>
|
||||
<p><strong>Cabang Pemohon:</strong> {{ $permohonan->user->branch->name }}</p>
|
||||
<p><strong>Tanggal Permohonan:</strong> {{ formatTanggalIndonesia($permohonan->created_at) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gap-5 w-full grid grid-cols-3 mt-5">
|
||||
<div>
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50" id="advanced_settings_appearance">
|
||||
<h3 class="card-title">
|
||||
1. Fasilitas Kredit
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5">
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900">
|
||||
Jenis Fasilitas
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900">
|
||||
: {{ $permohonan->jenisFasilitasKredit->name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900">
|
||||
Nilai Plafond
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900">
|
||||
: {{ $permohonan->nilaiPlafond->name }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border border-agi-100 mt-5 min-w-full">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
2. Identitas Debutur
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
<div class="grid grid-cols-1 xl:grid-cols-2 gap-5 lg:gap-7.5">
|
||||
<div class="col-span-1">
|
||||
<table class="table align-middle text-sm text-gray-500">
|
||||
<tr>
|
||||
<td class="py-2 text-gray-600 font-normal">
|
||||
Name
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->name ?? "" }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Cabang
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->branch->name ?? "" }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
CIF
|
||||
</td>
|
||||
<td class="py-2 text-gray-800 font-normaltext-sm">
|
||||
{{ $permohonan->debiture->cif ?? "" }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
Address
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->address ?? "" }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 text-gray-600 font-normal">
|
||||
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-sm font-normal">
|
||||
{{ $permohonan->debiture->village->name ?? "" }}, {{ $permohonan->debiture->district->name ?? "" }}, {{ $permohonan->debiture->city->name ?? "" }}, {{ $permohonan->debiture->province->name ?? "" }} - {{ $permohonan->debiture->village->postal_code ?? "" }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div class="col-1">
|
||||
<div class="crd">
|
||||
<div class="crd-header">1. Fasilitas Kredit</div>
|
||||
<div class="crd-body">
|
||||
<p><strong>Jenis Fasilitas:</strong> {{ $permohonan->jenisFasilitasKredit->name }}</p>
|
||||
<p><strong>Nilai Plafond:</strong> {{ $permohonan->nilaiPlafond->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Data Jaminan
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-table scrollable-x-auto pb-3">
|
||||
@foreach($permohonan->documents as $dokumen)
|
||||
<div class="card-body lg:py-7.5">
|
||||
<span class="text-base text-gray-900 font-bold mb-5">
|
||||
Jaminan {{ $loop->index + 1 }}
|
||||
</span>
|
||||
|
||||
<div class="mb-5 grid grid-cols-2 mt-5">
|
||||
<h3 class="text-md text-gray-900">
|
||||
Pemilik Jaminan
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900">
|
||||
: {{ $dokumen->pemilik->name?? "" }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900">
|
||||
Jenis Jaminan:
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900">
|
||||
: {{ $dokumen->jenisJaminan->name?? "" }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900">
|
||||
Hubungan Pemilik Jaminan:
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900">
|
||||
: {{ $dokumen->pemilik->hubungan_pemilik->name?? "" }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5 grid grid-cols-2">
|
||||
<h3 class="text-md text-gray-900">
|
||||
Alamat Pemilik Jaminan:
|
||||
</h3>
|
||||
<span class="text-md font-medium text-gray-900">
|
||||
: {{ $dokumen->pemilik->address ?? ""}},
|
||||
<br> {{ $dokumen->pemilik->village->name ?? "" }}, {{ $dokumen->pemilik->district->name ?? "" }}, {{ $dokumen->pemilik->city->name ?? "" }}, {{ $dokumen->pemilik->province->name ?? "" }} - {{ $dokumen->pemilik->village->postal_code ?? "" }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="crd">
|
||||
<div class="crd-header">2. Identitas Debitur</div>
|
||||
<div class="crd-body">
|
||||
<p><strong>Nama:</strong> {{ $permohonan->debiture->name ?? "" }}</p>
|
||||
<p><strong>Cabang:</strong> {{ $permohonan->debiture->branch->name ?? "" }}</p>
|
||||
<p><strong>CIF:</strong> {{ $permohonan->debiture->cif ?? "" }}</p>
|
||||
<p><strong>Alamat:</strong> {{ $permohonan->debiture->address ?? "" }}</p>
|
||||
<p>{{ $permohonan->debiture->village->name ?? "" }}, {{ $permohonan->debiture->district->name ?? "" }}, {{ $permohonan->debiture->city->name ?? "" }}, {{ $permohonan->debiture->province->name ?? "" }} - {{ $permohonan->debiture->village->postal_code ?? "" }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<div class="crd">
|
||||
<div class="crd-header">3. Data Jaminan</div>
|
||||
<div class="crd-body">
|
||||
@foreach($permohonan->documents as $index => $dokumen)
|
||||
<h4>Jaminan {{ $index + 1 }}</h4>
|
||||
<p><strong>Pemilik Jaminan:</strong> {{ $dokumen->pemilik->name ?? "" }}</p>
|
||||
<p><strong>Jenis Jaminan:</strong> {{ $dokumen->jenisJaminan->name ?? "" }}</p>
|
||||
<p><strong>Hubungan Pemilik Jaminan:</strong> {{ $dokumen->pemilik->hubungan_pemilik->name ?? "" }}</p>
|
||||
@if(!$loop->last)<hr style="margin: 10px 0;">@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
var printtable = document.getElementById('printtable');
|
||||
window.print(printtable);
|
||||
</script>
|
||||
<script type="module">
|
||||
window.onload = function() {
|
||||
window.print();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -216,7 +216,13 @@
|
||||
</a>`;
|
||||
}
|
||||
|
||||
return `<div class="flex flex-nowrap justify-center">`+iconDetail+iconProses+`</div>`;
|
||||
|
||||
var iconSendEmail = ` <a href="/tender/penawaran/${data.nomor_registrasi}/showKirimEmail" class="btn btn-sm btn-icon btn-clear btn-success" title="Kirim Email">
|
||||
<i class="ki-filled ki-paper-plane"></i>
|
||||
</a>`;
|
||||
|
||||
|
||||
return `<div class="flex flex-nowrap justify-center">`+iconDetail+iconProses+iconSendEmail+`</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7,48 +7,24 @@
|
||||
$route = explode('.', Route::currentRouteName());
|
||||
@endphp
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Detail Data Proses Penawaran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@php
|
||||
$buttonProses='';
|
||||
if('tender'==$prosespenawaran->status)
|
||||
{
|
||||
$buttonProses='<a href="'. route('tender.prosespenawaran.edit', $id) .'" class="btn btn-xs btn-primary" title="Proses Penawaran"><i class="ki-outline ki-notepad-edit"></i> Proses Penawaran</a>';
|
||||
}
|
||||
elseif ('proposal-tender'==$prosespenawaran->status)
|
||||
{
|
||||
$buttonProses='<a href="'. route('tender.prosespenawaran.editulang', $id) .'" class="btn btn-xs btn-primary" title="Proses Penawaran Ulang"><i class="ki-filled ki-arrow-circle-right"></i> Proses Penawaran Ulang</a>';
|
||||
}
|
||||
@endphp
|
||||
{!! $buttonProses !!}
|
||||
<a href="{{ route('tender.prosespenawaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body lg:py-7.5 grid grid-cols-3">
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Register Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $prosespenawaran->nomor_registrasi }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<h3 class="text-md font-medium text-gray-900">
|
||||
Nomor Penawaran:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $prosespenawaran->code }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@php
|
||||
$buttonProses='';
|
||||
if('tender'==$prosespenawaran->status)
|
||||
{
|
||||
$buttonProses='<a href="'. route('tender.prosespenawaran.edit', $id) .'" class="btn btn-xs btn-primary" title="Proses Penawaran"><i class="ki-outline ki-notepad-edit"></i> Proses Penawaran</a>';
|
||||
}
|
||||
elseif ('proposal-tender'==$prosespenawaran->status)
|
||||
{
|
||||
$buttonProses='<a href="'. route('tender.prosespenawaran.editulang', $id) .'" class="btn btn-xs btn-primary" title="Proses Penawaran Ulang"><i class="ki-filled ki-arrow-circle-right"></i> Proses Penawaran Ulang</a>';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@include('lpj::component.detail-jaminan', [
|
||||
'customlink' => $buttonProses,
|
||||
'backLink' => 'tender.prosespenawaran.index',
|
||||
'title' => 'Detail Data Proses Penawaran',
|
||||
])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -72,15 +72,7 @@
|
||||
<em id="{{$route[0]}}_catatan_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_sla" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
SLA (dalam satuan hari)
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="inputku input" name="{{$route[0]}}_sla" id="{{$route[0]}}_sla" placeholder="dalam satuan hari" type="text" />
|
||||
<em id="{{$route[0]}}_sla_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="{{ $route[0] }}_div_region" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Region
|
||||
@@ -92,6 +84,18 @@
|
||||
<em id="{{$route[0]}}_region_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_jenis_laporan" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="inputku select" id="jenis_laporan" name="jenis_laporan">
|
||||
<option value="sederhana">Sederhana</option>
|
||||
<option value="standar">Standar</option>
|
||||
</select>
|
||||
<em id="jenis_laporan_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_catatan2" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user